aboutsummaryrefslogtreecommitdiff
path: root/src/net_processing.cpp
diff options
context:
space:
mode:
authorMartin Zumsande <mzumsande@gmail.com>2021-03-22 23:53:56 +0100
committerMartin Zumsande <mzumsande@gmail.com>2021-03-23 18:57:59 +0100
commit18a9b27dd68dc9044a82fba0802b8cb5c68d10ce (patch)
treef6c6601ab8e4b8acf3b1261e24de4aaaea090bbd /src/net_processing.cpp
parentc46f1ce75196860c8b036d2965faac7db3aa4414 (diff)
downloadbitcoin-18a9b27dd68dc9044a82fba0802b8cb5c68d10ce.tar.xz
p2p: Don't send FEEFILTER in blocksonly mode
It is unnecessary to send FEEFILTER messages when we don't accept transactions from our peers.
Diffstat (limited to 'src/net_processing.cpp')
-rw-r--r--src/net_processing.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index e561f02c4a..d327a69a93 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -4689,7 +4689,10 @@ bool PeerManagerImpl::SendMessages(CNode* pto)
//
// Message: feefilter
//
- if (pto->m_tx_relay != nullptr && pto->GetCommonVersion() >= FEEFILTER_VERSION && gArgs.GetBoolArg("-feefilter", DEFAULT_FEEFILTER) &&
+ if (pto->m_tx_relay != nullptr &&
+ !m_ignore_incoming_txs &&
+ pto->GetCommonVersion() >= FEEFILTER_VERSION &&
+ gArgs.GetBoolArg("-feefilter", DEFAULT_FEEFILTER) &&
!pto->HasPermission(PF_FORCERELAY) // peers with the forcerelay permission should not filter txs to us
) {
CAmount currentFilter = m_mempool.GetMinFee(gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000).GetFeePerK();