From 1e3842385b8c0d15086c7cd8736f8c67e6c0c285 Mon Sep 17 00:00:00 2001 From: Fabian Jahr Date: Mon, 24 May 2021 01:18:51 +0200 Subject: [PATCH] index: Use batch writing in coinstatsindex WriteBlock --- src/index/coinstatsindex.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/index/coinstatsindex.cpp b/src/index/coinstatsindex.cpp index cb940234e20..084e6b9925a 100644 --- a/src/index/coinstatsindex.cpp +++ b/src/index/coinstatsindex.cpp @@ -219,7 +219,10 @@ bool CoinStatsIndex::WriteBlock(const CBlock& block, const CBlockIndex* pindex) m_muhash.Finalize(out); value.second.muhash = out; - return m_db->Write(DBHeightKey(pindex->nHeight), value) && m_db->Write(DB_MUHASH, m_muhash); + CDBBatch batch(*m_db); + batch.Write(DBHeightKey(pindex->nHeight), value); + batch.Write(DB_MUHASH, m_muhash); + return m_db->WriteBatch(batch); } static bool CopyHeightIndexToHashIndex(CDBIterator& db_it, CDBBatch& batch,