diff options
author | glozow <gzhao408@berkeley.edu> | 2021-02-26 13:44:40 -0800 |
---|---|---|
committer | glozow <gloriajzhao@gmail.com> | 2021-10-28 16:31:22 +0100 |
commit | b9e105b6643bada4c80f8d521394be4d55e8e4fc (patch) | |
tree | 3f88fd7a998b095e46bc6f5043e4010f843fdc55 /src/net_processing.cpp | |
parent | ab25ef8c7f767258d5fe44f53b35ad8bd51ed5cd (diff) | |
download | bitcoin-b9e105b6643bada4c80f8d521394be4d55e8e4fc.tar.xz |
[net_processing] ignore all transactions during ibd
Co-authored-by: Amiti Uttarwar <amiti@uttarwar.org>
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 9f3aa5b4a3..e205030749 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -3207,6 +3207,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; |