@@ -489,7 +489,7 @@ class MemPoolAccept
489
489
std::list<CTransactionRef> m_replaced_transactions;
490
490
491
491
bool m_replacement_transaction;
492
- CAmount m_fee_out ;
492
+ CAmount m_base_fees ;
493
493
CAmount m_modified_fees;
494
494
CAmount m_conflicting_fees;
495
495
size_t m_conflicting_size;
@@ -561,7 +561,7 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws)
561
561
std::vector<COutPoint>& coins_to_uncache = args.m_coins_to_uncache ;
562
562
563
563
// Alias what we need out of ws
564
- TxValidationState & state = ws.m_state ;
564
+ TxValidationState& state = ws.m_state ;
565
565
std::set<uint256>& setConflicts = ws.m_conflicts ;
566
566
CTxMemPool::setEntries& allConflicting = ws.m_all_conflicting ;
567
567
CTxMemPool::setEntries& setAncestors = ws.m_ancestors ;
@@ -681,7 +681,7 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws)
681
681
if (!CheckSequenceLocks (m_pool, tx, STANDARD_LOCKTIME_VERIFY_FLAGS, &lp))
682
682
return state.Invalid (TxValidationResult::TX_PREMATURE_SPEND, " non-BIP68-final" );
683
683
684
- if (!Consensus::CheckTxInputs (tx, state, m_view, g_chainman.m_blockman .GetSpendHeight (m_view), ws.m_fee_out )) {
684
+ if (!Consensus::CheckTxInputs (tx, state, m_view, g_chainman.m_blockman .GetSpendHeight (m_view), ws.m_base_fees )) {
685
685
return false ; // state filled in by CheckTxInputs
686
686
}
687
687
@@ -699,7 +699,7 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws)
699
699
int64_t nSigOpsCost = GetTransactionSigOpCost (tx, m_view, STANDARD_SCRIPT_VERIFY_FLAGS);
700
700
701
701
// nModifiedFees includes any fee deltas from PrioritiseTransaction
702
- nModifiedFees = ws.m_fee_out ;
702
+ nModifiedFees = ws.m_base_fees ;
703
703
m_pool.ApplyDelta (hash, nModifiedFees);
704
704
705
705
// Keep track of transactions that spend a coinbase, which we re-scan
@@ -713,7 +713,7 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws)
713
713
}
714
714
}
715
715
716
- entry.reset (new CTxMemPoolEntry (ptx, ws.m_fee_out , nAcceptTime, ::ChainActive ().Height (),
716
+ entry.reset (new CTxMemPoolEntry (ptx, ws.m_base_fees , nAcceptTime, ::ChainActive ().Height (),
717
717
fSpendsCoinbase , nSigOpsCost, lp));
718
718
unsigned int nSize = entry->GetTxSize ();
719
719
@@ -920,7 +920,7 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws)
920
920
bool MemPoolAccept::PolicyScriptChecks (const ATMPArgs& args, Workspace& ws, PrecomputedTransactionData& txdata)
921
921
{
922
922
const CTransaction& tx = *ws.m_ptx ;
923
- TxValidationState & state = ws.m_state ;
923
+ TxValidationState& state = ws.m_state ;
924
924
925
925
constexpr unsigned int scriptVerifyFlags = STANDARD_SCRIPT_VERIFY_FLAGS;
926
926
@@ -947,7 +947,7 @@ bool MemPoolAccept::ConsensusScriptChecks(const ATMPArgs& args, Workspace& ws, P
947
947
{
948
948
const CTransaction& tx = *ws.m_ptx ;
949
949
const uint256& hash = ws.m_hash ;
950
- TxValidationState & state = ws.m_state ;
950
+ TxValidationState& state = ws.m_state ;
951
951
const CChainParams& chainparams = args.m_chainparams ;
952
952
953
953
// Check again against the current block tip's script verification
@@ -978,7 +978,7 @@ bool MemPoolAccept::Finalize(const ATMPArgs& args, Workspace& ws)
978
978
{
979
979
const CTransaction& tx = *ws.m_ptx ;
980
980
const uint256& hash = ws.m_hash ;
981
- TxValidationState & state = ws.m_state ;
981
+ TxValidationState& state = ws.m_state ;
982
982
const bool bypass_limits = args.m_bypass_limits ;
983
983
984
984
CTxMemPool::setEntries& allConflicting = ws.m_all_conflicting ;
@@ -1025,30 +1025,30 @@ MempoolAcceptResult MemPoolAccept::AcceptSingleTransaction(const CTransactionRef
1025
1025
AssertLockHeld (cs_main);
1026
1026
LOCK (m_pool.cs ); // mempool "read lock" (held through GetMainSignals().TransactionAddedToMempool())
1027
1027
1028
- Workspace workspace (ptx);
1028
+ Workspace ws (ptx);
1029
1029
1030
- if (!PreChecks (args, workspace )) return MempoolAcceptResult (workspace .m_state );
1030
+ if (!PreChecks (args, ws )) return MempoolAcceptResult (ws .m_state );
1031
1031
1032
1032
// Only compute the precomputed transaction data if we need to verify
1033
1033
// scripts (ie, other policy checks pass). We perform the inexpensive
1034
1034
// checks first and avoid hashing and signature verification unless those
1035
1035
// checks pass, to mitigate CPU exhaustion denial-of-service attacks.
1036
1036
PrecomputedTransactionData txdata;
1037
1037
1038
- if (!PolicyScriptChecks (args, workspace , txdata)) return MempoolAcceptResult (workspace .m_state );
1038
+ if (!PolicyScriptChecks (args, ws , txdata)) return MempoolAcceptResult (ws .m_state );
1039
1039
1040
- if (!ConsensusScriptChecks (args, workspace , txdata)) return MempoolAcceptResult (workspace .m_state );
1040
+ if (!ConsensusScriptChecks (args, ws , txdata)) return MempoolAcceptResult (ws .m_state );
1041
1041
1042
1042
// Tx was accepted, but not added
1043
1043
if (args.m_test_accept ) {
1044
- return MempoolAcceptResult (std::move (workspace .m_replaced_transactions ), workspace. m_fee_out );
1044
+ return MempoolAcceptResult (std::move (ws .m_replaced_transactions ), ws. m_base_fees );
1045
1045
}
1046
1046
1047
- if (!Finalize (args, workspace )) return MempoolAcceptResult (workspace .m_state );
1047
+ if (!Finalize (args, ws )) return MempoolAcceptResult (ws .m_state );
1048
1048
1049
1049
GetMainSignals ().TransactionAddedToMempool (ptx, m_pool.GetAndIncrementSequence ());
1050
1050
1051
- return MempoolAcceptResult (std::move (workspace .m_replaced_transactions ), workspace. m_fee_out );
1051
+ return MempoolAcceptResult (std::move (ws .m_replaced_transactions ), ws. m_base_fees );
1052
1052
}
1053
1053
1054
1054
} // anon namespace
@@ -1080,8 +1080,7 @@ static MempoolAcceptResult AcceptToMemoryPoolWithTime(const CChainParams& chainp
1080
1080
1081
1081
MempoolAcceptResult AcceptToMemoryPool (CTxMemPool& pool, const CTransactionRef &tx, bool bypass_limits, bool test_accept)
1082
1082
{
1083
- const CChainParams& chainparams = Params ();
1084
- return AcceptToMemoryPoolWithTime (chainparams, pool, tx, GetTime (), bypass_limits, test_accept);
1083
+ return AcceptToMemoryPoolWithTime (Params (), pool, tx, GetTime (), bypass_limits, test_accept);
1085
1084
}
1086
1085
1087
1086
CTransactionRef GetTransaction (const CBlockIndex* const block_index, const CTxMemPool* const mempool, const uint256& hash, const Consensus::Params& consensusParams, uint256& hashBlock)
0 commit comments