Skip to content

Commit 5222e93

Browse files
laanwjcodablock
authored andcommitted
Merge bitcoin#7976: Remove obsolete reference to CValidationState from UpdateCoins.
c8b9248 Remove obsolete reference to CValidationState from UpdateCoins. (21E14)
1 parent 93be53e commit 5222e93

File tree

4 files changed

+9
-10
lines changed

4 files changed

+9
-10
lines changed

src/test/coins_tests.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include <boost/test/unit_test.hpp>
1919

2020
int ApplyTxInUndo(Coin&& undo, CCoinsViewCache& view, const COutPoint& out);
21-
void UpdateCoins(const CTransaction& tx, CValidationState &state, CCoinsViewCache& inputs, CTxUndo &txundo, int nHeight);
21+
void UpdateCoins(const CTransaction& tx, CCoinsViewCache& inputs, CTxUndo &txundo, int nHeight);
2222

2323
namespace
2424
{
@@ -378,8 +378,7 @@ BOOST_AUTO_TEST_CASE(updatecoins_simulation_test)
378378

379379
// Call UpdateCoins on the top cache
380380
CTxUndo undo;
381-
CValidationState dummy;
382-
UpdateCoins(tx, dummy, *(stack.back()), undo, height);
381+
UpdateCoins(tx, *(stack.back()), undo, height);
383382

384383
// Update the utxo set for future spends
385384
utxoset.insert(outpoint);

src/txmempool.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,7 @@ void CTxMemPool::check(const CCoinsViewCache *pcoins) const
856856
else {
857857
CValidationState state;
858858
assert(CheckInputs(tx, state, mempoolDuplicate, false, 0, false, NULL));
859-
UpdateCoins(tx, state, mempoolDuplicate, 1000000);
859+
UpdateCoins(tx, mempoolDuplicate, 1000000);
860860
}
861861
}
862862
unsigned int stepsSinceLastRemove = 0;
@@ -870,7 +870,7 @@ void CTxMemPool::check(const CCoinsViewCache *pcoins) const
870870
assert(stepsSinceLastRemove < waitingOnDependants.size());
871871
} else {
872872
assert(CheckInputs(entry->GetTx(), state, mempoolDuplicate, false, 0, false, NULL));
873-
UpdateCoins(entry->GetTx(), state, mempoolDuplicate, 1000000);
873+
UpdateCoins(entry->GetTx(), mempoolDuplicate, 1000000);
874874
stepsSinceLastRemove = 0;
875875
}
876876
}

src/validation.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1424,7 +1424,7 @@ void static InvalidBlockFound(CBlockIndex *pindex, const CValidationState &state
14241424
}
14251425
}
14261426

1427-
void UpdateCoins(const CTransaction& tx, CValidationState &state, CCoinsViewCache &inputs, CTxUndo &txundo, int nHeight)
1427+
void UpdateCoins(const CTransaction& tx, CCoinsViewCache& inputs, CTxUndo &txundo, int nHeight)
14281428
{
14291429
// mark inputs spent
14301430
if (!tx.IsCoinBase()) {
@@ -1439,10 +1439,10 @@ void UpdateCoins(const CTransaction& tx, CValidationState &state, CCoinsViewCach
14391439
AddCoins(inputs, tx, nHeight);
14401440
}
14411441

1442-
void UpdateCoins(const CTransaction& tx, CValidationState &state, CCoinsViewCache &inputs, int nHeight)
1442+
void UpdateCoins(const CTransaction& tx, CCoinsViewCache& inputs, int nHeight)
14431443
{
14441444
CTxUndo txundo;
1445-
UpdateCoins(tx, state, inputs, txundo, nHeight);
1445+
UpdateCoins(tx, inputs, txundo, nHeight);
14461446
}
14471447

14481448
bool CScriptCheck::operator()() {
@@ -2206,7 +2206,7 @@ static bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockInd
22062206
if (i > 0) {
22072207
blockundo.vtxundo.push_back(CTxUndo());
22082208
}
2209-
UpdateCoins(tx, state, view, i == 0 ? undoDummy : blockundo.vtxundo.back(), pindex->nHeight);
2209+
UpdateCoins(tx, view, i == 0 ? undoDummy : blockundo.vtxundo.back(), pindex->nHeight);
22102210

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

src/validation.h

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

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

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

0 commit comments

Comments
 (0)