|
|
@ -525,10 +525,11 @@ std::string FormatStateMessage(const CValidationState &state) |
|
|
|
state.GetRejectCode()); |
|
|
|
state.GetRejectCode()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState& state, const CTransaction& tx, bool fLimitFree, |
|
|
|
bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState& state, const CTransactionRef& ptx, bool fLimitFree, |
|
|
|
bool* pfMissingInputs, int64_t nAcceptTime, bool fOverrideMempoolLimit, const CAmount& nAbsurdFee, |
|
|
|
bool* pfMissingInputs, int64_t nAcceptTime, bool fOverrideMempoolLimit, const CAmount& nAbsurdFee, |
|
|
|
std::vector<uint256>& vHashTxnToUncache) |
|
|
|
std::vector<uint256>& vHashTxnToUncache) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
const CTransaction& tx = *ptx; |
|
|
|
const uint256 hash = tx.GetHash(); |
|
|
|
const uint256 hash = tx.GetHash(); |
|
|
|
AssertLockHeld(cs_main); |
|
|
|
AssertLockHeld(cs_main); |
|
|
|
if (pfMissingInputs) |
|
|
|
if (pfMissingInputs) |
|
|
@ -691,7 +692,7 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState& state, const C |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
CTxMemPoolEntry entry(tx, nFees, nAcceptTime, dPriority, chainActive.Height(), pool.HasNoInputsOf(tx), inChainInputValue, fSpendsCoinbase, nSigOpsCost, lp); |
|
|
|
CTxMemPoolEntry entry(ptx, nFees, nAcceptTime, dPriority, chainActive.Height(), pool.HasNoInputsOf(tx), inChainInputValue, fSpendsCoinbase, nSigOpsCost, lp); |
|
|
|
unsigned int nSize = entry.GetTxSize(); |
|
|
|
unsigned int nSize = entry.GetTxSize(); |
|
|
|
|
|
|
|
|
|
|
|
// Check that the transaction doesn't have an excessive number of
|
|
|
|
// Check that the transaction doesn't have an excessive number of
|
|
|
@ -955,7 +956,7 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState& state, const C |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bool AcceptToMemoryPoolWithTime(CTxMemPool& pool, CValidationState &state, const CTransaction &tx, bool fLimitFree, |
|
|
|
bool AcceptToMemoryPoolWithTime(CTxMemPool& pool, CValidationState &state, const CTransactionRef &tx, bool fLimitFree, |
|
|
|
bool* pfMissingInputs, int64_t nAcceptTime, bool fOverrideMempoolLimit, const CAmount nAbsurdFee) |
|
|
|
bool* pfMissingInputs, int64_t nAcceptTime, bool fOverrideMempoolLimit, const CAmount nAbsurdFee) |
|
|
|
{ |
|
|
|
{ |
|
|
|
std::vector<uint256> vHashTxToUncache; |
|
|
|
std::vector<uint256> vHashTxToUncache; |
|
|
@ -970,7 +971,7 @@ bool AcceptToMemoryPoolWithTime(CTxMemPool& pool, CValidationState &state, const |
|
|
|
return res; |
|
|
|
return res; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransaction &tx, bool fLimitFree, |
|
|
|
bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransactionRef &tx, bool fLimitFree, |
|
|
|
bool* pfMissingInputs, bool fOverrideMempoolLimit, const CAmount nAbsurdFee) |
|
|
|
bool* pfMissingInputs, bool fOverrideMempoolLimit, const CAmount nAbsurdFee) |
|
|
|
{ |
|
|
|
{ |
|
|
|
return AcceptToMemoryPoolWithTime(pool, state, tx, fLimitFree, pfMissingInputs, GetTime(), fOverrideMempoolLimit, nAbsurdFee); |
|
|
|
return AcceptToMemoryPoolWithTime(pool, state, tx, fLimitFree, pfMissingInputs, GetTime(), fOverrideMempoolLimit, nAbsurdFee); |
|
|
@ -2116,7 +2117,7 @@ bool static DisconnectTip(CValidationState& state, const CChainParams& chainpara |
|
|
|
const CTransaction& tx = *it; |
|
|
|
const CTransaction& tx = *it; |
|
|
|
// ignore validation errors in resurrected transactions
|
|
|
|
// ignore validation errors in resurrected transactions
|
|
|
|
CValidationState stateDummy; |
|
|
|
CValidationState stateDummy; |
|
|
|
if (tx.IsCoinBase() || !AcceptToMemoryPool(mempool, stateDummy, tx, false, NULL, true)) { |
|
|
|
if (tx.IsCoinBase() || !AcceptToMemoryPool(mempool, stateDummy, it, false, NULL, true)) { |
|
|
|
mempool.removeRecursive(tx); |
|
|
|
mempool.removeRecursive(tx); |
|
|
|
} else if (mempool.exists(tx.GetHash())) { |
|
|
|
} else if (mempool.exists(tx.GetHash())) { |
|
|
|
vHashUpdate.push_back(tx.GetHash()); |
|
|
|
vHashUpdate.push_back(tx.GetHash()); |
|
|
@ -4054,15 +4055,16 @@ bool LoadMempool(void) |
|
|
|
file >> num; |
|
|
|
file >> num; |
|
|
|
double prioritydummy = 0; |
|
|
|
double prioritydummy = 0; |
|
|
|
while (num--) { |
|
|
|
while (num--) { |
|
|
|
|
|
|
|
CTransactionRef tx; |
|
|
|
int64_t nTime; |
|
|
|
int64_t nTime; |
|
|
|
int64_t nFeeDelta; |
|
|
|
int64_t nFeeDelta; |
|
|
|
CTransaction tx(deserialize, file); |
|
|
|
file >> tx; |
|
|
|
file >> nTime; |
|
|
|
file >> nTime; |
|
|
|
file >> nFeeDelta; |
|
|
|
file >> nFeeDelta; |
|
|
|
|
|
|
|
|
|
|
|
CAmount amountdelta = nFeeDelta; |
|
|
|
CAmount amountdelta = nFeeDelta; |
|
|
|
if (amountdelta) { |
|
|
|
if (amountdelta) { |
|
|
|
mempool.PrioritiseTransaction(tx.GetHash(), tx.GetHash().ToString(), prioritydummy, amountdelta); |
|
|
|
mempool.PrioritiseTransaction(tx->GetHash(), tx->GetHash().ToString(), prioritydummy, amountdelta); |
|
|
|
} |
|
|
|
} |
|
|
|
CValidationState state; |
|
|
|
CValidationState state; |
|
|
|
if (nTime + nExpiryTimeout > nNow) { |
|
|
|
if (nTime + nExpiryTimeout > nNow) { |
|
|
|