Remove obsolete reference to CValidationState from UpdateCoins.

This commit is contained in:
21E14
2016-04-29 23:45:20 -04:00
committed by Jack Grigg
parent 838e7a29cc
commit 8cb98d9105
5 changed files with 9 additions and 9 deletions

View File

@@ -1684,7 +1684,7 @@ void static InvalidBlockFound(CBlockIndex *pindex, const CValidationState &state
}
}
void UpdateCoins(const CTransaction& tx, CValidationState &state, CCoinsViewCache &inputs, CTxUndo &txundo, int nHeight)
void UpdateCoins(const CTransaction& tx, CCoinsViewCache& inputs, CTxUndo &txundo, int nHeight)
{
// mark inputs spent
if (!tx.IsCoinBase()) {
@@ -1718,10 +1718,10 @@ void UpdateCoins(const CTransaction& tx, CValidationState &state, CCoinsViewCach
inputs.ModifyCoins(tx.GetHash())->FromTx(tx, nHeight);
}
void UpdateCoins(const CTransaction& tx, CValidationState &state, CCoinsViewCache &inputs, int nHeight)
void UpdateCoins(const CTransaction& tx, CCoinsViewCache& inputs, int nHeight)
{
CTxUndo txundo;
UpdateCoins(tx, state, inputs, txundo, nHeight);
UpdateCoins(tx, inputs, txundo, nHeight);
}
bool CScriptCheck::operator()() {
@@ -2278,7 +2278,7 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin
if (i > 0) {
blockundo.vtxundo.push_back(CTxUndo());
}
UpdateCoins(tx, state, view, i == 0 ? undoDummy : blockundo.vtxundo.back(), pindex->nHeight);
UpdateCoins(tx, view, i == 0 ? undoDummy : blockundo.vtxundo.back(), pindex->nHeight);
BOOST_FOREACH(const JSDescription &joinsplit, tx.vjoinsplit) {
BOOST_FOREACH(const uint256 &note_commitment, joinsplit.commitments) {

View File

@@ -337,7 +337,7 @@ bool ContextualCheckInputs(const CTransaction& tx, CValidationState &state, cons
bool ContextualCheckTransaction(const CTransaction& tx, CValidationState &state, int nHeight, int dosLevel);
/** Apply the effects of this transaction on the UTXO set represented by view */
void UpdateCoins(const CTransaction& tx, CValidationState &state, CCoinsViewCache &inputs, int nHeight);
void UpdateCoins(const CTransaction& tx, CCoinsViewCache& inputs, int nHeight);
/** Context-independent validity checks */
bool CheckTransaction(const CTransaction& tx, CValidationState& state, libzcash::ProofVerifier& verifier);

View File

@@ -296,7 +296,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn)
if (!ContextualCheckInputs(tx, state, view, true, MANDATORY_SCRIPT_VERIFY_FLAGS, true, Params().GetConsensus()))
continue;
UpdateCoins(tx, state, view, nHeight);
UpdateCoins(tx, view, nHeight);
// Added
pblock->vtx.push_back(tx);

View File

@@ -745,7 +745,7 @@ BOOST_AUTO_TEST_CASE(coins_coinbase_spends)
BOOST_CHECK(tx.IsCoinBase());
CValidationState state;
UpdateCoins(tx, state, cache, 100);
UpdateCoins(tx, cache, 100);
// Create coinbase spend
CMutableTransaction mtx2;

View File

@@ -384,7 +384,7 @@ void CTxMemPool::check(const CCoinsViewCache *pcoins) const
else {
CValidationState state;
assert(ContextualCheckInputs(tx, state, mempoolDuplicate, false, 0, false, Params().GetConsensus(), NULL));
UpdateCoins(tx, state, mempoolDuplicate, 1000000);
UpdateCoins(tx, mempoolDuplicate, 1000000);
}
}
unsigned int stepsSinceLastRemove = 0;
@@ -398,7 +398,7 @@ void CTxMemPool::check(const CCoinsViewCache *pcoins) const
assert(stepsSinceLastRemove < waitingOnDependants.size());
} else {
assert(ContextualCheckInputs(entry->GetTx(), state, mempoolDuplicate, false, 0, false, Params().GetConsensus(), NULL));
UpdateCoins(entry->GetTx(), state, mempoolDuplicate, 1000000);
UpdateCoins(entry->GetTx(), mempoolDuplicate, 1000000);
stepsSinceLastRemove = 0;
}
}