btcsuite / btcd

An alternative full node bitcoin implementation written in Go (golang)
https://github.com/btcsuite/btcd/blob/master/README.md
ISC License
6.2k stars 2.35k forks source link

Check if input was entirely consumed in `decoderawtransaction`/`btcDecode` #2195

Open brunoerg opened 3 months ago

brunoerg commented 3 months ago

Using the decoderawtransaction command (btcDecode function?) we noticed that it does not check if the entire input was successfully consumed when decoding which is important to keep it consistent.

To reproduce:

decoderawtransaction "0a9a9e0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010100000000010001010101a09a"

Obs.: Running same command on Bitcoin Core fails.

Crypt-iQ commented 3 months ago

Thanks for reporting, we can address this. Seems like just an API mismatch (discarding the extra bytes vs erroring) though I think we should match bitcoind's behavior here.

brunoerg commented 3 months ago

Thanks for reporting, we can address this. Seems like just an API mismatch (discarding the extra bytes vs erroring) though I think we should match bitcoind's behavior here.

Sounds good, thank you.