Skip to content

Commit c8b9248

Browse files
author
21E14
committed
Remove obsolete reference to CValidationState from UpdateCoins.
1 parent 0ad1041 commit c8b9248

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

src/main.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1744,7 +1744,7 @@ void static InvalidBlockFound(CBlockIndex *pindex, const CValidationState &state
17441744
}
17451745
}
17461746

1747-
void UpdateCoins(const CTransaction& tx, CValidationState &state, CCoinsViewCache &inputs, CTxUndo &txundo, int nHeight)
1747+
void UpdateCoins(const CTransaction& tx, CCoinsViewCache& inputs, CTxUndo &txundo, int nHeight)
17481748
{
17491749
// mark inputs spent
17501750
if (!tx.IsCoinBase()) {
@@ -1770,10 +1770,10 @@ void UpdateCoins(const CTransaction& tx, CValidationState &state, CCoinsViewCach
17701770
inputs.ModifyNewCoins(tx.GetHash(), tx.IsCoinBase())->FromTx(tx, nHeight);
17711771
}
17721772

1773-
void UpdateCoins(const CTransaction& tx, CValidationState &state, CCoinsViewCache &inputs, int nHeight)
1773+
void UpdateCoins(const CTransaction& tx, CCoinsViewCache& inputs, int nHeight)
17741774
{
17751775
CTxUndo txundo;
1776-
UpdateCoins(tx, state, inputs, txundo, nHeight);
1776+
UpdateCoins(tx, inputs, txundo, nHeight);
17771777
}
17781778

17791779
bool CScriptCheck::operator()() {
@@ -2385,7 +2385,7 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin
23852385
if (i > 0) {
23862386
blockundo.vtxundo.push_back(CTxUndo());
23872387
}
2388-
UpdateCoins(tx, state, view, i == 0 ? undoDummy : blockundo.vtxundo.back(), pindex->nHeight);
2388+
UpdateCoins(tx, view, i == 0 ? undoDummy : blockundo.vtxundo.back(), pindex->nHeight);
23892389

23902390
vPos.push_back(std::make_pair(tx.GetHash(), pos));
23912391
pos.nTxOffset += ::GetSerializeSize(tx, SER_DISK, CLIENT_VERSION);

src/main.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ bool CheckInputs(const CTransaction& tx, CValidationState &state, const CCoinsVi
359359
unsigned int flags, bool cacheStore, std::vector<CScriptCheck> *pvChecks = NULL);
360360

361361
/** Apply the effects of this transaction on the UTXO set represented by view */
362-
void UpdateCoins(const CTransaction& tx, CValidationState &state, CCoinsViewCache &inputs, int nHeight);
362+
void UpdateCoins(const CTransaction& tx, CCoinsViewCache& inputs, int nHeight);
363363

364364
/** Context-independent validity checks */
365365
bool CheckTransaction(const CTransaction& tx, CValidationState& state);

src/test/coins_tests.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,7 @@ BOOST_AUTO_TEST_CASE(updatecoins_simulation_test)
297297
CCoins &coins = result[tx.GetHash()];
298298
coins.FromTx(tx, height);
299299

300-
CValidationState dummy;
301-
UpdateCoins(tx, dummy, *(stack.back()), height);
300+
UpdateCoins(tx, *(stack.back()), height);
302301
}
303302

304303
// Once every 1000 iterations and at the end, verify the full cache.

src/txmempool.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ void CTxMemPool::check(const CCoinsViewCache *pcoins) const
720720
else {
721721
CValidationState state;
722722
assert(CheckInputs(tx, state, mempoolDuplicate, false, 0, false, NULL));
723-
UpdateCoins(tx, state, mempoolDuplicate, 1000000);
723+
UpdateCoins(tx, mempoolDuplicate, 1000000);
724724
}
725725
}
726726
unsigned int stepsSinceLastRemove = 0;
@@ -734,7 +734,7 @@ void CTxMemPool::check(const CCoinsViewCache *pcoins) const
734734
assert(stepsSinceLastRemove < waitingOnDependants.size());
735735
} else {
736736
assert(CheckInputs(entry->GetTx(), state, mempoolDuplicate, false, 0, false, NULL));
737-
UpdateCoins(entry->GetTx(), state, mempoolDuplicate, 1000000);
737+
UpdateCoins(entry->GetTx(), mempoolDuplicate, 1000000);
738738
stepsSinceLastRemove = 0;
739739
}
740740
}

0 commit comments

Comments
 (0)