Lately I had an error, which I may by no means reproduce once more. I do not need this error to happen in manufacturing, however I do not know how you can repair this both or what may even be the rationale for it.
First, here’s what I did, in brief:
- My backend generated a brand new handle.
- I despatched some funds to the handle.
- Backend waited, till the funds seem within the handle (by polling mempool.area API).
- Backend took the array of UTXOs of this handle, iterated by this array solely as soon as, including UTXOs to transaction inputs, till the mandatory sending quantity is roofed.
- Backend submitted TX Hex of this transaction to mempool.area.
This resulted within the “code”: -26, “bad-txns-inputs-duplicate” error.
Google says it happens, when a UTXO is spent a number of occasions in a single transaction. I reviewed the code totally, it’s not possible {that a} UTXO was added into tx inputs a number of occasions.
Additionally, it was the primary transaction of the pockets, so there was no earlier transaction, that might spend a UTXO.
Any concepts concerning what may occur there?