Commit Graph

19 Commits

Author SHA1 Message Date
tomFlowee d32013f8be Avoid accidental sync. 2022-07-13 13:57:45 +02:00
tomFlowee e17ba3bc58 Add a property 'enabled' on PrivacySegment
A not-enabled PrivacySegment will not have its merkleblocks downloaded.
2022-06-23 23:17:05 +02:00
tomFlowee 3a9863dbe3 Simplify the backup sync feature.
The bloom filter includes all the unspent outputs, so we can just
use the latest one if we want to get any transactions the first
peer omitted.
2021-11-26 18:04:38 +01:00
tomFlowee a7c8f02c09 Face the reality of low number of testnet nodes. 2021-10-31 15:14:34 +01:00
tomFlowee 1efcc39f42 Avoid doing work for an empty wallet. 2021-10-27 19:14:09 +02:00
tomFlowee 77bd1ac74f Improve the SPV sync action.
This re-thinks the way we assign new peers and massively speeds up the
finding of enough peer for our wallets.
2021-07-30 16:56:25 +02:00
tomFlowee d3f1d7f454 Whitepace and minor fixes. 2021-02-05 17:32:36 +01:00
tomFlowee adfe4081cb Update copyright notice and email address 2021-02-02 13:08:07 +01:00
tomFlowee 8e44b058af Add flags getter 2020-12-17 09:08:34 +01:00
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