From bb790aa24d4224717c1269cbc2f508eeefaacad1 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Thu, 25 Oct 2012 20:47:11 +0200 Subject: [PATCH] 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. --- src/init.cpp | 4 ++-- 1 file 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;