petertodd / python-bitcoinlib

Python3 library providing an easy interface to the Bitcoin data structures and protocol.
Other
1.81k stars 620 forks source link

Wrong TxID returned after parsing transaction #302

Open su-sd opened 1 month ago

su-sd commented 1 month ago
from bitcoinlib.transactions import Transaction
t = Transaction.parse_hex("010000000001015f424ce9986799d7ff7025ddb0ce16349a42729cea9897f66858d14d98fa7ee70000000023220020b14beb21fa9eb2aeaa0b1742bb21d85f4dcc0d352652b29c43e2c66744ab7319ffffffff0b05a985020000000017a914572290324c72e6842e8a77c2cbb9882a3b9c2a9f879f4a02000000000017a91458f1fa31cc829e724273afce48f448b6f3b43ff28760ae0a000000000017a914068058657c43f6dfaa0ff33dce5b6b99aad434a78700051400000000001976a914e55671053ac8f886b8e11506b9bd8b91cad0b84088ac34961b00000000001976a914b93f1adbbea4b6f4779e88857c65d1936b3580af88ac5e281c00000000001976a914e098c7c0935981df505a5f73a890e4f8d4c653bd88ac1e192e00000000001976a91401475b686add41c2739bc1d5909bbbf126ef93c688ac1e192e000000000016001474eca93775f43fbd38872d5383fb53aa4443b3b3284c6300000000001976a914fec6fe8eea8ebdf9eeadefd68dae36489133e84e88ac7e142501000000001976a91482d2b4a884dfcd753b66a051b53b3dc646ba2f7c88ac40a5ae0200000000160014c6d4c0a4f6c15202e36e5a776aac3830f873718803483045022100b250468865624494e94f6fa24f13b8cce6b05b91f0f7c549af25198bec66b30a02207156da8423235d24d30a84460ea847842f1f5466a8ee2d2f1c681b7350e18671012103e866d1af0164385274442a481f503fea937a504ec1823bf2dbf2585bc658a23a1976a9140f5afe119a0015a285f0f3ebd7dcab492d823a0788ac00000000")
t.txid
> 015c87898103e683e41aef8366eb8ce851005507790f284ecde9aa001b77cd52

Correct TxID would be 4478910237ca7009f6085bb25905dd101737a0a75301e3321e74c3307b4389e7