diff options
| author | Pieter Wuille <[email protected]> | 2012-10-28 19:14:51 +0100 |
|---|---|---|
| committer | Pieter Wuille <[email protected]> | 2012-10-28 19:14:51 +0100 |
| commit | 0b297a614f80214dbd826fe5af92b4eaa60911bb (patch) | |
| tree | f264f83218c3f77d5af4ba928ac2ded48daeaf63 /src/txdb.cpp | |
| parent | First flush block tree, then coin set (diff) | |
| download | discoin-0b297a614f80214dbd826fe5af92b4eaa60911bb.tar.xz discoin-0b297a614f80214dbd826fe5af92b4eaa60911bb.zip | |
Bugfix: don't crash by trying to write unchanged best block
Diffstat (limited to 'src/txdb.cpp')
| -rw-r--r-- | src/txdb.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/txdb.cpp b/src/txdb.cpp index 67d15cb58..6550f5787 100644 --- a/src/txdb.cpp +++ b/src/txdb.cpp @@ -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); } |