Merge #9313: If we don't allow free txs, always send a fee filter

01fea7a If we don't allow free txs, always send a fee filter (Alex Morcos)
This commit is contained in:
Wladimir J. van der Laan 2016-12-15 19:44:49 +01:00
commit 756374c522
No known key found for this signature in database
GPG key ID: 74810B012346C9A6

View file

@ -2995,6 +2995,9 @@ bool SendMessages(CNode* pto, CConnman& connman)
if (pto->nVersion >= FEEFILTER_VERSION && GetBoolArg("-feefilter", DEFAULT_FEEFILTER) &&
!(pto->fWhitelisted && GetBoolArg("-whitelistforcerelay", DEFAULT_WHITELISTFORCERELAY))) {
CAmount currentFilter = mempool.GetMinFee(GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000).GetFeePerK();
// If we don't allow free transactions, then we always have a fee filter of at least minRelayTxFee
if (GetArg("-limitfreerelay", DEFAULT_LIMITFREERELAY) <= 0)
currentFilter = std::max(currentFilter, ::minRelayTxFee.GetFeePerK());
int64_t timeNow = GetTimeMicros();
if (timeNow > pto->nextSendTimeFeeFilter) {
static CFeeRate default_feerate(DEFAULT_MIN_RELAY_TX_FEE);