diff --git a/src/main.cpp b/src/main.cpp index fb8640640..7c2027f9b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1290,7 +1290,7 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState& state, const C LogPrint("mempool", "Rate limit dFreeCount: %g => %g\n", dFreeCount, dFreeCount+nSize); } - if (fRejectAbsurdFee && nFees > maxTxFee) + if (nAbsurdFee && nFees > maxTxFee) return state.Invalid(false, REJECT_HIGHFEE, "absurdly-high-fee", strprintf("%d > %d", nFees, maxTxFee)); @@ -1486,7 +1486,8 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState& state, const C if (insecure_rand()%MAX_DOUBLESPEND_BLOOM == 0) doubleSpendFilter.clear(); doubleSpendFilter.insert(relayForOutpoint); - RelayTransaction(tx); + CFeeRate txFeeRate = CFeeRate(0); + RelayTransaction(tx, txFeeRate); } else { diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 472a2fcca..b2d668b8d 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -1813,7 +1813,7 @@ void CWallet::ReacceptWalletTransactions() assert(wtx.GetHash() == wtxid); int nDepth = wtx.GetDepthInMainChain(); - if (!(wtx.IsCoinBase() || wtx.IsCoinStake()) && (nDepth == 0 && !wtx.isAbandoned()) && (IsMine(wtx) || IsFromMe(wtx))){ + if (!(wtx.IsCoinBase() || wtx.IsCoinStake()) && (nDepth == 0 && !wtx.isAbandoned()) && (IsMine(wtx) || IsFromMe(wtx))){ mapSorted.insert(std::make_pair(wtx.nOrderPos, &wtx)); } } @@ -1824,7 +1824,7 @@ void CWallet::ReacceptWalletTransactions() CWalletTx& wtx = *(item.second); LOCK(mempool.cs); - wtx.AcceptToMemoryPool(false); + wtx.AcceptToMemoryPool(false, maxTxFee); } } @@ -2905,7 +2905,7 @@ bool CWallet::CommitTransaction(CWalletTx& wtxNew, CReserveKey& reservekey) if (fBroadcastTransactions) { // Broadcast - if (!wtxNew.AcceptToMemoryPool(false)) + if (!wtxNew.AcceptToMemoryPool(false, maxTxFee)) { // This must not fail. The transaction has already been signed and recorded. LogPrintf("CommitTransaction(): Error: Transaction not valid\n"); diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index 29000c955..456863f71 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -214,7 +214,7 @@ public: bool IsInMainChain() const { const CBlockIndex *pindexRet; return GetDepthInMainChain(pindexRet) > 0; } int GetBlocksToMaturity() const; /** Pass this transaction to the mempool. Fails if absolute fee exceeds maxTxFee. */ - bool AcceptToMemoryPool(bool fLimitFree=true, const CAmount nAbsurdFee); + bool AcceptToMemoryPool(bool fLimitFree, const CAmount nAbsurdFee); bool hashUnset() const { return (hashBlock.IsNull() || hashBlock == ABANDON_HASH); } bool isAbandoned() const { return (hashBlock == ABANDON_HASH); } void setAbandoned() { hashBlock = ABANDON_HASH; }