Add whitelistalwaysrelay option
This commit is contained in:
parent
420fa8143a
commit
3a964973fe
3 changed files with 13 additions and 1 deletions
10
src/init.cpp
10
src/init.cpp
|
@ -817,6 +817,16 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// disable walletbroadcast in blocksonly mode
|
||||||
|
if (GetBoolArg("-blocksonly", false)) {
|
||||||
|
if (SoftSetBoolArg("-whitelistalwaysrelay", false))
|
||||||
|
LogPrintf("%s: parameter interaction: -blocksonly=1 -> setting -whitelistalwaysrelay=0\n", __func__);
|
||||||
|
#ifdef ENABLE_WALLET
|
||||||
|
if (SoftSetBoolArg("-walletbroadcast", false))
|
||||||
|
LogPrintf("%s: parameter interaction: -blocksonly=1 -> setting -walletbroadcast=0\n", __func__);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
// Make sure enough file descriptors are available
|
// Make sure enough file descriptors are available
|
||||||
int nBind = std::max((int)mapArgs.count("-bind") + (int)mapArgs.count("-whitebind"), 1);
|
int nBind = std::max((int)mapArgs.count("-bind") + (int)mapArgs.count("-whitebind"), 1);
|
||||||
int nUserMaxConnections = GetArg("-maxconnections", DEFAULT_MAX_PEER_CONNECTIONS);
|
int nUserMaxConnections = GetArg("-maxconnections", DEFAULT_MAX_PEER_CONNECTIONS);
|
||||||
|
|
|
@ -4465,7 +4465,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
|
||||||
assert(recentRejects);
|
assert(recentRejects);
|
||||||
recentRejects->insert(tx.GetHash());
|
recentRejects->insert(tx.GetHash());
|
||||||
|
|
||||||
if (pfrom->fWhitelisted) {
|
if (pfrom->fWhitelisted && GetBoolArg("-whitelistalwaysrelay", DEFAULT_WHITELISTALWAYSRELAY)) {
|
||||||
// Always relay transactions received from whitelisted peers, even
|
// Always relay transactions received from whitelisted peers, even
|
||||||
// if they were rejected from the mempool, allowing the node to
|
// if they were rejected from the mempool, allowing the node to
|
||||||
// function as a gateway for nodes hidden behind it.
|
// function as a gateway for nodes hidden behind it.
|
||||||
|
|
|
@ -41,6 +41,8 @@ struct CNodeStateStats;
|
||||||
|
|
||||||
/** Default for accepting alerts from the P2P network. */
|
/** Default for accepting alerts from the P2P network. */
|
||||||
static const bool DEFAULT_ALERTS = true;
|
static const bool DEFAULT_ALERTS = true;
|
||||||
|
/** Default for DEFAULT_WHITELISTALWAYSRELAY. */
|
||||||
|
static const bool DEFAULT_WHITELISTALWAYSRELAY = true;
|
||||||
/** Default for -minrelaytxfee, minimum relay fee for transactions */
|
/** Default for -minrelaytxfee, minimum relay fee for transactions */
|
||||||
static const unsigned int DEFAULT_MIN_RELAY_TX_FEE = 1000;
|
static const unsigned int DEFAULT_MIN_RELAY_TX_FEE = 1000;
|
||||||
/** Default for -maxorphantx, maximum number of orphan transactions kept in memory */
|
/** Default for -maxorphantx, maximum number of orphan transactions kept in memory */
|
||||||
|
|
Loading…
Reference in a new issue