diff options
author | W. J. van der Laan <laanwj@protonmail.com> | 2021-11-30 18:53:58 +0100 |
---|---|---|
committer | W. J. van der Laan <laanwj@protonmail.com> | 2021-11-30 19:09:15 +0100 |
commit | 63c0d0e937afed7169c981a9b3a95e0fc5e44040 (patch) | |
tree | 654c4b234adc7e8f006d3f600f5a1f97d1129455 /src/net_processing.cpp | |
parent | ffdf8ee43e2440ab59b85846ab98854b17e49e49 (diff) | |
parent | 6aed8b7e9b206e728367fee9edfeb85b536bba69 (diff) |
Merge bitcoin/bitcoin#21327: net_processing: ignore transactions while in IBD
6aed8b7e9b206e728367fee9edfeb85b536bba69 [test] tx processing before and after ibd (glozow)
b9e105b6643bada4c80f8d521394be4d55e8e4fc [net_processing] ignore all transactions during ibd (glozow)
Pull request description:
This is basically a mini, IBD-only version of #21224
Incoming transactions aren't really relevant until we're caught up. That's why we send a giant feefilter and don't send tx getdatas, but we also shouldn't process them if peers send them anyway. Simply ignore them.
ACKs for top commit:
jnewbery:
reACK 6aed8b7e9b
laanwj:
Code review ACK 6aed8b7e9b206e728367fee9edfeb85b536bba69
Tree-SHA512: 8e1616bf355f9d0b180bdbc5461f24c757dc5d7bc7bf651470f3b0bffcca5d5e68287106255b5cede2d96b42bce448a0f8c0649de35a530c5e079f7c89c70a35
Diffstat (limited to 'src/net_processing.cpp')
-rw-r--r-- | src/net_processing.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp index a896bb76ae..3f755eb178 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -3206,6 +3206,11 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type, return; } + // Stop processing the transaction early if we are still in IBD since we don't + // have enough information to validate it yet. Sending unsolicited transactions + // is not considered a protocol violation, so don't punish the peer. + if (m_chainman.ActiveChainstate().IsInitialBlockDownload()) return; + CTransactionRef ptx; vRecv >> ptx; const CTransaction& tx = *ptx; |