@@ -1384,13 +1384,20 @@ bool AppInitMain(const util::Ref& context, NodeContext& node, interfaces::BlockA
1384
1384
// is not yet setup and may end up being set up twice if we
1385
1385
// need to reindex later.
1386
1386
1387
+ // see Step 2: parameter interactions for more information about these
1388
+ fListen = args.GetBoolArg (" -listen" , DEFAULT_LISTEN);
1389
+ fDiscover = args.GetBoolArg (" -discover" , true );
1390
+ g_relay_txes = !args.GetBoolArg (" -blocksonly" , DEFAULT_BLOCKSONLY);
1391
+
1387
1392
assert (!node.banman );
1388
1393
node.banman = MakeUnique<BanMan>(GetDataDir () / " banlist.dat" , &uiInterface, args.GetArg (" -bantime" , DEFAULT_MISBEHAVING_BANTIME));
1389
1394
assert (!node.connman );
1390
1395
node.connman = MakeUnique<CConnman>(GetRand (std::numeric_limits<uint64_t >::max ()), GetRand (std::numeric_limits<uint64_t >::max ()), args.GetBoolArg (" -networkactive" , true ));
1391
1396
1392
1397
assert (!node.fee_estimator );
1393
- node.fee_estimator = std::make_unique<CBlockPolicyEstimator>();
1398
+ // Don't initialize fee estimation with old data if we don't relay transactions,
1399
+ // as they would never get updated.
1400
+ if (g_relay_txes) node.fee_estimator = std::make_unique<CBlockPolicyEstimator>();
1394
1401
1395
1402
assert (!node.mempool );
1396
1403
int check_ratio = std::min<int >(std::max<int >(args.GetArg (" -checkmempool" , chainparams.DefaultConsistencyChecks () ? 1 : 0 ), 0 ), 1000000 );
@@ -1476,11 +1483,6 @@ bool AppInitMain(const util::Ref& context, NodeContext& node, interfaces::BlockA
1476
1483
}
1477
1484
}
1478
1485
1479
- // see Step 2: parameter interactions for more information about these
1480
- fListen = args.GetBoolArg (" -listen" , DEFAULT_LISTEN);
1481
- fDiscover = args.GetBoolArg (" -discover" , true );
1482
- g_relay_txes = !args.GetBoolArg (" -blocksonly" , DEFAULT_BLOCKSONLY);
1483
-
1484
1486
for (const std::string& strAddr : args.GetArgs (" -externalip" )) {
1485
1487
CService addrLocal;
1486
1488
if (Lookup (strAddr, addrLocal, GetListenPort (), fNameLookup ) && addrLocal.IsValid ())
0 commit comments