diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2016-01-22 14:15:45 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2016-01-22 14:15:52 +0100 |
commit | 6a0720838873c7e13a936a74349147b954e50255 (patch) | |
tree | 5e71531ba72eff2133b29baa1415aa84278f8aba /src/main.cpp | |
parent | 93b05764d5e4c6a4a5f11bfe70942baf9eaa0076 (diff) | |
parent | 8504867b146014c99c6acb180020a1369069c761 (diff) |
Merge #7056: Save last db read
8504867 Save the last unnecessary database read (Alex Morcos)
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/main.cpp b/src/main.cpp index 8522b0d1ba..c8ea62758b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1546,17 +1546,9 @@ 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.ModifyNewCoins(tx.GetHash(), tx.IsCoinBase())->FromTx(tx, nHeight); } void UpdateCoins(const CTransaction& tx, CValidationState &state, CCoinsViewCache &inputs, int nHeight) |