Skip to content

Commit fa9e6d8

Browse files
committed
[net processing] Move -txreconciliation to PeerManager::Options
1 parent 4cfb7b9 commit fa9e6d8

File tree

5 files changed

+5
-4
lines changed

5 files changed

+5
-4
lines changed

src/init.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
#include <node/mempool_persist_args.h>
5252
#include <node/miner.h>
5353
#include <node/peerman_args.h>
54-
#include <node/txreconciliation.h>
5554
#include <node/validation_cache_args.h>
5655
#include <policy/feerate.h>
5756
#include <policy/fees.h>

src/net_processing.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1826,7 +1826,7 @@ PeerManagerImpl::PeerManagerImpl(CConnman& connman, AddrMan& addrman,
18261826
{
18271827
// While Erlay support is incomplete, it must be enabled explicitly via -txreconciliation.
18281828
// This argument can go away after Erlay support is complete.
1829-
if (gArgs.GetBoolArg("-txreconciliation", DEFAULT_TXRECONCILIATION_ENABLE)) {
1829+
if (opts.reconcile_txs) {
18301830
m_txreconciliation = std::make_unique<TxReconciliationTracker>(TXRECONCILIATION_VERSION);
18311831
}
18321832
}

src/net_processing.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ class CChainParams;
1414
class CTxMemPool;
1515
class ChainstateManager;
1616

17+
/** Whether transaction reconciliation protocol should be enabled by default. */
18+
static constexpr bool DEFAULT_TXRECONCILIATION_ENABLE{false};
1719
/** Default for -maxorphantx, maximum number of orphan transactions kept in memory */
1820
static const unsigned int DEFAULT_MAX_ORPHAN_TRANSACTIONS = 100;
1921
/** Default number of orphan+recently-replaced txn to keep around for block reconstruction */
@@ -46,6 +48,7 @@ class PeerManager : public CValidationInterface, public NetEventsInterface
4648
struct Options {
4749
/** Whether this node is running in -blocksonly mode */
4850
bool ignore_incoming_txs{DEFAULT_BLOCKSONLY};
51+
bool reconcile_txs{DEFAULT_TXRECONCILIATION_ENABLE};
4952
};
5053

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

src/node/peerman_args.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ namespace node {
77

88
void ApplyArgsManOptions(const ArgsManager& argsman, PeerManager::Options& options)
99
{
10+
if(auto value{argsman.GetBoolArg("-txreconciliation")}) options.reconcile_txs = *value;
1011
}
1112

1213
} // namespace node

src/node/txreconciliation.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
#include <memory>
1212
#include <tuple>
1313

14-
/** Whether transaction reconciliation protocol should be enabled by default. */
15-
static constexpr bool DEFAULT_TXRECONCILIATION_ENABLE{false};
1614
/** Supported transaction reconciliation protocol version */
1715
static constexpr uint32_t TXRECONCILIATION_VERSION{1};
1816

0 commit comments

Comments
 (0)