mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 23:29:12 +01:00
Merge pull request #6932
1cf3dd8Add unit test for UpdateCoins (Alex Morcos)03c8282Make CCoinsViewTest behave like CCoinsViewDB (Alex Morcos)14470f9ModifyNewCoins saves database lookups (Alex Morcos)
This commit is contained in:
13
src/main.cpp
13
src/main.cpp
@@ -1310,10 +1310,17 @@ void UpdateCoins(const CTransaction& tx, CValidationState &state, CCoinsViewCach
|
||||
undo.nVersion = coins->nVersion;
|
||||
}
|
||||
}
|
||||
// add outputs
|
||||
inputs.ModifyNewCoins(tx.GetHash())->FromTx(tx, nHeight);
|
||||
}
|
||||
else {
|
||||
// add outputs for coinbase tx
|
||||
// In this case call the full ModifyCoins which will do a database
|
||||
// lookup to be sure the coins do not already exist otherwise we do not
|
||||
// know whether to mark them fresh or not. We want the duplicate coinbases
|
||||
// before BIP30 to still be properly overwritten.
|
||||
inputs.ModifyCoins(tx.GetHash())->FromTx(tx, nHeight);
|
||||
}
|
||||
|
||||
// add outputs
|
||||
inputs.ModifyCoins(tx.GetHash())->FromTx(tx, nHeight);
|
||||
}
|
||||
|
||||
void UpdateCoins(const CTransaction& tx, CValidationState &state, CCoinsViewCache &inputs, int nHeight)
|
||||
|
||||
Reference in New Issue
Block a user