Author

Topic: How in bitcoind to spend unconfirmed transaction? (Read 545 times)

legendary
Activity: 3472
Merit: 4794
Dear Sirs, is it possible using bitcoind JSON-RPC API to receive funds from someone to my address and send it immediately to another third-party address? I want to speed up the process and do not want to wait for 1 confirmation.

I tried 'sentfrom' and 'sendtoaddress' api methods, but it looks like they ignore 'minconf=0' and return 'Insufficient funds' error.

Maybe 'createrawtransaction' will help me in my task?

As unamis76 has already mentioned, it can be done with the createrawtransaction, signrawtransaction, and send rawtransaction commands.

However, be aware that due to transaction malleability, it is possible that the transaction that you send could become invalid when the transaction that you receive becomes confirmed.  In that case the third party address won't receive the bitcoins until you go back and rebuild a valid transaction.

Also be aware that it will be possible for the transaction that you receive to become invalid (intentionally or accidentally) before it confirms.  If this happens, then the transaction that you send would also become invalid.  You would need to contact whomever sent you the transaction in the first place to get them to re-send it, and then would need to re-send your own transaction.
legendary
Activity: 1512
Merit: 1012
Yes, you'll have to create a raw transaction. And as far as I can see you have to give extra parameters to signrawtransaction for it to know you're spending unconfirmed inputs.
newbie
Activity: 6
Merit: 0
Dear Sirs, is it possible using bitcoind JSON-RPC API to receive funds from someone to my address and send it immediately to another third-party address? I want to speed up the process and do not want to wait for 1 confirmation.

I tried 'sentfrom' and 'sendtoaddress' api methods, but it looks like they ignore 'minconf=0' and return 'Insufficient funds' error.

Maybe 'createrawtransaction' will help me in my task?
Jump to: