bitpay / bitcore-p2p

Interface to the bitcoin P2P network for bitcore
MIT License
80 stars 276 forks source link

Fix Bloom filters with vData length >255 #74

Closed mappum closed 9 years ago

mappum commented 9 years ago

Currently, the Bloom filter deserialization code assumes the length data segment is a uint8 value, when it should be a varint. This has let the implementation pass the tests and work for small filters, but for filters larger than 255, the code will break.

This PR fixes the problem by using varint length for the Bloom filter deserialzation, and also adds a test for serialization/deserialization of large filters to catch this case.

braydonf commented 9 years ago

ACK