diff options
| author | Pieter Wuille <[email protected]> | 2012-10-30 13:53:11 -0700 |
|---|---|---|
| committer | Pieter Wuille <[email protected]> | 2012-10-30 13:53:11 -0700 |
| commit | 41db7c224a6a272c5f6fe70e17d28219fa9d66d9 (patch) | |
| tree | ca3b00ba2f0b4bb636238c7f2bc776e8450b54a3 /src/txdb.cpp | |
| parent | Merge pull request #1967 from TheBlueMatt/leveldbmakefile (diff) | |
| parent | Bugfix: don't crash by trying to write unchanged best block (diff) | |
| download | discoin-41db7c224a6a272c5f6fe70e17d28219fa9d66d9.tar.xz discoin-41db7c224a6a272c5f6fe70e17d28219fa9d66d9.zip | |
Merge pull request #1963 from sipa/bugfix_nonewblock
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); } |