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-
This commit is contained in:
3 files changed
+10
-10
No files matched your search
+8
-8
@@ -30,7 +30,7 @@ constexpr auto SYNC_LOG_INTERVAL{30s};
|
|||||||
constexpr auto SYNC_LOCATOR_WRITE_INTERVAL{30s};
|
constexpr auto SYNC_LOCATOR_WRITE_INTERVAL{30s};
|
||||||
|
|
||||||
template <typename... Args>
|
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...));
|
AbortNode(tfm::format(fmt, args...));
|
||||||
}
|
}
|
||||||
@@ -197,7 +197,7 @@ void BaseIndex::ThreadSync()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (pindex_next->pprev != pindex && !Rewind(pindex, pindex_next->pprev)) {
|
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());
|
__func__, GetName());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -221,14 +221,14 @@ void BaseIndex::ThreadSync()
|
|||||||
CBlock block;
|
CBlock block;
|
||||||
interfaces::BlockInfo block_info = kernel::MakeBlockInfo(pindex);
|
interfaces::BlockInfo block_info = kernel::MakeBlockInfo(pindex);
|
||||||
if (!m_chainstate->m_blockman.ReadBlockFromDisk(block, *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());
|
__func__, pindex->GetBlockHash().ToString());
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
block_info.data = █
|
block_info.data = █
|
||||||
}
|
}
|
||||||
if (!CustomAppend(block_info)) {
|
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());
|
__func__, pindex->GetBlockHash().ToString());
|
||||||
return;
|
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();
|
const CBlockIndex* best_block_index = m_best_block_index.load();
|
||||||
if (!best_block_index) {
|
if (!best_block_index) {
|
||||||
if (pindex->nHeight != 0) {
|
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);
|
__func__, pindex->nHeight);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -312,7 +312,7 @@ void BaseIndex::BlockConnected(const std::shared_ptr<const CBlock>& block, const
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (best_block_index != pindex->pprev && !Rewind(best_block_index, pindex->pprev)) {
|
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());
|
__func__, GetName());
|
||||||
return;
|
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.
|
// processed, and the index object being safe to delete.
|
||||||
SetBestBlockIndex(pindex);
|
SetBestBlockIndex(pindex);
|
||||||
} else {
|
} else {
|
||||||
FatalError("%s: Failed to write block %s to index",
|
FatalErrorf("%s: Failed to write block %s to index",
|
||||||
__func__, pindex->GetBlockHash().ToString());
|
__func__, pindex->GetBlockHash().ToString());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -345,7 +345,7 @@ void BaseIndex::ChainStateFlushed(const CBlockLocator& locator)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!locator_tip_index) {
|
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());
|
__func__, locator_tip_hash.ToString());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import re
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
FUNCTION_NAMES_AND_NUMBER_OF_LEADING_ARGUMENTS = [
|
FUNCTION_NAMES_AND_NUMBER_OF_LEADING_ARGUMENTS = [
|
||||||
'FatalError,0',
|
'FatalErrorf,0',
|
||||||
'fprintf,1',
|
'fprintf,1',
|
||||||
'tfm::format,1', # Assuming tfm::::format(std::ostream&, ...
|
'tfm::format,1', # Assuming tfm::::format(std::ostream&, ...
|
||||||
'LogConnectFailure,1',
|
'LogConnectFailure,1',
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import sys
|
|||||||
|
|
||||||
FALSE_POSITIVES = [
|
FALSE_POSITIVES = [
|
||||||
("src/dbwrapper.cpp", "vsnprintf(p, limit - p, format, backup_ap)"),
|
("src/dbwrapper.cpp", "vsnprintf(p, limit - p, format, backup_ap)"),
|
||||||
("src/index/base.cpp", "FatalError(const char* fmt, const Args&... args)"),
|
("src/index/base.cpp", "FatalErrorf(const char* fmt, const Args&... args)"),
|
||||||
("src/netbase.cpp", "LogConnectFailure(bool manual_connection, const char* fmt, const Args&... args)"),
|
("src/netbase.cpp", "LogConnectFailure(bool manual_connection, const char* fmt, const Args&... args)"),
|
||||||
("src/clientversion.cpp", "strprintf(_(COPYRIGHT_HOLDERS).translated, COPYRIGHT_HOLDERS_SUBSTITUTION)"),
|
("src/clientversion.cpp", "strprintf(_(COPYRIGHT_HOLDERS).translated, COPYRIGHT_HOLDERS_SUBSTITUTION)"),
|
||||||
("src/test/translation_tests.cpp", "strprintf(format, arg)"),
|
("src/test/translation_tests.cpp", "strprintf(format, arg)"),
|
||||||
|
|||||||
Reference in new issue
Block a user