aboutsummaryrefslogtreecommitdiff
path: root/src/init.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2012-10-25 20:47:11 +0200
committerPieter Wuille <pieter.wuille@gmail.com>2012-10-25 20:47:17 +0200
commitbb790aa24d4224717c1269cbc2f508eeefaacad1 (patch)
tree74deb666a804a45426c024603d692dca6b8fa4d8 /src/init.cpp
parent3026baaa7c3fbd33f7208dbc0e426ae33a78bf73 (diff)
downloadbitcoin-bb790aa24d4224717c1269cbc2f508eeefaacad1.tar.xz
First flush block tree, then coin set
As the coinset data refers to the best block, stored in the block tree. Flushing the coin set first can cause inconsistencies if the process gets killed in between.
Diffstat (limited to 'src/init.cpp')
-rw-r--r--src/init.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/init.cpp b/src/init.cpp
index d9b892c659..1724382bf5 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -78,10 +78,10 @@ void Shutdown(void* parg)
StopNode();
{
LOCK(cs_main);
- if (pcoinsTip)
- pcoinsTip->Flush();
if (pblocktree)
pblocktree->Flush();
+ if (pcoinsTip)
+ pcoinsTip->Flush();
delete pcoinsTip;
delete pcoinsdbview;
delete pblocktree;