You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Tx.verify_input in Chap. 13, the length of the redeem script is computed using int_to_little_endian(len(cmd), 1). As stated in the code comment 'prepend the length of the RedeemScript using encode_varint' in Chap. 8 it should be computed using encode_varint(len(cmd)), to be compatible with Script.parse.
According to BIP16 '520-byte limitation on serialized script size' a P2SH redeem script can have a serialized script length of up to 520 bytes. Thus the present code will cause failure for a redeem script length >= 253. For example a CHECKMULTISIG redeem script with 8 or more compressed public keys (=> length >= 3 + 8*34 = 275 bytes) will raise an OverflowError exception as int_to_little_endian fails.
The text was updated successfully, but these errors were encountered:
In Tx.verify_input in Chap. 13, the length of the redeem script is computed using
int_to_little_endian(len(cmd), 1)
. As stated in the code comment 'prepend the length of the RedeemScript using encode_varint' in Chap. 8 it should be computed usingencode_varint(len(cmd))
, to be compatible with Script.parse.According to BIP16 '520-byte limitation on serialized script size' a P2SH redeem script can have a serialized script length of up to 520 bytes. Thus the present code will cause failure for a redeem script length
>= 253
. For example a CHECKMULTISIG redeem script with 8 or more compressed public keys (=> length >= 3 + 8*34 = 275 bytes) will raise anOverflowError
exception asint_to_little_endian
fails.The text was updated successfully, but these errors were encountered: