Bugfix: don't crash by trying to write unchanged best block
This commit is contained in:
parent
bb790aa24d
commit
0b297a614f
1 changed files with 2 additions and 1 deletions
|
@ -58,7 +58,8 @@ bool CCoinsViewDB::BatchWrite(const std::map<uint256, CCoins> &mapCoins, CBlockI
|
|||
CLevelDBBatch batch;
|
||||
for (std::map<uint256, CCoins>::const_iterator it = mapCoins.begin(); it != mapCoins.end(); it++)
|
||||
BatchWriteCoins(batch, it->first, it->second);
|
||||
BatchWriteHashBestChain(batch, pindex->GetBlockHash());
|
||||
if (pindex)
|
||||
BatchWriteHashBestChain(batch, pindex->GetBlockHash());
|
||||
|
||||
return db.WriteBatch(batch);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue