MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / WriteBatchSync

Method WriteBatchSync

src/node/blockstorage.cpp:92–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90}
91
92void BlockTreeDB::WriteBatchSync(const std::vector<std::pair<int, const CBlockFileInfo*>>& fileInfo, int nLastFile, const std::vector<const CBlockIndex*>& blockinfo)
93{
94 CDBBatch batch(*this);
95 for (const auto& [file, info] : fileInfo) {
96 batch.Write(std::make_pair(DB_BLOCK_FILES, file), *info);
97 }
98 batch.Write(DB_LAST_BLOCK, nLastFile);
99 for (const CBlockIndex* bi : blockinfo) {
100 batch.Write(std::make_pair(DB_BLOCK_INDEX, bi->GetBlockHash()), CDiskBlockIndex{bi});
101 }
102 WriteBatch(batch, true);
103}
104
105void BlockTreeDB::WriteFlag(const std::string& name, bool fValue)
106{

Callers 2

block_index.cppFile · 0.80
WriteBlockIndexDBMethod · 0.80

Calls 3

WriteBatchClass · 0.50
WriteMethod · 0.45
GetBlockHashMethod · 0.45

Tested by

no test coverage detected