aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorW. J. van der Laan <laanwj@protonmail.com>2021-09-16 16:30:43 +0200
committerW. J. van der Laan <laanwj@protonmail.com>2021-09-16 16:38:14 +0200
commit58e02395bad59359cc0210f2ab633d0a82827ba4 (patch)
tree0b04435a58a94ed910395cd7cd5a86739603c75b /src
parent6d76b57ca0cdf6f9c19ce065b9a4a628930a78b5 (diff)
parentfa66a7d732f9fd60d72f22087f0d5aadf3064bfb (diff)
Merge bitcoin/bitcoin#22955: p2p: Rename fBlocksOnly, Add test
fa66a7d732f9fd60d72f22087f0d5aadf3064bfb p2p: Rename fBlocksOnly, Add test (MarcoFalke) fac66d0a39cb0b4bc565b57087ba84dd932e9b6d test: Simplify p2p_blocksonly test with new miniwallet rescan_utxos method (MarcoFalke) Pull request description: `fBlocksOnly` has several issues: * The name is confusing * It is untested Fix both. ACKs for top commit: laanwj: Code review ACK fa66a7d732f9fd60d72f22087f0d5aadf3064bfb Tree-SHA512: 4218f455eeb37297f74603d7d44895288605844ae828a40dfb7a70215f1a058ac5ad945a22732f5ebcad3ad375d54ba360bea69ea79639a30d4c88b042448f0f
Diffstat (limited to 'src')
-rw-r--r--src/net_processing.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index 3ad34e83ba..80655c61e7 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -2909,13 +2909,13 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
return;
}
- // We won't accept tx inv's if we're in blocks-only mode, or this is a
+ // Reject tx INVs when the -blocksonly setting is enabled, or this is a
// block-relay-only peer
- bool fBlocksOnly = m_ignore_incoming_txs || (pfrom.m_tx_relay == nullptr);
+ bool reject_tx_invs{m_ignore_incoming_txs || (pfrom.m_tx_relay == nullptr)};
// Allow peers with relay permission to send data other than blocks in blocks only mode
if (pfrom.HasPermission(NetPermissionFlags::Relay)) {
- fBlocksOnly = false;
+ reject_tx_invs = false;
}
LOCK(cs_main);
@@ -2954,7 +2954,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
LogPrint(BCLog::NET, "got inv: %s %s peer=%d\n", inv.ToString(), fAlreadyHave ? "have" : "new", pfrom.GetId());
pfrom.AddKnownTx(inv.hash);
- if (fBlocksOnly) {
+ if (reject_tx_invs) {
LogPrint(BCLog::NET, "transaction (%s) inv sent in violation of protocol, disconnecting peer=%d\n", inv.hash.ToString(), pfrom.GetId());
pfrom.fDisconnect = true;
return;