Commit Graph

7 Commits

Author SHA1 Message Date
tomFlowee adfe4081cb Update copyright notice and email address 2021-02-02 13:08:07 +01:00
TomZ 4b0bcf7bc9 Add priority to privacySegment
We connect to the "first" priority stated segments first, in order to
allow the UX to be made much better since it may take a bit of time to
find peers.
2020-10-19 14:04:57 +02:00
TomZ cf01da9164 API review: privacySegment
The uint256 and CKeyID classes are the same baseclass with template
differences only, which makes them fragile to use for overloading.

As such rename the convenience overload slightly.
2020-06-07 13:56:55 +02:00
TomZ cde1372b2e Make PrivacySegment emit signals
this adds a listener interface and a way to emit the callbacks on
changing of the filter.

This also adds a mutex since we expect the Peer to use the filter which
will likely live in its own thread.
This makes the class thread safe and re-entrant.

Notice that we use a recursive mutex to allow various usecase on
altering the bloom filter.
The most involved one is a complete replacement which calls clear and
then various calls to add() style methods.
Second is a single 'add' which can be done without the clear first.

The second needs an explicit lock in the add() methods, which would
deadlock in the first usecase if I didn't pick the recursive mutex.
2020-05-18 14:25:14 +02:00
TomZ 01e8bcfb09 Announce all transactions per block at once.
Instead of forwarding one transaction at a time as the peer sends them
to us, bundle them in a group of transactions known to be merkle-checked
and all belonging together in one block.

Since the peer has no obligation (and with CTOR even less) to send the
transactions in natural order, we should get them per block so we know
all transactions forwarded have parents.
2020-05-16 11:01:27 +02:00
TomZ c2d53d75e4 Add some extra methods on the privacySegment
this allows more mature usage of the bloom filter.
2020-05-15 17:18:42 +02:00
TomZ 25ffc84f80 Introduce new lib p2p
We reuse the NetworkManager lower level code in order to connect
to the Bitcoin P2P network.
This implements the basics for anyone wanting to be a player on
this network.
2020-04-20 21:49:03 +02:00