gcash / neutrino

Privacy-Preserving Bitcoin Cash Light Client
MIT License
8 stars 9 forks source link

Add option to download unconfirmed transactions #6

Closed cpacia closed 5 years ago

cpacia commented 5 years ago

This commit adds unconfirmed transaction download functionality. While it's true that this will use quite a bit of data for an SPV wallet, the way we expect people to use an SPV wallet is to only open it for a few minutes here and there and thus the data usage shouldn't be too great.

To get this functionality we are using match all and match none bloom filters. This allows us to programtically turn on and off relaying on the remote peer. It's kind of unfortunate that this way adds a dependency on NODE_BLOOM but at least right now BCHD node support NODE_BLOOM and NODE_CF by default so this shouldn't be that big of a deal.

It will also allow for a future 'trusted peer' mode where we use the bloom filter the normal way to reduce bandwidth since we aren't concerned about privacy if we're connected to a trusted peer.