1
In an attempt to more fully understand raw transactions etc, I went to look at tx 518c41d5e59114f6a23383afbe95f02cdd09cb50cabd8390bdd9162a890435b3 in its raw form being:
01000000017871f56f7be2743293abb1adccf21526265e4ad793fddbc08508417293fd6b4e000000006a47304402201f3b98d55c16a1ff9e66cbdd5533fd74d18362477f50dbce357d66e1233ba469022066fd837cf7e1e030f5aab0f22fec06c7d98ee948fd8b9aba185512426079e0a201210284ca3e364bebb4cafb9fa76624927078e16a4244314f824ea8acff0ef1ba4627ffffffff0220a10700000000001976a91488d924f51033b74a895863a5fb57fd545529df7d88ac81f1d909000000001976a914db4c1f7949870fae5cdc366a45e2ea39c084547c88ac00000000
I then tried to submit that raw form, just copy and paste into my bitcoin wallet program to "sendrawtransaction" and got the error missing inputs (code -25). This seems odd in it of itself because since this is an exact copy and paste of the raw transaction that is on the blockchain, shouldn't it not be missing anything at all? Also, shouldn't I be getting a "transaction already exists" error instead? Or do I not understand something about how raw transactions are submitted?
1
In that case, what is the point of fHaveChain in https://github.com/bitcoin/bitcoin/blob/master/src/rpc/rawtransaction.cpp#L950 which throws RPC_TRANSACTION_ALREADY_IN_CHAIN ?
– MeshCollider – 2017-08-17T03:02:40.6272@MeshCollider If I'm reading it right, if some of the outputs of the transaction exist in the blockchain and are unspent, then sendrawtransaction fails with that error, instead of failing with the missing inputs error. – Nick ODell – 2017-08-17T04:05:59.240