[net processing] Move -txreconciliation to PeerManager::Options
This commit is contained in:
1 parent
4cfb7b925f
commit
fa9e6d80d1
5 files changed
+5
-4
No files matched your search
@@ -51,7 +51,6 @@
|
|||||||
#include <node/mempool_persist_args.h>
|
#include <node/mempool_persist_args.h>
|
||||||
#include <node/miner.h>
|
#include <node/miner.h>
|
||||||
#include <node/peerman_args.h>
|
#include <node/peerman_args.h>
|
||||||
#include <node/txreconciliation.h>
|
|
||||||
#include <node/validation_cache_args.h>
|
#include <node/validation_cache_args.h>
|
||||||
#include <policy/feerate.h>
|
#include <policy/feerate.h>
|
||||||
#include <policy/fees.h>
|
#include <policy/fees.h>
|
||||||
|
|||||||
@@ -1826,7 +1826,7 @@ PeerManagerImpl::PeerManagerImpl(CConnman& connman, AddrMan& addrman,
|
|||||||
{
|
{
|
||||||
// While Erlay support is incomplete, it must be enabled explicitly via -txreconciliation.
|
// While Erlay support is incomplete, it must be enabled explicitly via -txreconciliation.
|
||||||
// This argument can go away after Erlay support is complete.
|
// This argument can go away after Erlay support is complete.
|
||||||
if (gArgs.GetBoolArg("-txreconciliation", DEFAULT_TXRECONCILIATION_ENABLE)) {
|
if (opts.reconcile_txs) {
|
||||||
m_txreconciliation = std::make_unique<TxReconciliationTracker>(TXRECONCILIATION_VERSION);
|
m_txreconciliation = std::make_unique<TxReconciliationTracker>(TXRECONCILIATION_VERSION);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ class CChainParams;
|
|||||||
class CTxMemPool;
|
class CTxMemPool;
|
||||||
class ChainstateManager;
|
class ChainstateManager;
|
||||||
|
|
||||||
|
/** Whether transaction reconciliation protocol should be enabled by default. */
|
||||||
|
static constexpr bool DEFAULT_TXRECONCILIATION_ENABLE{false};
|
||||||
/** Default for -maxorphantx, maximum number of orphan transactions kept in memory */
|
/** Default for -maxorphantx, maximum number of orphan transactions kept in memory */
|
||||||
static const unsigned int DEFAULT_MAX_ORPHAN_TRANSACTIONS = 100;
|
static const unsigned int DEFAULT_MAX_ORPHAN_TRANSACTIONS = 100;
|
||||||
/** Default number of orphan+recently-replaced txn to keep around for block reconstruction */
|
/** Default number of orphan+recently-replaced txn to keep around for block reconstruction */
|
||||||
@@ -46,6 +48,7 @@ public:
|
|||||||
struct Options {
|
struct Options {
|
||||||
/** Whether this node is running in -blocksonly mode */
|
/** Whether this node is running in -blocksonly mode */
|
||||||
bool ignore_incoming_txs{DEFAULT_BLOCKSONLY};
|
bool ignore_incoming_txs{DEFAULT_BLOCKSONLY};
|
||||||
|
bool reconcile_txs{DEFAULT_TXRECONCILIATION_ENABLE};
|
||||||
};
|
};
|
||||||
|
|
||||||
static std::unique_ptr<PeerManager> make(CConnman& connman, AddrMan& addrman,
|
static std::unique_ptr<PeerManager> make(CConnman& connman, AddrMan& addrman,
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ namespace node {
|
|||||||
|
|
||||||
void ApplyArgsManOptions(const ArgsManager& argsman, PeerManager::Options& options)
|
void ApplyArgsManOptions(const ArgsManager& argsman, PeerManager::Options& options)
|
||||||
{
|
{
|
||||||
|
if(auto value{argsman.GetBoolArg("-txreconciliation")}) options.reconcile_txs = *value;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace node
|
} // namespace node
|
||||||
|
|||||||
@@ -11,8 +11,6 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
|
|
||||||
/** Whether transaction reconciliation protocol should be enabled by default. */
|
|
||||||
static constexpr bool DEFAULT_TXRECONCILIATION_ENABLE{false};
|
|
||||||
/** Supported transaction reconciliation protocol version */
|
/** Supported transaction reconciliation protocol version */
|
||||||
static constexpr uint32_t TXRECONCILIATION_VERSION{1};
|
static constexpr uint32_t TXRECONCILIATION_VERSION{1};
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user