Closed cryptodeveloperin closed 6 years ago
The likely reason it does not work is because of race conditions.
Imagine both Alice and Bob ask to send to Satoshi at same time.
Alice:
Now because Alice and Bob are both using the same UTXO 1, one of those transaction will fail.
You should keep track locally of the UTXO you used so that you can filter them out before feeding the transaction builder with the coins.
I have automate btc sending from c# webapplication using following code. This following code works sometime but sometime not works. If i use the transaction.tohex() and paste to https://testnet.smartbit.com.au/txs then it will transfer the btc. Please let me know what is wrong? I am using nbitcoin version 39. i want permanent solution. please help me. Because i want to make my code live tomorrow.
transaction.Inputs.Add(new TxIn(coin.Outpoint, masterKey.ExtKey.Derive((uint)txBalance.UserAutoId).ScriptPubKey));
}