Skip to content

Commit 23c7b51

Browse files
committed
[net processing] Move -capturemessages to PeerManager::Options
1 parent bd59bda commit 23c7b51

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

src/net_processing.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include <blockencodings.h>
1111
#include <blockfilter.h>
1212
#include <chainparams.h>
13-
#include <common/args.h>
1413
#include <consensus/amount.h>
1514
#include <consensus/validation.h>
1615
#include <deploymentstatus.h>
@@ -5005,7 +5004,7 @@ bool PeerManagerImpl::ProcessMessages(CNode* pfrom, std::atomic<bool>& interrupt
50055004
msg.m_recv.data()
50065005
);
50075006

5008-
if (gArgs.GetBoolArg("-capturemessages", false)) {
5007+
if (m_opts.capture_messages) {
50095008
CaptureMessage(pfrom->addr, msg.m_type, MakeUCharSpan(msg.m_recv), /*is_incoming=*/true);
50105009
}
50115010

src/net_processing.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ class PeerManager : public CValidationInterface, public NetEventsInterface
5151
bool reconcile_txs{DEFAULT_TXRECONCILIATION_ENABLE};
5252
uint32_t max_orphan_txs{DEFAULT_MAX_ORPHAN_TRANSACTIONS};
5353
size_t max_extra_txs{DEFAULT_BLOCK_RECONSTRUCTION_EXTRA_TXN};
54+
bool capture_messages{false};
5455
};
5556

5657
static std::unique_ptr<PeerManager> make(CConnman& connman, AddrMan& addrman,

src/node/peerman_args.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ void ApplyArgsManOptions(const ArgsManager& argsman, PeerManager::Options& optio
1616
if (auto value{argsman.GetIntArg("-blockreconstructionextratxn")}) {
1717
options.max_extra_txs = size_t(std::max(int64_t{0}, *value));
1818
}
19+
20+
if (auto value{argsman.GetBoolArg("-capturemessages")}) options.capture_messages = *value;
1921
}
2022

2123
} // namespace node

0 commit comments

Comments
 (0)