Skip to content

Commit 1e38423

Browse files
committed
index: Use batch writing in coinstatsindex WriteBlock
1 parent fb65dde commit 1e38423

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/index/coinstatsindex.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,10 @@ bool CoinStatsIndex::WriteBlock(const CBlock& block, const CBlockIndex* pindex)
219219
m_muhash.Finalize(out);
220220
value.second.muhash = out;
221221

222-
return m_db->Write(DBHeightKey(pindex->nHeight), value) && m_db->Write(DB_MUHASH, m_muhash);
222+
CDBBatch batch(*m_db);
223+
batch.Write(DBHeightKey(pindex->nHeight), value);
224+
batch.Write(DB_MUHASH, m_muhash);
225+
return m_db->WriteBatch(batch);
223226
}
224227

225228
static bool CopyHeightIndexToHashIndex(CDBIterator& db_it, CDBBatch& batch,

0 commit comments

Comments
 (0)