Remove obsolete reference to CValidationState from UpdateCoins.
This commit is contained in:
@@ -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
|
// mark inputs spent
|
||||||
if (!tx.IsCoinBase()) {
|
if (!tx.IsCoinBase()) {
|
||||||
@@ -1718,10 +1718,10 @@ void UpdateCoins(const CTransaction& tx, CValidationState &state, CCoinsViewCach
|
|||||||
inputs.ModifyCoins(tx.GetHash())->FromTx(tx, nHeight);
|
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;
|
CTxUndo txundo;
|
||||||
UpdateCoins(tx, state, inputs, txundo, nHeight);
|
UpdateCoins(tx, inputs, txundo, nHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CScriptCheck::operator()() {
|
bool CScriptCheck::operator()() {
|
||||||
@@ -2278,7 +2278,7 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin
|
|||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
blockundo.vtxundo.push_back(CTxUndo());
|
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 JSDescription &joinsplit, tx.vjoinsplit) {
|
||||||
BOOST_FOREACH(const uint256 ¬e_commitment, joinsplit.commitments) {
|
BOOST_FOREACH(const uint256 ¬e_commitment, joinsplit.commitments) {
|
||||||
|
|||||||
@@ -337,7 +337,7 @@ bool ContextualCheckInputs(const CTransaction& tx, CValidationState &state, cons
|
|||||||
bool ContextualCheckTransaction(const CTransaction& tx, CValidationState &state, int nHeight, int dosLevel);
|
bool ContextualCheckTransaction(const CTransaction& tx, CValidationState &state, int nHeight, int dosLevel);
|
||||||
|
|
||||||
/** Apply the effects of this transaction on the UTXO set represented by view */
|
/** 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 */
|
/** Context-independent validity checks */
|
||||||
bool CheckTransaction(const CTransaction& tx, CValidationState& state, libzcash::ProofVerifier& verifier);
|
bool CheckTransaction(const CTransaction& tx, CValidationState& state, libzcash::ProofVerifier& verifier);
|
||||||
|
|||||||
@@ -296,7 +296,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn)
|
|||||||
if (!ContextualCheckInputs(tx, state, view, true, MANDATORY_SCRIPT_VERIFY_FLAGS, true, Params().GetConsensus()))
|
if (!ContextualCheckInputs(tx, state, view, true, MANDATORY_SCRIPT_VERIFY_FLAGS, true, Params().GetConsensus()))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
UpdateCoins(tx, state, view, nHeight);
|
UpdateCoins(tx, view, nHeight);
|
||||||
|
|
||||||
// Added
|
// Added
|
||||||
pblock->vtx.push_back(tx);
|
pblock->vtx.push_back(tx);
|
||||||
|
|||||||
@@ -745,7 +745,7 @@ BOOST_AUTO_TEST_CASE(coins_coinbase_spends)
|
|||||||
BOOST_CHECK(tx.IsCoinBase());
|
BOOST_CHECK(tx.IsCoinBase());
|
||||||
|
|
||||||
CValidationState state;
|
CValidationState state;
|
||||||
UpdateCoins(tx, state, cache, 100);
|
UpdateCoins(tx, cache, 100);
|
||||||
|
|
||||||
// Create coinbase spend
|
// Create coinbase spend
|
||||||
CMutableTransaction mtx2;
|
CMutableTransaction mtx2;
|
||||||
|
|||||||
@@ -384,7 +384,7 @@ void CTxMemPool::check(const CCoinsViewCache *pcoins) const
|
|||||||
else {
|
else {
|
||||||
CValidationState state;
|
CValidationState state;
|
||||||
assert(ContextualCheckInputs(tx, state, mempoolDuplicate, false, 0, false, Params().GetConsensus(), NULL));
|
assert(ContextualCheckInputs(tx, state, mempoolDuplicate, false, 0, false, Params().GetConsensus(), NULL));
|
||||||
UpdateCoins(tx, state, mempoolDuplicate, 1000000);
|
UpdateCoins(tx, mempoolDuplicate, 1000000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
unsigned int stepsSinceLastRemove = 0;
|
unsigned int stepsSinceLastRemove = 0;
|
||||||
@@ -398,7 +398,7 @@ void CTxMemPool::check(const CCoinsViewCache *pcoins) const
|
|||||||
assert(stepsSinceLastRemove < waitingOnDependants.size());
|
assert(stepsSinceLastRemove < waitingOnDependants.size());
|
||||||
} else {
|
} else {
|
||||||
assert(ContextualCheckInputs(entry->GetTx(), state, mempoolDuplicate, false, 0, false, Params().GetConsensus(), NULL));
|
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;
|
stepsSinceLastRemove = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user