karask / python-bitcoin-utils

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

Fix data length bytes in op_push_data #59

Closed ly0 closed 7 months ago

ly0 commented 7 months ago

.encode() will return 2 bytes when a one-byte encoded string is greater than 127, which will generate a wrong script.

In [1]: chr(128).encode()
Out[1]: b'\xc2\x80'
karask commented 7 months ago

Thank you for the fix.