aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2020-10-22 10:56:38 +0100
committerJohn Newbery <john@johnnewbery.com>2020-12-09 18:13:37 +0000
commit34e33ab8592d757b3acfe812c20d235029bbc319 (patch)
tree92fe61dc4eb99ce083e4192e828fb661b1d33c16 /src
parent68334b39443b3cfd75b0ef815ac40074185386f2 (diff)
downloadbitcoin-34e33ab8592d757b3acfe812c20d235029bbc319.tar.xz
Remove g_relay_txes
Also remove vestigial commend in init.cpp
Diffstat (limited to 'src')
-rw-r--r--src/init.cpp7
-rw-r--r--src/net.cpp1
-rw-r--r--src/net.h1
3 files changed, 3 insertions, 6 deletions
diff --git a/src/init.cpp b/src/init.cpp
index e16e72dcfe..5460c9b2b0 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -1373,10 +1373,9 @@ bool AppInitMain(const util::Ref& context, NodeContext& node, interfaces::BlockA
// is not yet setup and may end up being set up twice if we
// need to reindex later.
- // see Step 2: parameter interactions for more information about these
fListen = args.GetBoolArg("-listen", DEFAULT_LISTEN);
fDiscover = args.GetBoolArg("-discover", true);
- g_relay_txes = !args.GetBoolArg("-blocksonly", DEFAULT_BLOCKSONLY);
+ const bool ignores_incoming_txs{args.GetBoolArg("-blocksonly", DEFAULT_BLOCKSONLY)};
assert(!node.banman);
node.banman = MakeUnique<BanMan>(GetDataDir() / "banlist.dat", &uiInterface, args.GetArg("-bantime", DEFAULT_MISBEHAVING_BANTIME));
@@ -1386,7 +1385,7 @@ bool AppInitMain(const util::Ref& context, NodeContext& node, interfaces::BlockA
assert(!node.fee_estimator);
// Don't initialize fee estimation with old data if we don't relay transactions,
// as they would never get updated.
- if (g_relay_txes) node.fee_estimator = std::make_unique<CBlockPolicyEstimator>();
+ if (!ignores_incoming_txs) node.fee_estimator = std::make_unique<CBlockPolicyEstimator>();
assert(!node.mempool);
int check_ratio = std::min<int>(std::max<int>(args.GetArg("-checkmempool", chainparams.DefaultConsistencyChecks() ? 1 : 0), 0), 1000000);
@@ -1398,7 +1397,7 @@ bool AppInitMain(const util::Ref& context, NodeContext& node, interfaces::BlockA
assert(!node.peerman);
node.peerman = std::make_unique<PeerManager>(chainparams, *node.connman, node.banman.get(),
- *node.scheduler, chainman, *node.mempool, !g_relay_txes);
+ *node.scheduler, chainman, *node.mempool, ignores_incoming_txs);
RegisterValidationInterface(node.peerman.get());
// sanitize comments per BIP-0014, format user agent and check total size
diff --git a/src/net.cpp b/src/net.cpp
index 9c6d7b6375..d4746b4766 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -111,7 +111,6 @@ static const uint64_t RANDOMIZER_ID_ADDRCACHE = 0x1cf2e4ddd306dda9ULL; // SHA256
//
bool fDiscover = true;
bool fListen = true;
-bool g_relay_txes = !DEFAULT_BLOCKSONLY;
RecursiveMutex cs_mapLocalHost;
std::map<CNetAddr, LocalServiceInfo> mapLocalHost GUARDED_BY(cs_mapLocalHost);
static bool vfLimited[NET_MAX] GUARDED_BY(cs_mapLocalHost) = {};
diff --git a/src/net.h b/src/net.h
index 2fed49540d..cd3a80d29b 100644
--- a/src/net.h
+++ b/src/net.h
@@ -665,7 +665,6 @@ CAddress GetLocalAddress(const CNetAddr *paddrPeer, ServiceFlags nLocalServices)
extern bool fDiscover;
extern bool fListen;
-extern bool g_relay_txes;
/** Subversion as sent to the P2P network in `version` messages */
extern std::string strSubVersion;