What do you do with that now?
We use decoderawtransaction to get the following:
"txid" : "310791a1863c7a61b460795bfd76bda8adf1b1d309c91e489392b90e12c82e99",
"version" : 1,
"locktime" : 0,
"vin" : [
{
"txid" : "053f08c42e609cf2d8be74f20faf9c2b93336c2505a8e8889a6c7394b1cf878f",
"vout" : 0,
"scriptSig" : { . . . },
"sequence" : 4294967295
}, {
"txid" : "9539f76b7cd9c9828773ed89ada065a83dc748c12d272f17e33422db72e29647",
"vout" : 1,
"scriptSig" : { . . . },
"sequence" : 4294967295
}, {
"txid" : "ad0179afbc25e17cff605813722d6fcad6cee3205d8f0a5a30789d537f1e6505",
"vout" : 0,
"scriptSig" : { . . . },
"sequence" : 4294967295
}, {
"txid" : "6f33986e049f81c0dbe38062b47ae88e2d6b4ca569647b020f576aabb2b90023",
"vout" : 1,
"scriptSig" : { . . . },
"sequence" : 4294967295
}, {
"txid" : "0f4774797f96eb7c6a1344158a81d81e027ef4151ac496b2a7e26a80ce9bd3c7",
"vout" : 0,
"scriptSig" : { . . . },
"sequence" : 4294967295
}, {
"txid" : "7fa2add7fb96c27dbd8d7a0ebac96122ec288afc02416371e40615258200fcef",
"vout" : 0,
"scriptSig" : { . . . },
"sequence" : 4294967295
}
],
"vout" : [
{
"value" : 0.01001375,
"n" : 0,
"scriptPubKey" : {
"asm" : "OP_DUP OP_HASH160 d16177d3f0135568376cff9e68cc4e170bd738c1 OP_EQUALVERIFY OP_CHECKSIG",
"hex" : "76a914d16177d3f0135568376cff9e68cc4e170bd738c188ac",
"reqSigs" : 1,
"type" : "pubkeyhash",
"addresses" : [
"1L66zJ1ixBpkVL57kg3w7dZbUUbxTvcJ29"
]
}
}, {
"value" : 2.95800000,
"n" : 1,
"scriptPubKey" : {
"asm" : "OP_DUP OP_HASH160 a07b08343ec106405365332850b320f87accc4a4 OP_EQUALVERIFY OP_CHECKSIG",
"hex" : "76a914a07b08343ec106405365332850b320f87accc4a488ac",
"reqSigs" : 1,
"type" : "pubkeyhash",
"addresses" : [
"1FdYW7LvSmP9xejrdVKp6Fpe37WKRpoGKv"
]
}
}
]
Where we see that this transaction is attempting to spend the following 5 valid outputs:
https://blockchain.info/tx-index/113393756/0"txid" : "053f08c42e609cf2d8be74f20faf9c2b93336c2505a8e8889a6c7394b1cf878f",
"vout" : 0,
https://blockchain.info/tx-index/113394651/1"txid" : "9539f76b7cd9c9828773ed89ada065a83dc748c12d272f17e33422db72e29647",
"vout" : 1,
https://blockchain.info/tx-index/113342441/0"txid" : "ad0179afbc25e17cff605813722d6fcad6cee3205d8f0a5a30789d537f1e6505",
"vout" : 0,
https://blockchain.info/tx-index/113368281/0"txid" : "0f4774797f96eb7c6a1344158a81d81e027ef4151ac496b2a7e26a80ce9bd3c7",
"vout" : 0,
https://blockchain.info/tx-index/113390455/0"txid" : "7fa2add7fb96c27dbd8d7a0ebac96122ec288afc02416371e40615258200fcef",
"vout" : 0,
We also see that the transaction is attempting to spend the following invalid output:
"txid" : "6f33986e049f81c0dbe38062b47ae88e2d6b4ca569647b020f576aabb2b90023",
"vout" : 1,
Looking at the blockchain we see that there is an identical transaction with a different transaction ID:
https://blockchain.info/tx/cf2dfcbf2b15eacf2272fb0f19b5760b7069f6dfff2165f68606a3f21eee4681But the outputs from that transaction are all already spent.
It appears that you received (or created) transaction ID 6f33986e049f81c0dbe38062b47ae88e2d6b4ca569647b020f576aabb2b90023 but tried to spend the 0.01002837 BTC before it had received any confirmations. Due to the "transaction malleability" that has been widely discussed recently, someone on the bitcoin network modified the transaction ID of the 6f33986e049f81c0dbe38062b47ae88e2d6b4ca569647b020f576aabb2b90023 to be cf2dfcbf2b15eacf2272fb0f19b5760b7069f6dfff2165f68606a3f21eee4681 instead.
Unfortunately, your software was unaware of the modified transaction ID. (It would have learned about it once the transaction was confirmed, but by then you had already created and attempted to broadcast the 310791...c82e99 transaction that you are asking about). Eventually, the cf2dfc...ee4681 transaction confirmed, and the 6f3398...b90023 transaction ID ceased to exist. Your new transaction 310791...c82e99 is therefore attempting to spend a non-existent output.
Meanwhile somewhere else in your system, once the cf2dfc...ee4681 transaction confirmed, you've created transaction ID cd27f67d71a9d05cdaafefaa8e52f57119f48b71f7b898bb6a75781e7e5ffeff which spends the same 0.01002837 BTC output that you were trying to spend in the 6f3398...b90023 transaction. Therefore the 0.01002837 BTC is no longer available to fund the transaction attempting to send to 0.01001375 BTC to 1L66zJ1ixBpkVL57kg3w7dZbUUbxTvcJ29 and 2.958 BTC to 1FdYW7LvSmP9xejrdVKp6Fpe37WKRpoGKv
To prevent such problems, don't spend transactions that haven't yet confirmed (since there is no guarantee that they will ever confirm, and since transaction malleability means that you can't count on the transactionID of an unconfirmed transaction).