Bit-Wasp/bitcoin-lib-php

RawTransaction::decode will fail on version numbers that are not equal to 1.

in3rsha opened this issue · 0 comments

I realize that this is an outdated script, but I just wanted to leave a note to mention that RawTransaction::decode will fail if you try and decode a transaction that has a version number that is not equal to "0" or "1".

This is useful when creating and verifying your own transactions. However, on the off chance that you are parsing the entire blockchain, you should be aware that the script will not decode the following transactions:

637dd1a3418386a418ceeac7bb58633a904dbf127fa47bbea9cc8f86fef7413f (version: 2187681472)
c659729a7fea5071361c2c1a68551ca2bf77679b27086cc415adeeb03852e369 (version: 2591798512)
a7b0fd34c953aeabe93b984bc0e3690ea0165eacab450a5af453cc0ec3307c44 (version: 2)

In that case you will want to remove the check here: https://github.com/Bit-Wasp/bitcoin-lib-php/blob/master/src/RawTransaction.php#L599