Bitcoin Forum
June 30, 2024, 12:51:10 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How in bitcoind to spend unconfirmed transaction?  (Read 533 times)
Affinity (OP)
Newbie
*
Offline Offline

Activity: 6
Merit: 0


View Profile
January 26, 2016, 01:35:23 PM
 #1

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?
unamis76
Legendary
*
Offline Offline

Activity: 1512
Merit: 1009


View Profile
January 26, 2016, 02:13:25 PM
 #2

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.
DannyHamilton
Legendary
*
Offline Offline

Activity: 3430
Merit: 4681



View Profile
January 26, 2016, 02:50:01 PM
 #3

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.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!