The following code creates a bitcoin transaction with 1 input and 1 output. The sender and recipient addresses are the same. fundingTx - existing transaction with 1 unspent output, senderAddresses - NBitcoin.BitcoinAddress array with 1 element - sender address (including private key), coin - fundingTx output with index 0 (first and only), recipient - recipient (NBitcoin.BitcoinAddress, that same address as the sender), fees - transaction fee (correct value in satoshies).
That is, the problem is with how coin is processed. In this case, builder.Verify returns true, that is, the transaction was formed "correctly". Tell me how to fix it?
The following code creates a bitcoin transaction with 1 input and 1 output. The sender and recipient addresses are the same.
fundingTx
- existing transaction with 1 unspent output,senderAddresses
-NBitcoin.BitcoinAddress
array with 1 element - sender address (including private key),coin
-fundingTx
output with index 0 (first and only),recipient
- recipient (NBitcoin.BitcoinAddress
, that same address as the sender), fees - transaction fee (correct value in satoshies).As a result, sometimes I get this nonsense:
That is, the problem is with how coin is processed. In this case,
builder.Verify
returns true, that is, the transaction was formed "correctly". Tell me how to fix it?