karask / python-bitcoin-utils

Library to interact with the Bitcoin network. Ideal for low-level learning and experimenting.
MIT License
262 stars 99 forks source link

Transaction id mismatch #58

Closed CedarMist closed 5 months ago

CedarMist commented 6 months ago

I occasionally run into errors when parsing raw transactions (returned from getrawtransaction), one such example is:

Calculated txid 51ade4ff7f403e4f8abe2fddbb03bd890a7e79f5345f78452c3f0cb49ebb41bb
Actual txid 434ebb1d15a184ea5d9b4be02ae6c99a6f4b3095b7c9601e5bad672bf326e157

TX mismatch! Raw tx:

010000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff5103de940c184d696e656420627920536563506f6f6c29003b04003540adfabe6d6d95774a0bdc80e4c5864f6260f220fb71643351fbb46be5e71f4cabcd33245b2802000000000000000000601e4e000000ffffffff04220200000000000017a9144961d8e473caba262a450745c71c88204af3ff6987865a86290000000017a9146582f2551e2a47e1ae8b03fb666401ed7c4552ef870000000000000000266a24aa21a9ede553068307fd2fd504413d02ead44de3925912cfe12237e1eb85ed12293a45e100000000000000002b6a2952534b424c4f434b3a4fe216d3726a27ba0fb8b5ccc07717f7753464e51e9b0faac4ca4e1d005b0f4e0120000000000000000000000000000000000000000000000000000000000000000000000000

It seems just excluding coinbase transactions from my script avoids this problem.

karask commented 6 months ago

Thanks for reporting. The structure of a coinbase is supposed to be the same but apparently I might have missed something. I will look into it when I find some time.

karask commented 5 months ago

Found the issue and fixed it (v0.6.5). Should be OK but let me know if you still have issues.