From 33dfbf57d34882aef7b83bc5ea9bf561e1f3e7b0 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Tue, 21 Oct 2014 16:08:20 +0200 Subject: rpc: Fix leveldb iterator leak, and flush before `gettxoutsetinfo` This fixes an iterator leak resulting in bitcoind: db/version_set.cc:789: leveldb::VersionSet::~VersionSet(): Assertion `dummy_versions_.next_ == &dummy_versions_' failed." exception on shutdown. Also make sure to flush pcoinsTip before calling GetStats() to make sure we apply them to the current height. --- src/rpcblockchain.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/rpcblockchain.cpp') diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index 5beac0512a..b0da1d6a5c 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -319,6 +319,7 @@ Value gettxoutsetinfo(const Array& params, bool fHelp) Object ret; CCoinsStats stats; + pcoinsTip->Flush(); if (pcoinsTip->GetStats(stats)) { ret.push_back(Pair("height", (int64_t)stats.nHeight)); ret.push_back(Pair("bestblock", stats.hashBlock.GetHex())); -- cgit v1.2.3