Commit Graph

10 Commits

Author SHA1 Message Date
TomZ 301a4ca3ee Fix properly following the chain-tip
This is done in several steps:

1. Separate my height from the remote peer heights.
Instead of assuming we have one height, recognize that a peer may
not be at the tip at the same time we are. We monitor headers/invs
to update the 'peerHeight' variable.

2. Ask for merkle blocks from a peer to the maximum height of that
peer (but not later than what we validated to be true).
This avoids us asking past the remotes tip which they didn't like.

3. Redo the SyncSPVAction to use all this and make it much more
reliable in finding peers to download from and getting all the
changes as fast as possible.
2020-11-13 21:03:56 +01:00
TomZ 0556bc56d1 Fix bugs in SPV sync behavior. 2020-11-09 18:38:38 +01:00
TomZ d2869ef06b Fix bug where we'd ban perfectly good peers
Due to misdetection of stalling the download.
2020-11-07 15:03:27 +01:00
TomZ 781805d6a9 Less waiting while finding proper peers 2020-11-05 21:47:54 +01:00
TomZ 3f5fe41534 P2PNet: Support multiple chains.
This adds support for the testnet4 chain.
2020-10-29 21:47:53 +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 c09aed6692 Add comment. 2020-05-15 17:41:52 +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 fb6f91bf79 Simplify p2pnet ownership
Make the Peer object be owned by a shared pointer.
2020-05-05 22:53:25 +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