Commit graph

35416 commits

Author SHA1 Message Date
Anthony Towns
377e9ccda4 scripted-diff: net: rename permissionFlags to permission_flags
-BEGIN VERIFY SCRIPT-
sed -i 's/permissionFlags/permission_flags/g' $(git grep -l permissionFlags)
-END VERIFY SCRIPT-
2022-09-01 20:55:22 +10:00
Anthony Towns
0a7fc42897 net: make CNode::m_prefer_evict const 2022-09-01 20:54:35 +10:00
Anthony Towns
d394156b99 net: make CNode::m_permissionFlags const 2022-09-01 20:53:57 +10:00
Anthony Towns
9dccc3328e net: add CNodeOptions for optional CNode constructor params 2022-09-01 20:52:20 +10:00
Hennadii Stepanov
b2544d1ee3
qt: Update translation source file for string freeze 2022-09-01 10:32:05 +01:00
MacroFake
fa5c224d44
Merge bitcoin/bitcoin#25887: init: avoid unsetting service bits from nLocalServices
1b5bec78e9 init: avoid unsetting service bits from `nLocalServices` (Sebastian Falbesoner)

Pull request description:

  This PR is a late follow-up to the [review club session about the PR "Default to NODE_WITNESS in nLocalServices" ](https://bitcoincore.reviews/21090#l-90) (#21090):

  ```
  17:32 <lightlike> hmm, if we are in pruned mode, we first set NODE_NETWORK and then unset it later in init.cpp. that seems a bit strange.
  ...
  17:33 <jnewbery> lightlike: ah yes, you're right. That does seem a bit messy.
  ```

  Rather than setting the service bit `NODE_NETWORK` first and then unset it (if in `fPruneMode`), start with the bare minimum flags that we always serve and only add `NODE_NETWORK` if we are running as a non-pruned node. This seems to be a more logical approach than currently on master.

ACKs for top commit:
  naumenkogs:
    ACK 1b5bec78e9
  stickies-v:
    ACK 1b5bec78e9
  LarryRuane:
    ACK 1b5bec78e9

Tree-SHA512: 2e82d66c4298ffacff41d9e0458b74b83bc156a1fa49e3f3471e942878e5dd2b253b5597ee5ec1d9c8726b432751d05e40f0c580f3976a9e00a7d1f417921ab0
2022-09-01 10:37:00 +02:00
MacroFake
ccea0e11a2
Merge bitcoin/bitcoin#25959: doc: Fix link to MurmurHash3.cpp (moved from Google Code to Github)
2c05dc7811 Fix link to MurmurHash3.cpp from Austin Appleby (dontbyte)

Pull request description:

  Google Code repo doesn't exist anymore

ACKs for top commit:
  Zero-1729:
    crACK 2c05dc7811

Tree-SHA512: 3e095255757b536f382ffb63e4292413592246c2446d486acbb71c52e4a3ece519d7cfae941685d9e25fd62de5c783510b3d076cd990a3d391496dc3076a0385
2022-09-01 09:54:00 +02:00
MacroFake
f821fc9813
Merge bitcoin/bitcoin#25967: refactor: add LIFETIMEBOUND to blockfilter where needed
89576ccc57 refactor: add LIFETIMEBOUND to blockfilter where needed (stickies-v)

Pull request description:

  Noticed from https://github.com/bitcoin/bitcoin/pull/25637#issuecomment-1231860822 that [`BlockFilter::GetFilter()`](01e1627e25/src/blockfilter.h (L132)) returns a reference to a member variable. Added LIFETIMEBOUND to all blockfilter-related code to ensure that the return values do not have a lifetime that exceeds the lifetime of what it is bound to. See https://github.com/bitcoin/bitcoin/blob/master/doc/developer-notes.md#lifetimebound or https://github.com/bitcoin/bitcoin/pull/25060 for a similar example.

  I used `grep -E '[a-zA-Z>0-9][&*] ([a-zA-Z]*)\((.*)\)' src/**/blockfilter*` to grep all possible occurrences (not all of them require LIFETIMEBOUND)

ACKs for top commit:
  brunoerg:
    crACK 89576ccc57

Tree-SHA512: 6fe61fc0c1ed9e446edce083d1b093e1a5e2ef8c39ff74125bb12a24e514d45711845809817fbd4a04d7a9c23c8b362203771c17b6d831d2560b1af268453019
2022-09-01 09:47:18 +02:00
fanquake
6ab84709fc
Merge bitcoin/bitcoin#25960: p2p: Headers-sync followups
94af3e43e2 Fix typo from PR25717 (Suhas Daftuar)
e5982ecdc4 Bypass headers anti-DoS checks for NoBan peers (Suhas Daftuar)
132ed7eaaa Move headerssync logging to BCLog::NET (Suhas Daftuar)

Pull request description:

  Remove BCLog::HEADERSSYNC and move all headerssync logging to BCLog::NET.

  Bypass headers anti-DoS checks for NoBan peers

  Also fix a typo that was introduced in PR25717.

ACKs for top commit:
  Sjors:
    tACK 94af3e43e2
  ajtowns:
    ACK 94af3e43e2
  sipa:
    ACK 94af3e43e2
  naumenkogs:
    ACK 94af3e43e2
  w0xlt:
    ACK 94af3e43e2

Tree-SHA512: 612d594eddace977359bcc8234b2093d273fd50662f4ac70cb90903d28fb831f6e1aecff51a4ef6c0bb0f6fb5d1aa7ff1eb8798fac5ac142783788f3080717dc
2022-09-01 07:45:42 +01:00
stickies-v
89576ccc57
refactor: add LIFETIMEBOUND to blockfilter where needed
Ensure that the return values do not have a lifetime that exceeds
the lifetime of what it is bound to.
See https://github.com/bitcoin/bitcoin/blob/master/doc/developer-notes.md#lifetimebound
2022-08-31 16:51:32 +01:00
Andrew Chow
8343420803
Merge bitcoin/bitcoin#25915: test: Fix wallet_balance intermittent issue
fae5bd9200 test: Fix wallet_balance intermittent issue (MacroFake)

Pull request description:

  Diff to reproduce:

  ```diff
  index d2ed97ca76..25cc2d5734 100755
  --- a/test/functional/wallet_balance.py
  +++ b/test/functional/wallet_balance.py
  @@ -265,7 +265,7 @@ class WalletTest(BitcoinTestFramework):
           self.nodes[0].invalidateblock(block_reorg)
           self.nodes[1].invalidateblock(block_reorg)
           assert_equal(self.nodes[0].getbalance(minconf=0), 0)  # wallet txs not in the mempool are untrusted
  -        self.generatetoaddress(self.nodes[0], 1, ADDRESS_WATCHONLY, sync_fun=self.no_op)
  +        self.generatetoaddress(self.nodes[0], 1, ADDRESS_WATCHONLY)
           assert_equal(self.nodes[0].getbalance(minconf=0), 0)  # wallet txs not in the mempool are untrusted

           # Now confirm tx_orig
  ```

  Example in CI:

  ```
   test  2022-08-24T10:09:22.486000Z TestFramework (ERROR): Assertion failed
                                     Traceback (most recent call last):
                                       File "/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-i686-pc-linux-gnu/test/functional/test_framework/test_framework.py", line 133, in main
                                         self.run_test()
                                       File "/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-i686-pc-linux-gnu/test/functional/wallet_balance.py", line 269, in run_test
                                         assert_equal(self.nodes[0].getbalance(minconf=0), 0)  # wallet txs not in the mempool are untrusted
                                       File "/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-i686-pc-linux-gnu/test/functional/test_framework/util.py", line 56, in assert_equal
                                         raise AssertionError("not(%s)" % " == ".join(str(arg) for arg in (thing1, thing2) + args))
                                     AssertionError: not(98.85983340 == 0)
  ```

  https://cirrus-ci.com/task/4981266251513856?logs=ci#L3269

ACKs for top commit:
  achow101:
    ACK fae5bd9200
  w0xlt:
    ACK fae5bd9200

Tree-SHA512: 470f366720615c4a9326ec4c581fff569ecce9877f9134bb1975ec3d6f1d13a6403051418a91a80b2a86de617f43e539ec11bbf4f1713d0354d5b0ab98d22437
2022-08-31 11:20:23 -04:00
MacroFake
b936123110
Merge bitcoin/bitcoin#25963: CBlockLocator: performance-move-const-arg Clang tidy fixup
6b24dfe24d CBlockLocator: performance-move-const-arg Clang tidy fixups (Jon Atack)

Pull request description:

  Fix Clang-tidy CI errors on master.  See https://cirrus-ci.com/task/4806752200818688?logs=ci#L4696 for an example.

ACKs for top commit:
  MarcoFalke:
    review ACK 6b24dfe24d
  vasild:
    ACK 6b24dfe24d

Tree-SHA512: 7a67acf7b42da07b63fbb392236e9a7be8cf35c36e37ca980c4467fe8295c2eda8aef10f41a1e3036cd9ebece47fa957fc3256033f853bd6a97ce2ca42799a0a
2022-08-31 15:59:56 +02:00
Jon Atack
6b24dfe24d CBlockLocator: performance-move-const-arg Clang tidy fixups
Co-authored-by: "Pieter Wuille <pieter@wuille.net>"
Co-authored-by: "Vasil Dimov <vd@FreeBSD.org>"
Co-authored-by: "MarcoFalke <falke.marco@gmail.com>"
2022-08-31 15:10:26 +02:00
Janna
767d825e27 Update chainparams for 24.0 release 2022-08-31 15:31:34 +03:00
fanquake
56e79fe683
guix: use --build={arch}-guix-linux-gnu in cross toolchain
Technically we are always cross-compiling, so make that explicit.

Fixes: #22458.
2022-08-31 11:17:33 +01:00
Sjors Provoost
50996241f2
rpc: sort listdescriptors result 2022-08-31 10:41:10 +02:00
fanquake
01e1627e25
Merge bitcoin/bitcoin#25872: Fix issues when calling std::move(const&)
fa875349e2 Fix iwyu (MacroFake)
faad673716 Fix issues when calling std::move(const&) (MacroFake)

Pull request description:

  Passing a symbol to `std::move` that is marked `const` is a no-op, which can be fixed in two ways:

  * Remove the `const`, or
  * Remove the `std::move`

ACKs for top commit:
  ryanofsky:
    Code review ACK fa875349e2. Looks good. Good for univalue to support c++11 move optimizations

Tree-SHA512: 3dc5cad55b93cfa311abedfb811f35fc1b7f30a1c68561f15942438916c7de25e179c364be11881e01f844f9c2ccd71a3be55967ad5abd2f35b10bb7a882edea
2022-08-31 08:38:24 +01:00
MacroFake
d16ef40441
Merge bitcoin/bitcoin#25955: test: use sendall when emptying wallet
28ea4c7039 test: simplify splitment with `sendall` in wallet_basic (brunoerg)
923d24583d test: use `sendall` when emptying wallet (brunoerg)

Pull request description:

  In some tests they have used `sendtoaddress` in order to empty a wallet. With the addition of `sendall`, it makes sense to use it for that.

ACKs for top commit:
  achow101:
    ACK 28ea4c7039
  ishaanam:
    utACK 28ea4c7039
  w0xlt:
    ACK 28ea4c7039

Tree-SHA512: 903136d7df5c65d3c02310d5a84241c9fd11070f69d932b4e188b8ad45c38ab5bc1bd5a9242b3e52d2576665ead14be0a03971a9ad8c00431fed442eba4ca48f
2022-08-31 09:03:49 +02:00
brunoerg
28ea4c7039 test: simplify splitment with sendall in wallet_basic
recipients receive equal share of the unspecified amount
2022-08-30 16:28:40 -03:00
Suhas Daftuar
94af3e43e2 Fix typo from PR25717 2022-08-30 14:11:21 -04:00
Suhas Daftuar
e5982ecdc4 Bypass headers anti-DoS checks for NoBan peers 2022-08-30 14:11:21 -04:00
MacroFake
52dcb1d2a3
Merge bitcoin/bitcoin#25733: tidy: enable bugprone-use-after-move
f345dc3960 tidy: enable bugprone-use-after-move (fanquake)
94f2235f85 test: work around bugprone-use-after-move warnings in util tests (fanquake)

Pull request description:

  Would have caught #25640.

  Currently `// NOLINT`s around:
  ```bash
  test/util_tests.cpp:2513:34: error: 't2' used after it was moved [bugprone-use-after-move,-warnings-as-errors]
      BOOST_CHECK(v2[0].origin == &t2);
                                   ^
  test/util_tests.cpp:2511:15: note: move occurred here
      auto v2 = Vector(std::move(t2));
                ^
  test/util_tests.cpp:2519:34: error: 't2' used after it was moved [bugprone-use-after-move,-warnings-as-errors]
      BOOST_CHECK(v3[1].origin == &t2);
                                   ^
  test/util_tests.cpp:2516:15: note: move occurred here
      auto v3 = Vector(t1, std::move(t2));
                ^
  test/util_tests.cpp:2527:34: error: 't3' used after it was moved [bugprone-use-after-move,-warnings-as-errors]
      BOOST_CHECK(v4[2].origin == &t3);
                                   ^
  test/util_tests.cpp:2523:15: note: move occurred here
      auto v4 = Vector(std::move(v3[0]), v3[1], std::move(t3));
  ```

  See: https://releases.llvm.org/14.0.0/tools/clang/tools/extra/docs/clang-tidy/checks/bugprone-use-after-move.html

ACKs for top commit:
  ryanofsky:
    Code review ACK f345dc3960. Only change since last review is switching to NOLINT directives

Tree-SHA512: afadecbaf1069653f4be5d6e66a5800ffd975c0b1a960057abc6367b616c181cd518897a874a8f3fd5e5e1f45fcc165f7a9a3171136cd4deee641214c4b765b8
2022-08-30 20:04:17 +02:00
Suhas Daftuar
132ed7eaaa Move headerssync logging to BCLog::NET 2022-08-30 12:09:04 -04:00
fanquake
e9035f867a
Merge bitcoin/bitcoin#25717: p2p: Implement anti-DoS headers sync
3add234546 ui: show header pre-synchronization progress (Pieter Wuille)
738421c50f Emit NotifyHeaderTip signals for pre-synchronization progress (Pieter Wuille)
376086fc5a Make validation interface capable of signalling header presync (Pieter Wuille)
93eae27031 Test large reorgs with headerssync logic (Suhas Daftuar)
355547334f Track headers presync progress and log it (Pieter Wuille)
03712dddfb Expose HeadersSyncState::m_current_height in getpeerinfo() (Suhas Daftuar)
150a5486db Test headers sync using minchainwork threshold (Suhas Daftuar)
0b6aa826b5 Add unit test for HeadersSyncState (Suhas Daftuar)
83c6a0c524 Reduce spurious messages during headers sync (Suhas Daftuar)
ed6cddd98e Require callers of AcceptBlockHeader() to perform anti-dos checks (Suhas Daftuar)
551a8d957c Utilize anti-DoS headers download strategy (Suhas Daftuar)
ed470940cd Add functions to construct locators without CChain (Pieter Wuille)
84852bb6bb Add bitdeque, an std::deque<bool> analogue that does bit packing. (Pieter Wuille)
1d4cfa4272 Add function to validate difficulty changes (Suhas Daftuar)

Pull request description:

  New nodes starting up for the first time lack protection against DoS from low-difficulty headers. While checkpoints serve as our protection against headers that fork from the main chain below the known checkpointed values, this protection only applies to nodes that have been able to download the honest chain to the checkpointed heights.

  We can protect all nodes from DoS from low-difficulty headers by adopting a different strategy: before we commit to storing a header in permanent storage, first verify that the header is part of a chain that has sufficiently high work (either `nMinimumChainWork`, or something comparable to our tip). This means that we will download headers from a given peer twice: once to verify the work on the chain, and a second time when permanently storing the headers.

  The p2p protocol doesn't provide an easy way for us to ensure that we receive the same headers during the second download of peer's headers chain. To ensure that a peer doesn't (say) give us the main chain in phase 1 to trick us into permanently storing an alternate, low-work chain in phase 2, we store commitments to the headers during our first download, which we validate in the second download.

  Some parameters must be chosen for commitment size/frequency in phase 1, and validation of commitments in phase 2. In this PR, those parameters are chosen to both (a) minimize the per-peer memory usage that an attacker could utilize, and (b) bound the expected amount of permanent memory that an attacker could get us to use to be well-below the memory growth that we'd get from the honest chain (where we expect 1 new block header every 10 minutes).

  After this PR, we should be able to remove checkpoints from our code, which is a nice philosophical change for us to make as well, as there has been confusion over the years about the role checkpoints play in Bitcoin's consensus algorithm.

  Thanks to Pieter Wuille for collaborating on this design.

ACKs for top commit:
  Sjors:
    re-tACK 3add234546
  mzumsande:
    re-ACK 3add234546
  sipa:
    re-ACK 3add234546
  glozow:
    ACK 3add234546

Tree-SHA512: e7789d65f62f72141b8899eb4a2fb3d0621278394d2d7adaa004675250118f89a4e4cb42777fe56649d744ec445ad95141e10f6def65f0a58b7b35b2e654a875
2022-08-30 15:37:59 +01:00
fanquake
f345dc3960
tidy: enable bugprone-use-after-move
Will error with:
```bash
coins.cpp:102:22: error: 'coin' used after it was moved [bugprone-use-after-move,-warnings-as-errors]
           (uint32_t)coin.nHeight,
                     ^
coins.cpp:96:21: note: move occurred here
    it->second.coin = std::move(coin);
```

until #25663 is merged.

See:
https://releases.llvm.org/14.0.0/tools/clang/tools/extra/docs/clang-tidy/checks/bugprone-use-after-move.html
2022-08-30 15:19:53 +01:00
fanquake
94f2235f85
test: work around bugprone-use-after-move warnings in util tests
```bash
test/util_tests.cpp:2513:34: error: 't2' used after it was moved [bugprone-use-after-move,-warnings-as-errors]
    BOOST_CHECK(v2[0].origin == &t2);
                                 ^
test/util_tests.cpp:2511:15: note: move occurred here
    auto v2 = Vector(std::move(t2));
              ^
test/util_tests.cpp:2519:34: error: 't2' used after it was moved [bugprone-use-after-move,-warnings-as-errors]
    BOOST_CHECK(v3[1].origin == &t2);
                                 ^
test/util_tests.cpp:2516:15: note: move occurred here
    auto v3 = Vector(t1, std::move(t2));
              ^
test/util_tests.cpp:2527:34: error: 't3' used after it was moved [bugprone-use-after-move,-warnings-as-errors]
    BOOST_CHECK(v4[2].origin == &t3);
                                 ^
test/util_tests.cpp:2523:15: note: move occurred here
    auto v4 = Vector(std::move(v3[0]), v3[1], std::move(t3));
```
2022-08-30 15:19:49 +01:00
brunoerg
923d24583d test: use sendall when emptying wallet 2022-08-30 09:52:15 -03:00
dontbyte
2c05dc7811
Fix link to MurmurHash3.cpp from Austin Appleby
Google Code repo doesn't exist anymore
2022-08-30 13:52:45 +02:00
MacroFake
cfda740b33
Merge bitcoin/bitcoin#25174: net/net_processing: Add thread safety related annotations for CNode and Peer
9816dc96b7 net: note CNode members that are treated as const (Anthony Towns)
ef26f2f421 net: mark CNode unique_ptr members as const (Anthony Towns)
bbec32c9ad net: mark TransportSerializer/m_serializer as const (Anthony Towns)
06ebdc886f net/net_processing: add missing thread safety annotations (Anthony Towns)

Pull request description:

  Adds `GUARDED_BY` and `const` annotations to document how we currently ensure various members of `CNode` and `Peer` aren't subject to race conditions.

ACKs for top commit:
  MarcoFalke:
    review ACK 9816dc96b7 📍
  jonatack:
    utACK 9816dc96b7
  hebasto:
    ACK 9816dc96b7, I have reviewed the code and it looks OK. In particular, I verified the usage of variables which got `GUARDED_BY` annotations.

Tree-SHA512: fa95bca72435d79caadc736ee7687e505dbe8fbdb20690809e97666664a8d0dea39a7d17cf16f0437d7f5746b9ad98a466b26325d2913252c5d2b520b384b785
2022-08-30 11:35:11 +02:00
Andrew Chow
53e7ed075c doc: Release notes and other docs for migration 2022-08-29 17:30:38 -04:00
Andrew Chow
9c44bfe244 Test migratewallet
Co-Authored-By: furszy <matiasfurszyfer@protonmail.com>
2022-08-29 17:30:38 -04:00
Andrew Chow
0b26e7cdf2 descriptors: addr() and raw() should return false for ToPrivateString
They don't have any private data and they can't be nested so they
should return false for ToPrivateString.
2022-08-29 17:30:38 -04:00
Andrew Chow
31764c3f87 Add migratewallet RPC 2022-08-29 17:30:38 -04:00
Andrew Chow
0bf7b38bff Implement MigrateLegacyToDescriptor 2022-08-29 17:30:38 -04:00
Andrew Chow
e7b16f925a Implement MigrateToSQLite 2022-08-29 17:30:38 -04:00
Andrew Chow
3405f3eed5 test: Test that an unconfirmed not-in-mempool chain is rebroadcast
The test checks that parent txs are broadcast before child txs.

The previous behavior is that the rebroadcasting would simply iterate mapWallet. As
mapWallet is a std::unsorted_map, the child can sometimes come before the parent and thus
be rebroadcast in the wrong order and fail the test.
2022-08-29 12:41:50 -04:00
Andrew Chow
10d91c5abe wallet: Deduplicate Resend and ReacceptWalletTransactions
Both of these functions do almost the exact same thing. They can be
deduplicated so that their behavior matches except for the filtering
aspect. As this function will now always be called on wallet loading,
nNextResend will also always be initialized, so
wallet_resendwallettransactions.py is updated to account for that.

This also resolves a bug where ResendWalletTransactions would fail to
rebroadcast txs in insertion order thereby potentially rebroadcasting a
child transaction before its parent and causing the child to not
actually get rebroadcast.

Also names the combined function to ResubmitWalletTransactions as the
function just submits the transactions to the mempool rather than doing
any sending by itself.
2022-08-29 12:38:06 -04:00
Anthony Towns
9816dc96b7 net: note CNode members that are treated as const
m_permissionFlags and m_prefer_evict are treated as const -- they're
only set immediately after construction before any other thread has
access to the object, and not changed again afterwards. As such they
don't need to be marked atomic or guarded by a mutex; though it would
probably be better to actually mark them as const...
2022-08-29 22:50:54 +10:00
Anthony Towns
ef26f2f421 net: mark CNode unique_ptr members as const
Dereferencing a unique_ptr is not necessarily thread safe. The reason
these are safe is because their values are set at construction and do
not change later; so mark them as const and set them via the initializer
list to guarantee that.
2022-08-29 22:50:54 +10:00
Anthony Towns
bbec32c9ad net: mark TransportSerializer/m_serializer as const
The (V1)TransportSerializer instance CNode::m_serializer is used from
multiple threads via PushMessage without protection by a mutex. This
is only thread safe because the class does not have any mutable state,
so document that by marking the methods and the object as "const".
2022-08-29 22:50:54 +10:00
Anthony Towns
06ebdc886f net/net_processing: add missing thread safety annotations 2022-08-29 22:50:51 +10:00
Pieter Wuille
3add234546 ui: show header pre-synchronization progress 2022-08-29 08:10:35 -04:00
Pieter Wuille
738421c50f Emit NotifyHeaderTip signals for pre-synchronization progress 2022-08-29 08:10:35 -04:00
Pieter Wuille
376086fc5a Make validation interface capable of signalling header presync
This makes a number of changes:
- Get rid of the verification_progress argument in the node interface
  NotifyHeaderTip (it was always 0.0).
- Instead of passing a CBlockIndex* in the UI interface's NotifyHeaderTip,
  send separate height, timestamp fields. This is becuase in headers presync,
  no actual CBlockIndex object is available.
- Add a bool presync argument to both of the above, to identify signals
  pertaining to the first headers sync phase.
2022-08-29 08:10:35 -04:00
Suhas Daftuar
93eae27031 Test large reorgs with headerssync logic 2022-08-29 08:10:35 -04:00
Pieter Wuille
355547334f Track headers presync progress and log it 2022-08-29 08:10:35 -04:00
Suhas Daftuar
03712dddfb Expose HeadersSyncState::m_current_height in getpeerinfo() 2022-08-29 08:10:35 -04:00
Suhas Daftuar
150a5486db Test headers sync using minchainwork threshold 2022-08-29 08:10:35 -04:00
Suhas Daftuar
0b6aa826b5 Add unit test for HeadersSyncState 2022-08-29 08:10:35 -04:00
Suhas Daftuar
83c6a0c524 Reduce spurious messages during headers sync
Delay sending SENDHEADERS (BIP 130) message until we know our peer's best
header's chain has more than nMinimumChainWork. This reduces inadvertent
headers messages received during initial headers sync due to block
announcements, which throw off our sync algorithm.
2022-08-29 08:10:35 -04:00