3
1
I have 10 btc on address A.
Using raw transaction, I send 5btc from A to B and set the change address as A itself. Now because the transaction from A to B is not confirmed I can't spend the remaining 5 btc.
But I saw that the QT wallet can do this. Ex:
I have 10 btc on address A. I send 5btc to B. The wallet creates a new address C and sets it as the change address. Then I try using the 5 btc on the wallet and it works. It allows me to send from address C.
1) Is the wallet using unconfirmed outputs as inputs here?
2) If so, how is it doing this and how can I do it using raw transactions?
3) If not, what's going on here?
createrawtransaction does support spending unconfirmed inputs; see https://gist.github.com/gavinandresen/3966071#file-twoofthree-sh-L42 for an example.
– gavinandresen – 2013-09-03T02:24:43.800@gavinandresen Looking into it more, it seems to me that we're both wrong. In your example,
createrawtransactiondoesn't actually look at the providedredeemScriptorscriptPubKeyAFAICT.createrawtransactionuses whatever data you give it, and it doesn't even use the block database.signrawtransactiondoes needredeemScriptandscriptPubKeyfor unconfirmed transactions. – theymos – 2013-09-03T04:33:33.313