Fix backporting errors

main.cpp
wallet/wallet.cpp
wallet/wallet.h
This commit is contained in:
lateminer
2018-10-13 16:14:49 +03:00
parent f366adf56d
commit b76793c9f9
3 changed files with 7 additions and 6 deletions

View File

@@ -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
{

View File

@@ -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");

View File

@@ -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; }