mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-05 14:06:27 -05:00
[net processing] Move -capturemessages to PeerManager::Options
This commit is contained in:
parent
bd59bda26b
commit
23c7b51ddd
3 changed files with 4 additions and 2 deletions
|
@ -10,7 +10,6 @@
|
|||
#include <blockencodings.h>
|
||||
#include <blockfilter.h>
|
||||
#include <chainparams.h>
|
||||
#include <common/args.h>
|
||||
#include <consensus/amount.h>
|
||||
#include <consensus/validation.h>
|
||||
#include <deploymentstatus.h>
|
||||
|
@ -5005,7 +5004,7 @@ bool PeerManagerImpl::ProcessMessages(CNode* pfrom, std::atomic<bool>& interrupt
|
|||
msg.m_recv.data()
|
||||
);
|
||||
|
||||
if (gArgs.GetBoolArg("-capturemessages", false)) {
|
||||
if (m_opts.capture_messages) {
|
||||
CaptureMessage(pfrom->addr, msg.m_type, MakeUCharSpan(msg.m_recv), /*is_incoming=*/true);
|
||||
}
|
||||
|
||||
|
|
|
@ -51,6 +51,7 @@ public:
|
|||
bool reconcile_txs{DEFAULT_TXRECONCILIATION_ENABLE};
|
||||
uint32_t max_orphan_txs{DEFAULT_MAX_ORPHAN_TRANSACTIONS};
|
||||
size_t max_extra_txs{DEFAULT_BLOCK_RECONSTRUCTION_EXTRA_TXN};
|
||||
bool capture_messages{false};
|
||||
};
|
||||
|
||||
static std::unique_ptr<PeerManager> make(CConnman& connman, AddrMan& addrman,
|
||||
|
|
|
@ -16,6 +16,8 @@ void ApplyArgsManOptions(const ArgsManager& argsman, PeerManager::Options& optio
|
|||
if (auto value{argsman.GetIntArg("-blockreconstructionextratxn")}) {
|
||||
options.max_extra_txs = size_t(std::max(int64_t{0}, *value));
|
||||
}
|
||||
|
||||
if (auto value{argsman.GetBoolArg("-capturemessages")}) options.capture_messages = *value;
|
||||
}
|
||||
|
||||
} // namespace node
|
||||
|
|
Loading…
Add table
Reference in a new issue