log: Use LogError for fatal errors
This commit is contained in:
10 files changed
+46
-46
No files matched your search
+1
-1
@@ -1055,7 +1055,7 @@ void AddrManImpl::Check() const
|
|||||||
|
|
||||||
const int err{CheckAddrman()};
|
const int err{CheckAddrman()};
|
||||||
if (err) {
|
if (err) {
|
||||||
LogPrintf("ADDRMAN CONSISTENCY CHECK FAILED!!! err=%i\n", err);
|
LogError("ADDRMAN CONSISTENCY CHECK FAILED!!! err=%i", err);
|
||||||
assert(false);
|
assert(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-4
@@ -47,8 +47,8 @@ static void HandleError(const leveldb::Status& status)
|
|||||||
if (status.ok())
|
if (status.ok())
|
||||||
return;
|
return;
|
||||||
const std::string errmsg = "Fatal LevelDB error: " + status.ToString();
|
const std::string errmsg = "Fatal LevelDB error: " + status.ToString();
|
||||||
LogPrintf("%s\n", errmsg);
|
LogError("%s", errmsg);
|
||||||
LogPrintf("You can use -debug=leveldb to get more complete diagnostic messages\n");
|
LogInfo("You can use -debug=leveldb to get more complete diagnostic messages");
|
||||||
throw dbwrapper_error(errmsg);
|
throw dbwrapper_error(errmsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -309,7 +309,7 @@ std::optional<std::string> CDBWrapper::ReadImpl(std::span<const std::byte> key)
|
|||||||
if (!status.ok()) {
|
if (!status.ok()) {
|
||||||
if (status.IsNotFound())
|
if (status.IsNotFound())
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
LogPrintf("LevelDB read failure: %s\n", status.ToString());
|
LogError("LevelDB read failure: %s", status.ToString());
|
||||||
HandleError(status);
|
HandleError(status);
|
||||||
}
|
}
|
||||||
return strValue;
|
return strValue;
|
||||||
@@ -324,7 +324,7 @@ bool CDBWrapper::ExistsImpl(std::span<const std::byte> key) const
|
|||||||
if (!status.ok()) {
|
if (!status.ok()) {
|
||||||
if (status.IsNotFound())
|
if (status.IsNotFound())
|
||||||
return false;
|
return false;
|
||||||
LogPrintf("LevelDB read failure: %s\n", status.ToString());
|
LogError("LevelDB read failure: %s", status.ToString());
|
||||||
HandleError(status);
|
HandleError(status);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
+2
-2
@@ -41,11 +41,11 @@ FILE* FlatFileSeq::Open(const FlatFilePos& pos, bool read_only) const
|
|||||||
if (!file && !read_only)
|
if (!file && !read_only)
|
||||||
file = fsbridge::fopen(path, "wb+");
|
file = fsbridge::fopen(path, "wb+");
|
||||||
if (!file) {
|
if (!file) {
|
||||||
LogPrintf("Unable to open file %s\n", fs::PathToString(path));
|
LogError("Unable to open file %s", fs::PathToString(path));
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
if (pos.nPos && fseek(file, pos.nPos, SEEK_SET)) {
|
if (pos.nPos && fseek(file, pos.nPos, SEEK_SET)) {
|
||||||
LogPrintf("Unable to seek to position %u of %s\n", pos.nPos, fs::PathToString(path));
|
LogError("Unable to seek to position %u of %s", pos.nPos, fs::PathToString(path));
|
||||||
if (fclose(file) != 0) {
|
if (fclose(file) != 0) {
|
||||||
LogError("Unable to close file %s", fs::PathToString(path));
|
LogError("Unable to close file %s", fs::PathToString(path));
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -462,7 +462,7 @@ bool InitHTTPServer(const util::SignalInterrupt& interrupt)
|
|||||||
raii_evhttp http_ctr = obtain_evhttp(base_ctr.get());
|
raii_evhttp http_ctr = obtain_evhttp(base_ctr.get());
|
||||||
struct evhttp* http = http_ctr.get();
|
struct evhttp* http = http_ctr.get();
|
||||||
if (!http) {
|
if (!http) {
|
||||||
LogPrintf("couldn't create evhttp. Exiting.\n");
|
LogError("Couldn't create evhttp. Exiting.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -472,7 +472,7 @@ bool InitHTTPServer(const util::SignalInterrupt& interrupt)
|
|||||||
evhttp_set_gencb(http, http_request_cb, (void*)&interrupt);
|
evhttp_set_gencb(http, http_request_cb, (void*)&interrupt);
|
||||||
|
|
||||||
if (!HTTPBindAddresses(http)) {
|
if (!HTTPBindAddresses(http)) {
|
||||||
LogPrintf("Unable to bind any endpoint for RPC server\n");
|
LogError("Unable to bind any endpoint for RPC server");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,14 +32,14 @@ bool WriteSnapshotBaseBlockhash(Chainstate& snapshot_chainstate)
|
|||||||
FILE* file{fsbridge::fopen(write_to, "wb")};
|
FILE* file{fsbridge::fopen(write_to, "wb")};
|
||||||
AutoFile afile{file};
|
AutoFile afile{file};
|
||||||
if (afile.IsNull()) {
|
if (afile.IsNull()) {
|
||||||
LogPrintf("[snapshot] failed to open base blockhash file for writing: %s\n",
|
LogError("[snapshot] failed to open base blockhash file for writing: %s",
|
||||||
fs::PathToString(write_to));
|
fs::PathToString(write_to));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
afile << *snapshot_chainstate.m_from_snapshot_blockhash;
|
afile << *snapshot_chainstate.m_from_snapshot_blockhash;
|
||||||
|
|
||||||
if (afile.fclose() != 0) {
|
if (afile.fclose() != 0) {
|
||||||
LogPrintf("[snapshot] failed to close base blockhash file %s after writing\n",
|
LogError("[snapshot] failed to close base blockhash file %s after writing",
|
||||||
fs::PathToString(write_to));
|
fs::PathToString(write_to));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
+11
-11
@@ -90,8 +90,8 @@ LockData& GetLockData() {
|
|||||||
|
|
||||||
static void potential_deadlock_detected(const LockPair& mismatch, const LockStack& s1, const LockStack& s2)
|
static void potential_deadlock_detected(const LockPair& mismatch, const LockStack& s1, const LockStack& s2)
|
||||||
{
|
{
|
||||||
LogPrintf("POTENTIAL DEADLOCK DETECTED\n");
|
LogError("POTENTIAL DEADLOCK DETECTED");
|
||||||
LogPrintf("Previous lock order was:\n");
|
LogError("Previous lock order was:");
|
||||||
for (const LockStackItem& i : s1) {
|
for (const LockStackItem& i : s1) {
|
||||||
std::string prefix{};
|
std::string prefix{};
|
||||||
if (i.first == mismatch.first) {
|
if (i.first == mismatch.first) {
|
||||||
@@ -100,11 +100,11 @@ static void potential_deadlock_detected(const LockPair& mismatch, const LockStac
|
|||||||
if (i.first == mismatch.second) {
|
if (i.first == mismatch.second) {
|
||||||
prefix = " (2)";
|
prefix = " (2)";
|
||||||
}
|
}
|
||||||
LogPrintf("%s %s\n", prefix, i.second.ToString());
|
LogError("%s %s", prefix, i.second.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string mutex_a, mutex_b;
|
std::string mutex_a, mutex_b;
|
||||||
LogPrintf("Current lock order is:\n");
|
LogError("Current lock order is:");
|
||||||
for (const LockStackItem& i : s2) {
|
for (const LockStackItem& i : s2) {
|
||||||
std::string prefix{};
|
std::string prefix{};
|
||||||
if (i.first == mismatch.first) {
|
if (i.first == mismatch.first) {
|
||||||
@@ -115,7 +115,7 @@ static void potential_deadlock_detected(const LockPair& mismatch, const LockStac
|
|||||||
prefix = " (2)";
|
prefix = " (2)";
|
||||||
mutex_b = i.second.Name();
|
mutex_b = i.second.Name();
|
||||||
}
|
}
|
||||||
LogPrintf("%s %s\n", prefix, i.second.ToString());
|
LogError("%s %s", prefix, i.second.ToString());
|
||||||
}
|
}
|
||||||
if (g_debug_lockorder_abort) {
|
if (g_debug_lockorder_abort) {
|
||||||
tfm::format(std::cerr, "Assertion failed: detected inconsistent lock order for %s, details in debug log.\n", s2.back().second.ToString());
|
tfm::format(std::cerr, "Assertion failed: detected inconsistent lock order for %s, details in debug log.\n", s2.back().second.ToString());
|
||||||
@@ -126,14 +126,14 @@ static void potential_deadlock_detected(const LockPair& mismatch, const LockStac
|
|||||||
|
|
||||||
static void double_lock_detected(const void* mutex, const LockStack& lock_stack)
|
static void double_lock_detected(const void* mutex, const LockStack& lock_stack)
|
||||||
{
|
{
|
||||||
LogPrintf("DOUBLE LOCK DETECTED\n");
|
LogError("DOUBLE LOCK DETECTED");
|
||||||
LogPrintf("Lock order:\n");
|
LogError("Lock order:");
|
||||||
for (const LockStackItem& i : lock_stack) {
|
for (const LockStackItem& i : lock_stack) {
|
||||||
std::string prefix{};
|
std::string prefix{};
|
||||||
if (i.first == mutex) {
|
if (i.first == mutex) {
|
||||||
prefix = " (*)";
|
prefix = " (*)";
|
||||||
}
|
}
|
||||||
LogPrintf("%s %s\n", prefix, i.second.ToString());
|
LogError("%s %s", prefix, i.second.ToString());
|
||||||
}
|
}
|
||||||
if (g_debug_lockorder_abort) {
|
if (g_debug_lockorder_abort) {
|
||||||
tfm::format(std::cerr,
|
tfm::format(std::cerr,
|
||||||
@@ -223,10 +223,10 @@ void CheckLastCritical(void* cs, std::string& lockname, const char* guardname, c
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LogPrintf("INCONSISTENT LOCK ORDER DETECTED\n");
|
LogError("INCONSISTENT LOCK ORDER DETECTED");
|
||||||
LogPrintf("Current lock order (least recent first) is:\n");
|
LogError("Current lock order (least recent first) is:");
|
||||||
for (const LockStackItem& i : lock_stack) {
|
for (const LockStackItem& i : lock_stack) {
|
||||||
LogPrintf(" %s\n", i.second.ToString());
|
LogError(" %s", i.second.ToString());
|
||||||
}
|
}
|
||||||
if (g_debug_lockorder_abort) {
|
if (g_debug_lockorder_abort) {
|
||||||
tfm::format(std::cerr, "%s:%s %s was not most recent critical section locked, details in debug log.\n", file, line, guardname);
|
tfm::format(std::cerr, "%s:%s %s was not most recent critical section locked, details in debug log.\n", file, line, guardname);
|
||||||
|
|||||||
+1
-1
@@ -137,7 +137,7 @@ bool CCoinsViewDB::BatchWrite(CoinsViewCacheCursor& cursor, const uint256 &hashB
|
|||||||
if (m_options.simulate_crash_ratio) {
|
if (m_options.simulate_crash_ratio) {
|
||||||
static FastRandomContext rng;
|
static FastRandomContext rng;
|
||||||
if (rng.randrange(m_options.simulate_crash_ratio) == 0) {
|
if (rng.randrange(m_options.simulate_crash_ratio) == 0) {
|
||||||
LogPrintf("Simulating a crash. Goodbye.\n");
|
LogError("Simulating a crash. Goodbye.");
|
||||||
_Exit(0);
|
_Exit(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -102,28 +102,28 @@ std::streampos GetFileSize(const char* path, std::streamsize max)
|
|||||||
bool FileCommit(FILE* file)
|
bool FileCommit(FILE* file)
|
||||||
{
|
{
|
||||||
if (fflush(file) != 0) { // harmless if redundantly called
|
if (fflush(file) != 0) { // harmless if redundantly called
|
||||||
LogPrintf("fflush failed: %s\n", SysErrorString(errno));
|
LogError("fflush failed: %s", SysErrorString(errno));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
HANDLE hFile = (HANDLE)_get_osfhandle(_fileno(file));
|
HANDLE hFile = (HANDLE)_get_osfhandle(_fileno(file));
|
||||||
if (FlushFileBuffers(hFile) == 0) {
|
if (FlushFileBuffers(hFile) == 0) {
|
||||||
LogPrintf("FlushFileBuffers failed: %s\n", Win32ErrorString(GetLastError()));
|
LogError("FlushFileBuffers failed: %s", Win32ErrorString(GetLastError()));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#elif defined(__APPLE__) && defined(F_FULLFSYNC)
|
#elif defined(__APPLE__) && defined(F_FULLFSYNC)
|
||||||
if (fcntl(fileno(file), F_FULLFSYNC, 0) == -1) { // Manpage says "value other than -1" is returned on success
|
if (fcntl(fileno(file), F_FULLFSYNC, 0) == -1) { // Manpage says "value other than -1" is returned on success
|
||||||
LogPrintf("fcntl F_FULLFSYNC failed: %s\n", SysErrorString(errno));
|
LogError("fcntl F_FULLFSYNC failed: %s", SysErrorString(errno));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#elif HAVE_FDATASYNC
|
#elif HAVE_FDATASYNC
|
||||||
if (fdatasync(fileno(file)) != 0 && errno != EINVAL) { // Ignore EINVAL for filesystems that don't support sync
|
if (fdatasync(fileno(file)) != 0 && errno != EINVAL) { // Ignore EINVAL for filesystems that don't support sync
|
||||||
LogPrintf("fdatasync failed: %s\n", SysErrorString(errno));
|
LogError("fdatasync failed: %s", SysErrorString(errno));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if (fsync(fileno(file)) != 0 && errno != EINVAL) {
|
if (fsync(fileno(file)) != 0 && errno != EINVAL) {
|
||||||
LogPrintf("fsync failed: %s\n", SysErrorString(errno));
|
LogError("fsync failed: %s", SysErrorString(errno));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -235,7 +235,7 @@ fs::path GetSpecialFolderPath(int nFolder, bool fCreate)
|
|||||||
return fs::path(pszPath);
|
return fs::path(pszPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
LogPrintf("SHGetSpecialFolderPathW() failed, could not obtain requested path.\n");
|
LogError("SHGetSpecialFolderPathW() failed, could not obtain requested path.");
|
||||||
return fs::path("");
|
return fs::path("");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+16
-16
@@ -1196,7 +1196,7 @@ bool MemPoolAccept::ConsensusScriptChecks(const ATMPArgs& args, Workspace& ws)
|
|||||||
script_verify_flags currentBlockScriptVerifyFlags{GetBlockScriptFlags(*m_active_chainstate.m_chain.Tip(), m_active_chainstate.m_chainman)};
|
script_verify_flags currentBlockScriptVerifyFlags{GetBlockScriptFlags(*m_active_chainstate.m_chain.Tip(), m_active_chainstate.m_chainman)};
|
||||||
if (!CheckInputsFromMempoolAndCache(tx, state, m_view, m_pool, currentBlockScriptVerifyFlags,
|
if (!CheckInputsFromMempoolAndCache(tx, state, m_view, m_pool, currentBlockScriptVerifyFlags,
|
||||||
ws.m_precomputed_txdata, m_active_chainstate.CoinsTip(), GetValidationCache())) {
|
ws.m_precomputed_txdata, m_active_chainstate.CoinsTip(), GetValidationCache())) {
|
||||||
LogPrintf("BUG! PLEASE REPORT THIS! CheckInputScripts failed against latest-block but not STANDARD flags %s, %s\n", hash.ToString(), state.ToString());
|
LogError("BUG! PLEASE REPORT THIS! CheckInputScripts failed against latest-block but not STANDARD flags %s, %s", hash.ToString(), state.ToString());
|
||||||
return Assume(false);
|
return Assume(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3378,8 +3378,8 @@ bool Chainstate::ActivateBestChain(BlockValidationState& state, std::shared_ptr<
|
|||||||
// Belt-and-suspenders check that we aren't attempting to advance the background
|
// Belt-and-suspenders check that we aren't attempting to advance the background
|
||||||
// chainstate past the snapshot base block.
|
// chainstate past the snapshot base block.
|
||||||
if (WITH_LOCK(::cs_main, return m_disabled)) {
|
if (WITH_LOCK(::cs_main, return m_disabled)) {
|
||||||
LogPrintf("m_disabled is set - this chainstate should not be in operation. "
|
LogError("m_disabled is set - this chainstate should not be in operation. "
|
||||||
"Please report this as a bug. %s\n", CLIENT_BUGREPORT);
|
"Please report this as a bug. %s", CLIENT_BUGREPORT);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4702,12 +4702,12 @@ VerifyDBResult CVerifyDB::VerifyDB(
|
|||||||
CBlock block;
|
CBlock block;
|
||||||
// check level 0: read from disk
|
// check level 0: read from disk
|
||||||
if (!chainstate.m_blockman.ReadBlock(block, *pindex)) {
|
if (!chainstate.m_blockman.ReadBlock(block, *pindex)) {
|
||||||
LogPrintf("Verification error: ReadBlock failed at %d, hash=%s\n", pindex->nHeight, pindex->GetBlockHash().ToString());
|
LogError("Verification error: ReadBlock failed at %d, hash=%s", pindex->nHeight, pindex->GetBlockHash().ToString());
|
||||||
return VerifyDBResult::CORRUPTED_BLOCK_DB;
|
return VerifyDBResult::CORRUPTED_BLOCK_DB;
|
||||||
}
|
}
|
||||||
// check level 1: verify block validity
|
// check level 1: verify block validity
|
||||||
if (nCheckLevel >= 1 && !CheckBlock(block, state, consensus_params)) {
|
if (nCheckLevel >= 1 && !CheckBlock(block, state, consensus_params)) {
|
||||||
LogPrintf("Verification error: found bad block at %d, hash=%s (%s)\n",
|
LogError("Verification error: found bad block at %d, hash=%s (%s)",
|
||||||
pindex->nHeight, pindex->GetBlockHash().ToString(), state.ToString());
|
pindex->nHeight, pindex->GetBlockHash().ToString(), state.ToString());
|
||||||
return VerifyDBResult::CORRUPTED_BLOCK_DB;
|
return VerifyDBResult::CORRUPTED_BLOCK_DB;
|
||||||
}
|
}
|
||||||
@@ -4716,7 +4716,7 @@ VerifyDBResult CVerifyDB::VerifyDB(
|
|||||||
CBlockUndo undo;
|
CBlockUndo undo;
|
||||||
if (!pindex->GetUndoPos().IsNull()) {
|
if (!pindex->GetUndoPos().IsNull()) {
|
||||||
if (!chainstate.m_blockman.ReadBlockUndo(undo, *pindex)) {
|
if (!chainstate.m_blockman.ReadBlockUndo(undo, *pindex)) {
|
||||||
LogPrintf("Verification error: found bad undo data at %d, hash=%s\n", pindex->nHeight, pindex->GetBlockHash().ToString());
|
LogError("Verification error: found bad undo data at %d, hash=%s", pindex->nHeight, pindex->GetBlockHash().ToString());
|
||||||
return VerifyDBResult::CORRUPTED_BLOCK_DB;
|
return VerifyDBResult::CORRUPTED_BLOCK_DB;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4729,7 +4729,7 @@ VerifyDBResult CVerifyDB::VerifyDB(
|
|||||||
assert(coins.GetBestBlock() == pindex->GetBlockHash());
|
assert(coins.GetBestBlock() == pindex->GetBlockHash());
|
||||||
DisconnectResult res = chainstate.DisconnectBlock(block, pindex, coins);
|
DisconnectResult res = chainstate.DisconnectBlock(block, pindex, coins);
|
||||||
if (res == DISCONNECT_FAILED) {
|
if (res == DISCONNECT_FAILED) {
|
||||||
LogPrintf("Verification error: irrecoverable inconsistency in block data at %d, hash=%s\n", pindex->nHeight, pindex->GetBlockHash().ToString());
|
LogError("Verification error: irrecoverable inconsistency in block data at %d, hash=%s", pindex->nHeight, pindex->GetBlockHash().ToString());
|
||||||
return VerifyDBResult::CORRUPTED_BLOCK_DB;
|
return VerifyDBResult::CORRUPTED_BLOCK_DB;
|
||||||
}
|
}
|
||||||
if (res == DISCONNECT_UNCLEAN) {
|
if (res == DISCONNECT_UNCLEAN) {
|
||||||
@@ -4745,7 +4745,7 @@ VerifyDBResult CVerifyDB::VerifyDB(
|
|||||||
if (chainstate.m_chainman.m_interrupt) return VerifyDBResult::INTERRUPTED;
|
if (chainstate.m_chainman.m_interrupt) return VerifyDBResult::INTERRUPTED;
|
||||||
}
|
}
|
||||||
if (pindexFailure) {
|
if (pindexFailure) {
|
||||||
LogPrintf("Verification error: coin database inconsistencies found (last %i blocks, %i good transactions before that)\n", chainstate.m_chain.Height() - pindexFailure->nHeight + 1, nGoodTransactions);
|
LogError("Verification error: coin database inconsistencies found (last %i blocks, %i good transactions before that)", chainstate.m_chain.Height() - pindexFailure->nHeight + 1, nGoodTransactions);
|
||||||
return VerifyDBResult::CORRUPTED_BLOCK_DB;
|
return VerifyDBResult::CORRUPTED_BLOCK_DB;
|
||||||
}
|
}
|
||||||
if (skipped_l3_checks) {
|
if (skipped_l3_checks) {
|
||||||
@@ -4768,11 +4768,11 @@ VerifyDBResult CVerifyDB::VerifyDB(
|
|||||||
pindex = chainstate.m_chain.Next(pindex);
|
pindex = chainstate.m_chain.Next(pindex);
|
||||||
CBlock block;
|
CBlock block;
|
||||||
if (!chainstate.m_blockman.ReadBlock(block, *pindex)) {
|
if (!chainstate.m_blockman.ReadBlock(block, *pindex)) {
|
||||||
LogPrintf("Verification error: ReadBlock failed at %d, hash=%s\n", pindex->nHeight, pindex->GetBlockHash().ToString());
|
LogError("Verification error: ReadBlock failed at %d, hash=%s", pindex->nHeight, pindex->GetBlockHash().ToString());
|
||||||
return VerifyDBResult::CORRUPTED_BLOCK_DB;
|
return VerifyDBResult::CORRUPTED_BLOCK_DB;
|
||||||
}
|
}
|
||||||
if (!chainstate.ConnectBlock(block, state, pindex, coins)) {
|
if (!chainstate.ConnectBlock(block, state, pindex, coins)) {
|
||||||
LogPrintf("Verification error: found unconnectable block at %d, hash=%s (%s)\n", pindex->nHeight, pindex->GetBlockHash().ToString(), state.ToString());
|
LogError("Verification error: found unconnectable block at %d, hash=%s (%s)", pindex->nHeight, pindex->GetBlockHash().ToString(), state.ToString());
|
||||||
return VerifyDBResult::CORRUPTED_BLOCK_DB;
|
return VerifyDBResult::CORRUPTED_BLOCK_DB;
|
||||||
}
|
}
|
||||||
if (chainstate.m_chainman.m_interrupt) return VerifyDBResult::INTERRUPTED;
|
if (chainstate.m_chainman.m_interrupt) return VerifyDBResult::INTERRUPTED;
|
||||||
@@ -5635,7 +5635,7 @@ Chainstate& ChainstateManager::InitializeChainstate(CTxMemPool* mempool)
|
|||||||
const bool destroyed = DestroyDB(path_str);
|
const bool destroyed = DestroyDB(path_str);
|
||||||
|
|
||||||
if (!destroyed) {
|
if (!destroyed) {
|
||||||
LogPrintf("error: leveldb DestroyDB call failed on %s\n", path_str);
|
LogError("leveldb DestroyDB call failed on %s", path_str);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Datadir should be removed from filesystem; otherwise initialization may detect
|
// Datadir should be removed from filesystem; otherwise initialization may detect
|
||||||
@@ -6334,8 +6334,8 @@ util::Result<void> Chainstate::InvalidateCoinsDBOnDisk()
|
|||||||
auto src_str = fs::PathToString(snapshot_datadir);
|
auto src_str = fs::PathToString(snapshot_datadir);
|
||||||
auto dest_str = fs::PathToString(invalid_path);
|
auto dest_str = fs::PathToString(invalid_path);
|
||||||
|
|
||||||
LogPrintf("%s: error renaming file '%s' -> '%s': %s\n",
|
LogError("While invalidating the coins db: Error renaming file '%s' -> '%s': %s",
|
||||||
__func__, src_str, dest_str, e.what());
|
src_str, dest_str, e.what());
|
||||||
return util::Error{strprintf(_(
|
return util::Error{strprintf(_(
|
||||||
"Rename of '%s' -> '%s' failed. "
|
"Rename of '%s' -> '%s' failed. "
|
||||||
"You should resolve this by manually moving or deleting the invalid "
|
"You should resolve this by manually moving or deleting the invalid "
|
||||||
@@ -6354,7 +6354,7 @@ bool ChainstateManager::DeleteSnapshotChainstate()
|
|||||||
|
|
||||||
fs::path snapshot_datadir = Assert(node::FindSnapshotChainstateDir(m_options.datadir)).value();
|
fs::path snapshot_datadir = Assert(node::FindSnapshotChainstateDir(m_options.datadir)).value();
|
||||||
if (!DeleteCoinsDBFromDisk(snapshot_datadir, /*is_snapshot=*/ true)) {
|
if (!DeleteCoinsDBFromDisk(snapshot_datadir, /*is_snapshot=*/ true)) {
|
||||||
LogPrintf("Deletion of %s failed. Please remove it manually to continue reindexing.\n",
|
LogError("Deletion of %s failed. Please remove it manually to continue reindexing.",
|
||||||
fs::PathToString(snapshot_datadir));
|
fs::PathToString(snapshot_datadir));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -6416,8 +6416,8 @@ bool ChainstateManager::ValidatedSnapshotCleanup()
|
|||||||
// is in-memory, in which case we can't do on-disk cleanup. You'd better be
|
// is in-memory, in which case we can't do on-disk cleanup. You'd better be
|
||||||
// in a unittest!
|
// in a unittest!
|
||||||
if (!ibd_chainstate_path_maybe || !snapshot_chainstate_path_maybe) {
|
if (!ibd_chainstate_path_maybe || !snapshot_chainstate_path_maybe) {
|
||||||
LogPrintf("[snapshot] snapshot chainstate cleanup cannot happen with "
|
LogError("[snapshot] snapshot chainstate cleanup cannot happen with "
|
||||||
"in-memory chainstates. You are testing, right?\n");
|
"in-memory chainstates. You are testing, right?");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -755,7 +755,7 @@ std::optional<MigrationData> LegacyDataSPKM::MigrateToDescriptor()
|
|||||||
|
|
||||||
// Make sure that we have accounted for all scriptPubKeys
|
// Make sure that we have accounted for all scriptPubKeys
|
||||||
if (!Assume(spks.empty())) {
|
if (!Assume(spks.empty())) {
|
||||||
LogPrintf("%s\n", STR_INTERNAL_BUG("Error: Some output scripts were not migrated.\n"));
|
LogError("%s", STR_INTERNAL_BUG("Error: Some output scripts were not migrated."));
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user