mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-24 07:51:24 +02:00
index: Use batch writing in coinstatsindex WriteBlock
This commit is contained in:
parent
fb65dde147
commit
1e3842385b
@ -219,7 +219,10 @@ bool CoinStatsIndex::WriteBlock(const CBlock& block, const CBlockIndex* pindex)
|
|||||||
m_muhash.Finalize(out);
|
m_muhash.Finalize(out);
|
||||||
value.second.muhash = 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,
|
static bool CopyHeightIndexToHashIndex(CDBIterator& db_it, CDBBatch& batch,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user