Transactions in stale blocks still show in txindex #6787

issue maiiz opened this issue on October 9, 2015
  1. maiiz commented at 9:14 AM on October 9, 2015: contributor

    there two transaction, because bitcoin malleability attack ,the transaction 3bb876013ffdac65ada2b89b042212a5f12750aeb97d1019950c83354985402c be confirmed.so the other transaction cdec67e52e7f7c73256bcd4dc07d8b7d4d1d8326faea396d189fb81612eed7ba will be invalid,and not in mempool. but when i run below the invalid transaction cdec67e52e7f7c73256bcd4dc07d8b7d4d1d8326faea396d189fb81612eed7ba still in mempool. see below:

    <pre><code>[root@centos]# bitcoin-cli getrawtransaction 3bb876013ffdac65ada2b89b042212a5f12750aeb97d1019950c83354985402c 1 { "hex" : "0100000001a1240e62b297f2152826ebe23fc73ad5f022b86acd53a9ff3ce9a152ff41ef82010000006b483045022031745451764c82722921f74603c956e0b679085f62b0ea64ba7f8799ffd440b2022100fd4c4d98a7706abdbeef8796480dc0e56dd2d767e16db2c7d8f23ba04efa28060121022c495c8dfd8be23a268843865b3220dfd08310c55079ab0de59a8fb7a28a8872feffffff02aba27a12000000001976a9145cbfc7b26c28233adc77c4fa7aea27a7ea648d9088accd162029000000001976a914df3b8fdc90efa2c6ca508d5e5ef2b55039cd1c4388ace0c40500", "txid" : "3bb876013ffdac65ada2b89b042212a5f12750aeb97d1019950c83354985402c", "version" : 1, "locktime" : 378080, "vin" : [ { "txid" : "82ef41ff52a1e93cffa953cd6ab822f0d53ac73fe2eb262815f297b2620e24a1", "vout" : 1, "scriptSig" : { "asm" : "3045022031745451764c82722921f74603c956e0b679085f62b0ea64ba7f8799ffd440b2022100fd4c4d98a7706abdbeef8796480dc0e56dd2d767e16db2c7d8f23ba04efa280601 022c495c8dfd8be23a268843865b3220dfd08310c55079ab0de59a8fb7a28a8872", "hex" : "483045022031745451764c82722921f74603c956e0b679085f62b0ea64ba7f8799ffd440b2022100fd4c4d98a7706abdbeef8796480dc0e56dd2d767e16db2c7d8f23ba04efa28060121022c495c8dfd8be23a268843865b3220dfd08310c55079ab0de59a8fb7a28a8872" }, "sequence" : 4294967294 } ], "vout" : [ { "value" : 3.10026923, "n" : 0, "scriptPubKey" : { "asm" : "OP_DUP OP_HASH160 5cbfc7b26c28233adc77c4fa7aea27a7ea648d90 OP_EQUALVERIFY OP_CHECKSIG", "hex" : "76a9145cbfc7b26c28233adc77c4fa7aea27a7ea648d9088ac", "reqSigs" : 1, "type" : "pubkeyhash", "addresses" : [ "19TQum92fZfCNrTHWoazwd3UHXEf8htqow" ] } }, { "value" : 6.89968845, "n" : 1, "scriptPubKey" : { "asm" : "OP_DUP OP_HASH160 df3b8fdc90efa2c6ca508d5e5ef2b55039cd1c43 OP_EQUALVERIFY OP_CHECKSIG", "hex" : "76a914df3b8fdc90efa2c6ca508d5e5ef2b55039cd1c4388ac", "reqSigs" : 1, "type" : "pubkeyhash", "addresses" : [ "1MMM3DWWcDU6ZAw74huLi8daoztr6M4gd7" ] } } ], "blockhash" : "00000000000000000d1ce717c49be25b22be331913e3f2d1337788036f2e3c49", "confirmations" : 30, "time" : 1444369147, "blocktime" : 1444369147 } [root@centos ]# bitcoin-cli getrawtransaction cdec67e52e7f7c73256bcd4dc07d8b7d4d1d8326faea396d189fb81612eed7ba 1 { "hex" : "0100000001a1240e62b297f2152826ebe23fc73ad5f022b86acd53a9ff3ce9a152ff41ef82010000006a473044022031745451764c82722921f74603c956e0b679085f62b0ea64ba7f8799ffd440b2022002b3b267588f954241107869b7f23f194cdc057ecddaed73e6e022ec813c193b0121022c495c8dfd8be23a268843865b3220dfd08310c55079ab0de59a8fb7a28a8872feffffff02aba27a12000000001976a9145cbfc7b26c28233adc77c4fa7aea27a7ea648d9088accd162029000000001976a914df3b8fdc90efa2c6ca508d5e5ef2b55039cd1c4388ace0c40500", "txid" : "cdec67e52e7f7c73256bcd4dc07d8b7d4d1d8326faea396d189fb81612eed7ba", "version" : 1, "locktime" : 378080, "vin" : [ { "txid" : "82ef41ff52a1e93cffa953cd6ab822f0d53ac73fe2eb262815f297b2620e24a1", "vout" : 1, "scriptSig" : { "asm" : "3044022031745451764c82722921f74603c956e0b679085f62b0ea64ba7f8799ffd440b2022002b3b267588f954241107869b7f23f194cdc057ecddaed73e6e022ec813c193b01 022c495c8dfd8be23a268843865b3220dfd08310c55079ab0de59a8fb7a28a8872", "hex" : "473044022031745451764c82722921f74603c956e0b679085f62b0ea64ba7f8799ffd440b2022002b3b267588f954241107869b7f23f194cdc057ecddaed73e6e022ec813c193b0121022c495c8dfd8be23a268843865b3220dfd08310c55079ab0de59a8fb7a28a8872" }, "sequence" : 4294967294 } ], "vout" : [ { "value" : 3.10026923, "n" : 0, "scriptPubKey" : { "asm" : "OP_DUP OP_HASH160 5cbfc7b26c28233adc77c4fa7aea27a7ea648d90 OP_EQUALVERIFY OP_CHECKSIG", "hex" : "76a9145cbfc7b26c28233adc77c4fa7aea27a7ea648d9088ac", "reqSigs" : 1, "type" : "pubkeyhash", "addresses" : [ "19TQum92fZfCNrTHWoazwd3UHXEf8htqow" ] } }, { "value" : 6.89968845, "n" : 1, "scriptPubKey" : { "asm" : "OP_DUP OP_HASH160 df3b8fdc90efa2c6ca508d5e5ef2b55039cd1c43 OP_EQUALVERIFY OP_CHECKSIG", "hex" : "76a914df3b8fdc90efa2c6ca508d5e5ef2b55039cd1c4388ac", "reqSigs" : 1, "type" : "pubkeyhash", "addresses" : [ "1MMM3DWWcDU6ZAw74huLi8daoztr6M4gd7" ] } } ], "blockhash" : "0000000000000000030ad9ac88e664eff0a6de343a086dea5bba708e052227aa", "confirmations" : 0 } [root@centos ]# bitcoin-cli getinfo { "version" : 100200, "protocolversion" : 70002, "walletversion" : 60000, "balance" : 0.00000000, "blocks" : 378121, "timeoffset" : 523, "connections" : 49, "proxy" : "", "difficulty" : 60813224039.44034576, "testnet" : false, "keypoololdest" : 1426660142, "keypoolsize" : 101, "paytxfee" : 0.00000000, "relayfee" : 0.00001000, "errors" : "" } </pre></code>

    it's a bug !

  2. dexX7 commented at 1:35 PM on October 9, 2015: contributor

    Note:

        "blockhash" : "00000000000000000d1ce717c49be25b22be331913e3f2d1337788036f2e3c49",
        "confirmations" : 30,
        "time" : 1444369147,
        "blocktime" : 1444369147
    
        "blockhash" : "0000000000000000030ad9ac88e664eff0a6de343a086dea5bba708e052227aa",
        "confirmations" : 0
    

    That second block was orphaned, but already indexed transactions are not dropped. I wouldn't call it bug, but I agree, this can lead to confusion. It would probably be good, if "getrawtransaction" would have a similar behavior as "getransaction", which indicates, whether a transaction is orphaned ("confirmations": -1), in the memory pool ("confirmations": 0), or confirmed ("confirmations": >0).

    It's a coincidence that one was mutated, while the other wasn't.

  3. maiiz commented at 3:58 AM on October 10, 2015: contributor

    @dexX7 yes you are wright, thx. other do you know the recent bitcoin malleability attack of low S and hight S. there so many attack transaction in the network.

  4. laanwj added the label UTXO Db and Indexes on Oct 13, 2015
  5. laanwj renamed this:
    find the bug becaouse ongoing bitcoin malleability attack
    Transactions in stale blocks still show in txindex
    on Oct 13, 2015
  6. laanwj commented at 8:42 AM on October 13, 2015: member

    I've renamed the issue. This seems to be a valid problem, but is not specific to 'attacks'.

  7. luke-jr commented at 4:15 AM on January 9, 2016: member

    Eh, sounds like "works as intended" to me.

  8. pinheadmz commented at 8:08 PM on April 14, 2023: member

    Eh, sounds like "works as intended" to me.

    Agreed. This is what I expect the index to do, I think we can close this issue

  9. pinheadmz closed this on Apr 14, 2023

  10. bitcoin locked this on Apr 13, 2024

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-22 06:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me