Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: CIYAM on November 07, 2013, 12:10:46 PM



Title: What is wrong with this raw transaction?
Post by: CIYAM on November 07, 2013, 12:10:46 PM
I have the following raw transaction (which was created via "createrawtransaction" and successfully signed with "signrawtransaction"):

Code:
0100000001c6689b75fcd871d1ed428e4630163601183288628d5fbe5c76c7339003b0e828000000008b48304502203deb0b9f61c88bc2bb5df24acb330b6cf1f2b9b8140203cafbf5db29935dd2a60221009c7c5fc049daf358ec392c0387022218b971a2f0c50386947e3b30c71f4bd2d201410408dc1b7167df71b68c12ec0a7e77ccb602cbcb1966f3bff773c925530905d3996e7a6c7eb8a404d5dbebff428ed36d1b9c8ab70dfebe9e80e0bd6b1dd298b677ffffffff01807c4301000000001976a91407dd428c4c6f8752d5ded10edabab12d912de14e88ac00000000

which if I paste after decoderawtransaction gives me the following:

Code:
{
"txid" : "c4b58d28e59e08c6cfa6272a8b56471896833aa20a5f2b05a952e6f9f0421e46",
"version" : 1,
"locktime" : 0,
"vin" : [
{
"txid" : "28e8b0039033c7765cbe5f8d6288321801361630468e42edd171d8fc759b68c6",
"vout" : 0,
"scriptSig" : {
"asm" : "304502203deb0b9f61c88bc2bb5df24acb330b6cf1f2b9b8140203cafbf5db29935dd2a60221009c7c5fc049daf358ec392c0387022218b971a2f0c50386947e3b30c71f4bd2d201 0408dc1b7167df71b68c12ec0a7e77ccb602cbcb1966f3bff773c925530905d3996e7a6c7eb8a404d5dbebff428ed36d1b9c8ab70dfebe9e80e0bd6b1dd298b677",
"hex" : "48304502203deb0b9f61c88bc2bb5df24acb330b6cf1f2b9b8140203cafbf5db29935dd2a60221009c7c5fc049daf358ec392c0387022218b971a2f0c50386947e3b30c71f4bd2d201410408dc1b7167df71b68c12ec0a7e77ccb602cbcb1966f3bff773c925530905d3996e7a6c7eb8a404d5dbebff428ed36d1b9c8ab70dfebe9e80e0bd6b1dd298b677"
},
"sequence" : 4294967295
}
],
"vout" : [
{
"value" : 0.21200000,
"n" : 0,
"scriptPubKey" : {
"asm" : "OP_DUP OP_HASH160 07dd428c4c6f8752d5ded10edabab12d912de14e OP_EQUALVERIFY OP_CHECKSIG",
"hex" : "76a91407dd428c4c6f8752d5ded10edabab12d912de14e88ac",
"reqSigs" : 1,
"type" : "pubkeyhash",
"addresses" : [
"1iankj4HSpksoUgXSm8G7Gf7dkvLP3V9d"
]
}
}
]
}

but if I attempt to send it using sendrawtransaction then I get the TX rejected (code -22) error (which I think is normally for badly formatted JSON data).


Title: Re: What is wrong with this raw transaction?
Post by: dserrano5 on November 07, 2013, 01:18:35 PM
Seems like the txid referenced in the vin doesn't exist. Both my localbitcoind and blockchain.info don't know about it.

Code:
$ bitcoind getrawtransaction 28e8b0039033c7765cbe5f8d6288321801361630468e42edd171d8fc759b68c6
error: {"code":-5,"message":"No information available about transaction"}

I'm running with txindex=1.


Title: Re: What is wrong with this raw transaction?
Post by: CIYAM on November 07, 2013, 01:33:36 PM
Seems like the txid referenced in the vin doesn't exist. Both my localbitcoind and blockchain.info don't know about it.

Ah - thanks for that (I know what I've done wrong now).

It's a pity the error handling for the raw transactions API is so minimal.


Title: Re: What is wrong with this raw transaction?
Post by: DannyHamilton on November 07, 2013, 06:03:11 PM
It's a pity the error handling for the raw transactions API is so minimal.

+1