aboutsummaryrefslogtreecommitdiff
path: root/src/coins.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2015-01-07 13:03:21 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2015-01-07 13:03:41 +0100
commit7625f7ff943807288eec37c0a54334b21a98d84c (patch)
treeb6c34a7968b1dd4834cd4a5be87eda13d392ecd6 /src/coins.cpp
parentd79adc1ab18f897ab02da93e48c74ee2f44dce7a (diff)
parente41345790f1041f5c5e5605d73a0af174769aa55 (diff)
Merge pull request #5597
e413457 Catch LevelDB errors during flush (Pieter Wuille) 02bced1 Bugfix: only track UTXO modification after lookup (Pieter Wuille)
Diffstat (limited to 'src/coins.cpp')
-rw-r--r--src/coins.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/coins.cpp b/src/coins.cpp
index ef4f96fdee..d79e29951b 100644
--- a/src/coins.cpp
+++ b/src/coins.cpp
@@ -92,7 +92,6 @@ bool CCoinsViewCache::GetCoins(const uint256 &txid, CCoins &coins) const {
CCoinsModifier CCoinsViewCache::ModifyCoins(const uint256 &txid) {
assert(!hasModifier);
- hasModifier = true;
std::pair<CCoinsMap::iterator, bool> ret = cacheCoins.insert(std::make_pair(txid, CCoinsCacheEntry()));
if (ret.second) {
if (!base->GetCoins(txid, ret.first->second.coins)) {
@@ -233,7 +232,10 @@ double CCoinsViewCache::GetPriority(const CTransaction &tx, int nHeight) const
return tx.ComputePriority(dResult);
}
-CCoinsModifier::CCoinsModifier(CCoinsViewCache& cache_, CCoinsMap::iterator it_) : cache(cache_), it(it_) {}
+CCoinsModifier::CCoinsModifier(CCoinsViewCache& cache_, CCoinsMap::iterator it_) : cache(cache_), it(it_) {
+ assert(!cache.hasModifier);
+ cache.hasModifier = true;
+}
CCoinsModifier::~CCoinsModifier()
{