aboutsummaryrefslogtreecommitdiff
path: root/src/index
diff options
context:
space:
mode:
authorFabian Jahr <fjahr@protonmail.com>2021-05-24 01:18:51 +0200
committerFabian Jahr <fjahr@protonmail.com>2021-06-03 01:49:59 +0200
commit1e3842385b8c0d15086c7cd8736f8c67e6c0c285 (patch)
treef328e73e233bb4a6301f52149adeac05245fb28b /src/index
parentfb65dde147f63422c4148b089c2f5be0bf5ba80f (diff)
downloadbitcoin-1e3842385b8c0d15086c7cd8736f8c67e6c0c285.tar.xz
index: Use batch writing in coinstatsindex WriteBlock
Diffstat (limited to 'src/index')
-rw-r--r--src/index/coinstatsindex.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/index/coinstatsindex.cpp b/src/index/coinstatsindex.cpp
index cb940234e2..084e6b9925 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,