@@ -525,10 +525,11 @@ std::string FormatStateMessage(const CValidationState &state)
525525 state.GetRejectCode ());
526526}
527527
528- bool AcceptToMemoryPoolWorker (CTxMemPool& pool, CValidationState& state, const CTransaction& tx , bool fLimitFree ,
528+ bool AcceptToMemoryPoolWorker (CTxMemPool& pool, CValidationState& state, const CTransactionRef& ptx , bool fLimitFree ,
529529 bool * pfMissingInputs, int64_t nAcceptTime, bool fOverrideMempoolLimit , const CAmount& nAbsurdFee,
530530 std::vector<uint256>& vHashTxnToUncache)
531531{
532+ const CTransaction& tx = *ptx;
532533 const uint256 hash = tx.GetHash ();
533534 AssertLockHeld (cs_main);
534535 if (pfMissingInputs)
@@ -691,7 +692,7 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState& state, const C
691692 }
692693 }
693694
694- CTxMemPoolEntry entry (tx , nFees, nAcceptTime, dPriority, chainActive.Height (), pool.HasNoInputsOf (tx), inChainInputValue, fSpendsCoinbase , nSigOpsCost, lp);
695+ CTxMemPoolEntry entry (ptx , nFees, nAcceptTime, dPriority, chainActive.Height (), pool.HasNoInputsOf (tx), inChainInputValue, fSpendsCoinbase , nSigOpsCost, lp);
695696 unsigned int nSize = entry.GetTxSize ();
696697
697698 // Check that the transaction doesn't have an excessive number of
@@ -955,7 +956,7 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState& state, const C
955956 return true ;
956957}
957958
958- bool AcceptToMemoryPoolWithTime (CTxMemPool& pool, CValidationState &state, const CTransaction &tx, bool fLimitFree ,
959+ bool AcceptToMemoryPoolWithTime (CTxMemPool& pool, CValidationState &state, const CTransactionRef &tx, bool fLimitFree ,
959960 bool * pfMissingInputs, int64_t nAcceptTime, bool fOverrideMempoolLimit , const CAmount nAbsurdFee)
960961{
961962 std::vector<uint256> vHashTxToUncache;
@@ -970,7 +971,7 @@ bool AcceptToMemoryPoolWithTime(CTxMemPool& pool, CValidationState &state, const
970971 return res;
971972}
972973
973- bool AcceptToMemoryPool (CTxMemPool& pool, CValidationState &state, const CTransaction &tx, bool fLimitFree ,
974+ bool AcceptToMemoryPool (CTxMemPool& pool, CValidationState &state, const CTransactionRef &tx, bool fLimitFree ,
974975 bool * pfMissingInputs, bool fOverrideMempoolLimit , const CAmount nAbsurdFee)
975976{
976977 return AcceptToMemoryPoolWithTime (pool, state, tx, fLimitFree , pfMissingInputs, GetTime (), fOverrideMempoolLimit , nAbsurdFee);
@@ -2116,7 +2117,7 @@ bool static DisconnectTip(CValidationState& state, const CChainParams& chainpara
21162117 const CTransaction& tx = *it;
21172118 // ignore validation errors in resurrected transactions
21182119 CValidationState stateDummy;
2119- if (tx.IsCoinBase () || !AcceptToMemoryPool (mempool, stateDummy, tx , false , NULL , true )) {
2120+ if (tx.IsCoinBase () || !AcceptToMemoryPool (mempool, stateDummy, it , false , NULL , true )) {
21202121 mempool.removeRecursive (tx);
21212122 } else if (mempool.exists (tx.GetHash ())) {
21222123 vHashUpdate.push_back (tx.GetHash ());
@@ -4054,15 +4055,16 @@ bool LoadMempool(void)
40544055 file >> num;
40554056 double prioritydummy = 0 ;
40564057 while (num--) {
4058+ CTransactionRef tx;
40574059 int64_t nTime;
40584060 int64_t nFeeDelta;
4059- CTransaction tx (deserialize, file) ;
4061+ file >> tx ;
40604062 file >> nTime;
40614063 file >> nFeeDelta;
40624064
40634065 CAmount amountdelta = nFeeDelta;
40644066 if (amountdelta) {
4065- mempool.PrioritiseTransaction (tx. GetHash (), tx. GetHash ().ToString (), prioritydummy, amountdelta);
4067+ mempool.PrioritiseTransaction (tx-> GetHash (), tx-> GetHash ().ToString (), prioritydummy, amountdelta);
40664068 }
40674069 CValidationState state;
40684070 if (nTime + nExpiryTimeout > nNow) {
0 commit comments