| 90 | } |
| 91 | |
| 92 | void 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 | |
| 105 | void BlockTreeDB::WriteFlag(const std::string& name, bool fValue) |
| 106 | { |
no test coverage detected