@@ -78,7 +78,7 @@ bool BlockTreeDB::ReadLastBlockFile(int& nFile)
7878 return Read (DB_LAST_BLOCK, nFile);
7979}
8080
81- bool BlockTreeDB::WriteBatchSync (const std::vector<std::pair<int , const CBlockFileInfo*>>& fileInfo, int nLastFile, const std::vector<const CBlockIndex*>& blockinfo)
81+ void BlockTreeDB::WriteBatchSync (const std::vector<std::pair<int , const CBlockFileInfo*>>& fileInfo, int nLastFile, const std::vector<const CBlockIndex*>& blockinfo)
8282{
8383 CDBBatch batch (*this );
8484 for (const auto & [file, info] : fileInfo) {
@@ -89,13 +89,11 @@ bool BlockTreeDB::WriteBatchSync(const std::vector<std::pair<int, const CBlockFi
8989 batch.Write (std::make_pair (DB_BLOCK_INDEX, bi->GetBlockHash ()), CDiskBlockIndex{bi});
9090 }
9191 WriteBatch (batch, true );
92- return true ;
9392}
9493
95- bool BlockTreeDB::WriteFlag (const std::string& name, bool fValue )
94+ void BlockTreeDB::WriteFlag (const std::string& name, bool fValue )
9695{
9796 Write (std::make_pair (DB_FLAG, name), fValue ? uint8_t {' 1' } : uint8_t {' 0' });
98- return true ;
9997}
10098
10199bool BlockTreeDB::ReadFlag (const std::string& name, bool & fValue )
@@ -478,7 +476,7 @@ bool BlockManager::LoadBlockIndex(const std::optional<uint256>& snapshot_blockha
478476 return true ;
479477}
480478
481- bool BlockManager::WriteBlockIndexDB ()
479+ void BlockManager::WriteBlockIndexDB ()
482480{
483481 AssertLockHeld (::cs_main);
484482 std::vector<std::pair<int , const CBlockFileInfo*>> vFiles;
@@ -494,10 +492,7 @@ bool BlockManager::WriteBlockIndexDB()
494492 m_dirty_blockindex.erase (it++);
495493 }
496494 int max_blockfile = WITH_LOCK (cs_LastBlockFile, return this ->MaxBlockfileNum ());
497- if (!m_block_tree_db->WriteBatchSync (vFiles, max_blockfile, vBlocks)) {
498- return false ;
499- }
500- return true ;
495+ m_block_tree_db->WriteBatchSync (vFiles, max_blockfile, vBlocks);
501496}
502497
503498bool BlockManager::LoadBlockIndexDB (const std::optional<uint256>& snapshot_blockhash)
0 commit comments