diff options
author | TheCharlatan <seb.kung@gmail.com> | 2023-05-14 19:21:50 +0200 |
---|---|---|
committer | TheCharlatan <seb.kung@gmail.com> | 2023-06-28 09:52:30 +0200 |
commit | 3fa9094b92c5d37f486b0f8265062d3456796a50 (patch) | |
tree | 43b48e3e5529b7caa097af20580b29c9a75c44cd /src/index | |
parent | edb55e2777063dfeba0a52bbd0b92af8b4688501 (diff) |
scripted-diff: Rename FatalError to FatalErrorf
This is done in preparation for the next commit where a new FatalError
function is introduced. FatalErrorf follows common convention to append
'f' for functions accepting format arguments.
-BEGIN VERIFY SCRIPT-
sed -i 's/FatalError/FatalErrorf/g' $( git grep -l 'FatalError')
-END VERIFY SCRIPT-
Diffstat (limited to 'src/index')
-rw-r--r-- | src/index/base.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/index/base.cpp b/src/index/base.cpp index ec23cc1247..99c33d53ba 100644 --- a/src/index/base.cpp +++ b/src/index/base.cpp @@ -30,7 +30,7 @@ constexpr auto SYNC_LOG_INTERVAL{30s}; constexpr auto SYNC_LOCATOR_WRITE_INTERVAL{30s}; template <typename... Args> -static void FatalError(const char* fmt, const Args&... args) +static void FatalErrorf(const char* fmt, const Args&... args) { AbortNode(tfm::format(fmt, args...)); } @@ -197,7 +197,7 @@ void BaseIndex::ThreadSync() break; } if (pindex_next->pprev != pindex && !Rewind(pindex, pindex_next->pprev)) { - FatalError("%s: Failed to rewind index %s to a previous chain tip", + FatalErrorf("%s: Failed to rewind index %s to a previous chain tip", __func__, GetName()); return; } @@ -221,14 +221,14 @@ void BaseIndex::ThreadSync() CBlock block; interfaces::BlockInfo block_info = kernel::MakeBlockInfo(pindex); if (!m_chainstate->m_blockman.ReadBlockFromDisk(block, *pindex)) { - FatalError("%s: Failed to read block %s from disk", + FatalErrorf("%s: Failed to read block %s from disk", __func__, pindex->GetBlockHash().ToString()); return; } else { block_info.data = █ } if (!CustomAppend(block_info)) { - FatalError("%s: Failed to write block %s to index database", + FatalErrorf("%s: Failed to write block %s to index database", __func__, pindex->GetBlockHash().ToString()); return; } @@ -294,7 +294,7 @@ void BaseIndex::BlockConnected(const std::shared_ptr<const CBlock>& block, const const CBlockIndex* best_block_index = m_best_block_index.load(); if (!best_block_index) { if (pindex->nHeight != 0) { - FatalError("%s: First block connected is not the genesis block (height=%d)", + FatalErrorf("%s: First block connected is not the genesis block (height=%d)", __func__, pindex->nHeight); return; } @@ -312,7 +312,7 @@ void BaseIndex::BlockConnected(const std::shared_ptr<const CBlock>& block, const return; } if (best_block_index != pindex->pprev && !Rewind(best_block_index, pindex->pprev)) { - FatalError("%s: Failed to rewind index %s to a previous chain tip", + FatalErrorf("%s: Failed to rewind index %s to a previous chain tip", __func__, GetName()); return; } @@ -325,7 +325,7 @@ void BaseIndex::BlockConnected(const std::shared_ptr<const CBlock>& block, const // processed, and the index object being safe to delete. SetBestBlockIndex(pindex); } else { - FatalError("%s: Failed to write block %s to index", + FatalErrorf("%s: Failed to write block %s to index", __func__, pindex->GetBlockHash().ToString()); return; } @@ -345,7 +345,7 @@ void BaseIndex::ChainStateFlushed(const CBlockLocator& locator) } if (!locator_tip_index) { - FatalError("%s: First block (hash=%s) in locator was not found", + FatalErrorf("%s: First block (hash=%s) in locator was not found", __func__, locator_tip_hash.ToString()); return; } |