aboutsummaryrefslogtreecommitdiff
path: root/src/net_processing.cpp
AgeCommit message (Collapse)Author
2020-11-23Merge #20399: Revert "Merge #19606: Backport wtxid relay to v0.20"MarcoFalke
fa074d2c7b9c3d34876c428d12672a505d4ce4eb Revert "Merge #19606: Backport wtxid relay to v0.20" (MarcoFalke) Pull request description: The 0.20 branch has bugfixes that should be released. However, a tag can currently not be created because the latest merge introduced a regression and is not a bugfix (https://github.com/bitcoin/bitcoin/pull/20317#issuecomment-723754509, https://github.com/bitcoin/bitcoin/pull/20317#issuecomment-727624755). Fix that by reverting the last merge. Can be reviewed by re-doing the revert or calling `git diff HEAD HEAD~2 | wc` and observing an empty diff. ACKs for top commit: laanwj: Code review ACK fa074d2c7b9c3d34876c428d12672a505d4ce4eb Tree-SHA512: 1a1314b9bb85f44696dc307845e80292998d6c9c000e7386c48405e74400d9cd22be6996e555f198da917e04024a1c8e609dfd830759a27fe4070168b0d272bb
2020-11-18Merge #20166: [0.20] BackportsMarcoFalke
7566af419f3e7060152ae062f5a578f543a16a5a doc: Update data directory path comments (Hennadii Stepanov) 09261de6edd7f9fd876607fef350995052da63ba util: Add StripRedundantLastElementsOfPath function (Hennadii Stepanov) 8ef0dace867dbdc1b1dead98f0d69f64eb886d67 macOS deploy: use the new plistlib API (Jonas Schnelli) 314e79581f05881284ed9dfb661754830ed54833 build: fix mutex detection when building bdb on macOS (fanquake) 1f67a30e8374951997af924293c60eff56ae39ed random: fixes read buffer resizing in RandAddSeedPerfmon (Ethan Heilman) 6113b547f4cce8be732bf45687a74eccf4a3abfc net: Send post-verack handshake messages at most once (MarcoFalke) bdf15d0d5d12eb33594b90ebb48366ea7bb5c3d9 rpc: Adjust witness-tx deserialize error message (MarcoFalke) 731502a18385276887a57ad8574fdbaef976920d rpc: Properly deserialize txs with witness before signing (MarcoFalke) ee0082b886264fcddd73c5bb7c41ba8316527b9c Avoid the use of abs64 in timedata (Pieter Wuille) 05bd0c220aa0f4cb6202dd19d3164ba2e7cb015e docs: Correct description for getblockstats's txs field (Nadav Ivgi) Pull request description: Backports the following PRs to the 0.20 branch: * https://github.com/bitcoin/bitcoin/pull/19777 - docs: Correct description for getblockstats's txs field * https://github.com/bitcoin/bitcoin/pull/19836 - rpc: Properly deserialize txs with witness before signing * https://github.com/bitcoin/bitcoin/pull/20080 - Strip any trailing `/` in -datadir and -blocksdir paths * https://github.com/bitcoin/bitcoin/pull/20082 - [bugfix] random: fixes read buffer to use min rather than max * https://github.com/bitcoin/bitcoin/pull/20141 - Avoid the use of abs64 in timedata * https://github.com/bitcoin/bitcoin/pull/20146 - net: Send post-verack handshake messages at most once * https://github.com/bitcoin/bitcoin/pull/20195 - build: fix mutex detection when building bdb on macOS * https://github.com/bitcoin/bitcoin/pull/20298 - macOS deploy: use the new plistlib API Will add additional commits as they become available. ACKs for top commit: MarcoFalke: review ACK 7566af419f3e7060152ae062f5a578f543a16a5a 🗡 Tree-SHA512: add6bb978313c12c3e07bc232636ae9d1ab0edd0b816705c5c70eeb1cc04097165fd5e29d60c706886943ceb1f749a422020766b4aa2d23be51e9f839157a4bb
2020-11-16Revert "Merge #19606: Backport wtxid relay to v0.20"MarcoFalke
This reverts commit a339289c2ef9caffa1195436695a13f6e48e1bbc, reversing changes made to b9ac31f2d29ae3e79c0f0cde5bab2d7213e6da51.
2020-10-19net: Send post-verack handshake messages at most onceMarcoFalke
Github-Pull: #20146 Rebased-From: fa1f6f237d02265af616129402fa2b8a3019dda5
2020-09-24Further improve comments around recentRejectsSuhas Daftuar
2020-09-24Disconnect peers sending wtxidrelay message after VERACKSuhas Daftuar
2020-09-24Rename AddInventoryKnown() to AddKnownTx()Suhas Daftuar
2020-09-24Make TX_WITNESS_STRIPPED its own rejection reasonSuhas Daftuar
Previously, TX_WITNESS_MUTATED could be returned during transaction validation for either transactions that had a witness that was non-standard, or for transactions that had no witness but were invalid due to segwit validation rules. However, for txid/wtxid-relay considerations, net_processing distinguishes the witness stripped case separately, because it affects whether a wtxid should be able to be added to the reject filter. It is safe to add the wtxid of a witness-mutated transaction to the filter (as that wtxid shouldn't collide with the txid, and hence it wouldn't interfere with transaction relay from txid-relay peers), but it is not safe to add the wtxid (== txid) of a witness-stripped transaction to the filter, because that would interfere with relay of another transaction with the same txid (but different wtxid) when relaying from txid-relay peers. Also updates the comment explaining this logic, and explaining that we can get rid of this complexity once there's a sufficient deployment of wtxid-relaying peers on the network.
2020-09-24Delay getdata requests from peers using txid-based relaySuhas Daftuar
Using both txid and wtxid-based relay with peers means that we could sometimes download the same transaction twice, if announced via two different hashes from different peers. Use a heuristic of delaying txid-peer-getdata requests by 2 seconds, if we have at least one wtxid-based peer.
2020-09-24Add p2p message "wtxidrelay"Suhas Daftuar
When sent to and received from a given peer, enables using wtxid's for announcing and fetching transactions with that peer.
2020-09-24ignore non-wtxidrelay compliant invsAnthony Towns
2020-09-24Add support for tx-relay via wtxidSuhas Daftuar
This adds a field to CNodeState that tracks whether to relay transactions with that peer via wtxid, instead of txid. As of this commit the field will always be false, but in a later commit we will add a way to negotiate turning this on via p2p messages exchanged with the peer.
2020-09-24Add wtxids to recentRejectsSuhas Daftuar
Previously, we only added txids to recentRejects if we were sure that the transaction couldn't have had the wrong witness (either because the witness was malleated or stripped). In preparation for wtxid-based relay, we can observe that txid == wtxid for transactions that have no witness, and add the wtxid of rejected transactions, provided the transaction wasn't a witness-stripped one. This means that we now add more data to the filter (as prior to this commit, any transaction with a witness that failed to be accepted was being skipped for inclusion in the filter) but witness malleation should still not interfere with relay of a valid segwit transaction, because the txid of a segwit transaction would not be added to the filter after failing validation. In the future, having wtxids in the recent rejects filter will allow us to skip downloading the same wtxid multiple times, once our peers use wtxids for transaction relay. Also add the txid to recentRejects if the transaction failed for TX_INPUTS_NOT_STANDARD.
2020-09-24Add wtxids of confirmed transactions to bloom filterSuhas Daftuar
This is in preparation for wtxid-based invs (we need to be able to tell whether we AlreadyHave() a transaction based on either txid or wtxid). This also double the size of the bloom filter, which is overkill, but still uses a manageable amount of memory.
2020-09-24Add wtxid-index to orphan mapSuhas Daftuar
2020-09-24Add a wtxid-index to mapRelaySuhas Daftuar
2020-09-24Just pass a hash to AddInventoryKnownSuhas Daftuar
Since it's only used for transactions, there's no need to pass in an inv type.
2020-08-07Add txids with non-standard inputs to reject filterSuhas Daftuar
Our policy checks for non-standard inputs depend only on the non-witness portion of a transaction: we look up the scriptPubKey of the input being spent from our UTXO set (which is covered by the input txid), and the p2sh checks only rely on the scriptSig portion of the input. Consequently it's safe to add txids of transactions that fail these checks to the reject filter, as the witness is irrelevant to the failure. This is helpful for any situation where we might request the transaction again via txid (either from txid-relay peers, or if we might fetch the transaction via txid due to parent-fetching of orphans). Further, in preparation for future witness versions being deployed on the network, ensure that WITNESS_UNKNOWN transactions are rejected in AreInputsStandard(), so that transactions spending v1 (or greater) witness outputs will fall into this category of having their txid added to the reject filter. Github-Pull: #19620 Rebased-From: 7989901c7eb62ca28b3d1e5d5831041a7267e495
2020-07-08Clean up separated ban/discourage interfacePieter Wuille
Github-Pull: #19219 Rebased-From: 2ad58381fffb33d611abf900b73d9e6b5a4e35f8
2020-07-08Replace automatic bans with discouragement filterPieter Wuille
This patch improves performance and resource usage around IP addresses that are banned for misbehavior. They're already not actually banned, as connections from them are still allowed, but they are preferred for eviction if the inbound connection slots are full. Stop treating these like manually banned IP ranges, and instead just keep them in a rolling Bloom filter of misbehaving nodes, which isn't persisted to disk or exposed through the ban framework. The effect remains the same: preferred for eviction, avoided for outgoing connections, and not relayed to other peers. Also change the name of this mechanism to better reflect reality; they're not banned, just discouraged. Contains release notes and several interface improvements by John Newbery. Github-Pull: #19219 Rebased-From: b691f2df5f7d443c0c9ee056ab94aa0fc19566d5
2020-05-15[net processing] Only send a getheaders for one block in an INVJohn Newbery
Headers-first is the primary method of announcement on the network. If a node fell back sending blocks by inv, it's probably for a re-org. The final block hash provided should be the highest, so send a getheaders and then fetch the blocks we need to catch up. Github-Pull: #18962 Rebased-From: 746736639e6d05acdb85c866d4c605c947d4c500
2020-05-15[docs] Improve commenting in ProcessGetData()John Newbery
Github-Pull: #18808 Rebased-From: 9847e205bf7edcac4c30ce4b6d62f482aa7bc1b7
2020-05-15[net processing] ignore unknown INV types in GETDATA messagesAmiti Uttarwar
Co-Authored-By: John Newbery <john@johnnewbery.com> Github-Pull: #18808 Rebased-From: e257cf71c851e25e1a533bf1d4296f6b55c81332
2020-05-15[net processing] ignore tx GETDATA from blocks-only peersAmiti Uttarwar
Co-Authored-By: John Newbery <john@johnnewbery.com> Github-Pull: #18808 Rebased-From: 047ceac142246b5d51056a51dbf4645b31802be4
2020-04-10Merge #18454: net: Make addr relay mockable, add testMarcoFalke
fa1da3d4bfc0511a89f5b19d5a4d89e55ff7ccde test: Add basic addr relay test (MarcoFalke) fa1793c1c44a3f75a09f9c636467b8274c541bdd net: Pass connman const when relaying address (MarcoFalke) fa47a0b003f53708b6d5df1ed4e7f8a7c68aa3ac net: Make addr relay mockable (MarcoFalke) Pull request description: As usual: * Switch to std::chrono time to be type-safe and mockable * Add basic test that relies on mocktime to add code coverage ACKs for top commit: naumenkogs: utACK fa1da3d promag: ACK fa1da3d4bfc0511a89f5b19d5a4d89e55ff7ccde (fabe56e44b6f683e24e37246a7a8851190947cb3 before https://github.com/bitcoin/bitcoin/pull/18454#issuecomment-607866453), fa5bf23d527a450e72c2bf13d013e5393b664ca3 was dropped since last review. Tree-SHA512: 0552bf8fcbe375baa3cab62acd8c23b2994efa47daff818ad1116d0ffaa0b9e520dc1bca2bbc68369b25584e85e54861fe6fd0968de4f503b95439c099df9bd7
2020-04-06scripted-diff: Replace strCommand with msg_typeMarcoFalke
-BEGIN VERIFY SCRIPT- sed -i 's/\<strCommand\>/msg_type/g' ./src/net_processing.cpp ./src/test/fuzz/process_message.cpp -END VERIFY SCRIPT-
2020-04-02net: Pass connman const when relaying addressMarcoFalke
2020-03-27net: Make addr relay mockableMarcoFalke
2020-03-19Merge #17477: Remove the mempool's NotifyEntryAdded and NotifyEntryRemoved ↵Wladimir J. van der Laan
signals e57980b4738c10344baf136de3e050a3cb958ca5 [mempool] Remove NotifyEntryAdded and NotifyEntryRemoved callbacks (John Newbery) 2dd561f36124972d2364f941de9c3417c65f05b6 [validation] Remove pool member from ConnectTrace (John Newbery) 969b65f3f527631ede1a31c7855151e5c5d91f8f [validation] Remove NotifyEntryRemoved callback from ConnectTrace (John Newbery) 5613f9842b4000fed088b8cf7b99674c328d15e1 [validation] Remove conflictedTxs from PerBlockConnectTrace (John Newbery) cdb893443cc16edf974f099b8485e04b3db1b1d7 [validation interface] Remove vtxConflicted from BlockConnected (John Newbery) 1168394d759b13af68acec6d5bfa04aaa24561f8 [wallet] Notify conflicted transactions in TransactionRemovedFromMempool (John Newbery) Pull request description: These boost signals were added in #9371, before we had a `TransactionRemovedFromMempool` method in the validation interface. The `NotifyEntryAdded` callback was used by validation to build a vector of conflicted transactions when connecting a block, which the wallet was notified of in the `BlockConnected` CValidationInterface callback. Now that we have a `TransactionRemovedFromMempool` callback, we can fire that signal directly from the mempool for conflicted transactions. Note that #9371 was implemented to ensure `-walletnotify` events were fired for these conflicted transaction. We inadvertently stopped sending these notifications in #16624 (Sep 2019 commit 7e89994). We should probably fix that, but in a different PR. ACKs for top commit: jonatack: Re-ACK e57980b ryanofsky: Code review ACK e57980b4738c10344baf136de3e050a3cb958ca5, no code changes since previous review, but helpful new code comments have been added and the PR description is now more clear about where the old code came from Tree-SHA512: 3bdbaf1ef2731e788462d4756e69c42a1efdcf168691ce1bbfdaa4b7b55ac3c5b1fd4ab7b90bcdec653703600501b4224d252cfc086aef28f9ce0da3b0563a69
2020-03-18net: fix use-after-free in testsVasil Dimov
In PeerLogicValidation::PeerLogicValidation() we would schedule a lambda function to execute later, capturing the local variable `consensusParams` by reference. Presumably this was considered safe because `consensusParams` is a reference itself to a global variable which is not supposed to change, but it can in tests. Fixes https://github.com/bitcoin/bitcoin/issues/18372
2020-03-17Merge #18289: refactor: Make scheduler methods type safeMarcoFalke
fa36f3a29538012a6eb5c3402b3b3c18fd32b230 refactor: move DUMP_BANS_INTERVAL to banman.h (MarcoFalke) fadafb83cff9a9a340eac1b5a853e2467d5e0ef7 scheduler: Make schedule* methods type safe (MarcoFalke) fa70ccc6c4e304646b4610228f3975b3a9762643 scheduler: Use C++11 member initialization, add shutdown assert (MarcoFalke) Pull request description: Main benefit is that stuff like `15 * 60 * 1000` is replaced by `minutes{15}` ACKs for top commit: vasild: ACK fa36f3a (code review, not tested) ajtowns: ACK fa36f3a29538012a6eb5c3402b3b3c18fd32b230 jonatack: ACK fa36f3a Tree-SHA512: f35f1a1d643dfa676bd47474659f6492ed05cca04cdb556064b126f654a6a44a4b93fcaddcdcd41faf81b8f11439c11e5c7ab88685ba2eef12f7188843d17ad8
2020-03-12refactor: Remove mempool global from netMarcoFalke
This refactor does two things: * Pass mempool in to PeerLogicValidation * Pass m_mempool around where needed
2020-03-11[validation interface] Remove vtxConflicted from BlockConnectedJohn Newbery
The wallet now uses TransactionRemovedFromMempool to be notified about conflicted wallet, and no other clients use vtxConflicted.
2020-03-11tests: Add fuzzing harness for ProcessMessage(...)practicalswift
2020-03-10scheduler: Make schedule* methods type safeMarcoFalke
2020-02-27Refactor FormatStateMessage into ValidationStateJeffrey Czyz
2020-02-11net: Remove forcerelay of rejected txsMarcoFalke
2020-02-02net: reference instead of copy in BlockConnected range loopJon Atack
to fix -Wrange-loop-analysis warning introduced in a029e18
2020-01-31Merge #17951: Use rolling bloom filter of recent block txs for AlreadyHave() ↵Jonas Schnelli
check a029e18c2bf67dd00552b0f4bbc85fa2fa5b973b Use rolling bloom filter of recent block tx's for AlreadyHave() check (Suhas Daftuar) Pull request description: In order to determine whether to download or process a relayed transaction, we first try to check whether we already have the transaction -- either in the mempool, in our filter of recently rejected transactions, in our orphan pool, or already confirmed in a block. Prior to this commit, the heuristic for checking whether a transaction was confirmed in a block is based on whether there's a coin cache entry corresponding to the 0- or 1-index vout of the tx. While that is a quick check, it is very imprecise (eg if those outputs were already spent in another block, we wouldn't detect that the transaction has already been confirmed) -- we can do better by just keeping a rolling bloom filter of the transactions in recent blocks, which will better capture the case of a transaction which has been confirmed and then fully spent. This should reduce the bandwidth that we waste by requesting transactions which will not be accepted to the mempool. To avoid relay problems for transactions which have been included in a recent block but then reorged out of the chain, we clear the bloom filter whenever a block is disconnected. ACKs for top commit: MarcoFalke: re-ACK a029e18c2b only stylistic and comment fixups 🍴 sipa: utACK a029e18c2bf67dd00552b0f4bbc85fa2fa5b973b jonatack: Code review ACK a029e18c2bf67dd00552b0f4bbc85fa2fa5b973b also built/ran tests and am running bitcoind with mempool debug logging and custom logging. Looked a bit into CRollingBloomFilter and also the mempool median time past checks mentioned above; I don't have a deep understanding of those areas yet but the concept here and changes LGTM. Tests and other optimisations could be added as a follow-up. In favor of seeing this move forward if no major immediate concerns. Tree-SHA512: 784c9a35bcd3af5db469063ac7d26b4bac430e451e5637a34d8a538c3ffd1433abdd3f06e5584e7a84bfa9e791449e61819397b5a6c7890fa59d78ec3ba507b2
2020-01-29Use rolling bloom filter of recent block tx's for AlreadyHave() checkSuhas Daftuar
In order to determine whether to download or process a relayed transaction, we try to determine if we already have the transaction, either in the mempool, in our recently rejected filter, in our orphan pool, or already confirmed in the chain itself. Prior to this commit, the heuristic for checking the chain is based on whether there's an output corresponding to the 0- or 1-index vout in our coin cache. While that is a quick check, it is very imprecise (say if those outputs were already spent in a block) -- we can do better by just keeping a rolling bloom filter of the transactions in recent blocks, which will capture the case of a transaction which has been confirmed and then fully spent already. To avoid relay problems for transactions which have been included in a recent block but then reorged out of the chain, we clear the bloom filter whenever a block is disconnected.
2020-01-16Fix doxygen errorsBen Woosley
Identified via -Wdocumentation, e.g.: ./rpc/rawtransaction_util.h:31:13: error: parameter 'prevTxs' not found in the function declaration [-Werror,-Wdocumentation] * @param prevTxs Array of previous txns outputs that tx depends on but may not yet be in the block chain ^~~~~~~ ./rpc/rawtransaction_util.h:31:13: note: did you mean 'prevTxsUnival'? * @param prevTxs Array of previous txns outputs that tx depends on but may not yet be in the block chain ^~~~~~~ prevTxsUnival netbase.cpp:766:11: error: parameter 'outProxyConnectionFailed[out]' not found in the function declaration [-Werror,-Wdocumentation] * @param outProxyConnectionFailed[out] Whether or not the connection to the ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ netbase.cpp:766:11: note: did you mean 'outProxyConnectionFailed'? * @param outProxyConnectionFailed[out] Whether or not the connection to the ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ outProxyConnectionFailed
2020-01-15scripted-diff: Bump copyright of files changed in 2020MarcoFalke
-BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./ -END VERIFY SCRIPT-
2020-01-15scripted-diff: Replace CCriticalSection with RecursiveMutexMarcoFalke
-BEGIN VERIFY SCRIPT- # Delete outdated alias for RecursiveMutex sed -i -e '/CCriticalSection/d' ./src/sync.h # Replace use of outdated alias with RecursiveMutex sed -i -e 's/CCriticalSection/RecursiveMutex/g' $(git grep -l CCriticalSection) -END VERIFY SCRIPT-
2020-01-02Merge #17762: net: Log to net category for exceptions in ProcessMessagesWladimir J. van der Laan
4bdd68f301a9cee3360deafc7531c638e923226b Add missing typeinfo includes (Wladimir J. van der Laan) 4d88c3dcb61e7c075ed3dd442044e0eff4e3c8de net: Log to net category for exceptions in ProcessMessages (Wladimir J. van der Laan) Pull request description: Remove the forest of special exceptions based on string matching, and simply log a short message to the NET logging category when an exception happens during packet processing. It is not good to panick end users with verbose errors (let alone writing to stderr) when any peer can generate them. ACKs for top commit: MarcoFalke: re-ACK 4bdd68f301a9cee3360deafc7531c638e923226b (only change is adding includes) 🕕 promag: ACK 4bdd68f301a9cee3360deafc7531c638e923226b, could squash. Tree-SHA512: a005591a3202b005c75e01dfa54249db3992e2f9eefa8b3d9d435acf66130417716ed926ce4e045179cf43788f1abc7362d999750681a9c80b318373d611c366
2020-01-02Add missing typeinfo includesWladimir J. van der Laan
The use of `typeid()` for logging exception types requires this include according to https://en.cppreference.com/w/cpp/language/typeid.
2019-12-30scripted-diff: Bump copyright of files changed in 2019MarcoFalke
-BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./ -END VERIFY SCRIPT-
2019-12-17net: Log to net category for exceptions in ProcessMessagesWladimir J. van der Laan
Remove the forest of special exceptions, and simply log a short message to the NET logging category when an exception happens during packet processing. It is not good to panick end users with errors that any peer can generate (let alone writing to stderr).
2019-11-05Merge #17243: p2p: add PoissonNextSend method that returns mockable timeMarcoFalke
1a8f0d5a74d5cc0000456932babf35301f5c1686 [tools] update nNextInvSend to use mockable time (Amiti Uttarwar) 4de630354fc6808b9b13b9e82da1a82f2f50f26a [tools] add PoissonNextSend method that returns mockable time (Amiti Uttarwar) Pull request description: Introduce a Poisson helper method that wraps the existing method to return `std::chrono::duration` type, which is mockable. Needed for https://github.com/bitcoin/bitcoin/pull/16698. ACKs for top commit: ajtowns: ACK 1a8f0d5a74d5cc0000456932babf35301f5c1686 MarcoFalke: re-ACK 1a8f0d5a74d5cc0000456932babf35301f5c1686 naumenkogs: ACK 1a8f0d5, and let's merge it and come back to it later. Tree-SHA512: 7e2325d7c55fc0b4357cb86b83e0c218ba269f678c1786342d8bc380bfd9696373bc24ff124b9ff17a6e761c62b2b44ff5247c3911e2afdc7cc5c20417e8290b
2019-11-05[tools] update nNextInvSend to use mockable timeAmiti Uttarwar
2019-11-04Merge #17164: p2p: Avoid allocating memory for addrKnown where we don't need itMarcoFalke
b6d2183858975abc961207c125c15791e531edcc Minor refactoring to remove implied m_addr_relay_peer. (User) a552e8477c5bcd22a5457f4f73a2fd6db8acd2c2 added asserts to check m_addr_known when it's used (User) 090b75c14be6b9ba2efe38a17d141c6e6af575cb p2p: Avoid allocating memory for addrKnown where we don't need it (User) Pull request description: We should allocate memory for addrKnown filter only for those peers which are expected to participate in address relay. Currently, we do it for all peers (including SPV and block-relay-only), which results in extra RAM where it's not needed. Upd: In future, we would still allow SPVs to ask for addrs, so allocation still will be done by default. However, they will be able to opt-out via [this proposal](https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2019-October/017428.html) and then we could save some more memory. This PR still saves memory for block-relay-only peers immediately after merging. Top commit has no ACKs. Tree-SHA512: e84d93b2615556d466f5ca0e543580fde763911a3bfea3127c493ddfaba8f05c8605cb94ff795d165af542b594400995a2c51338185c298581408687e7812463