diff --git a/src/node/blockstorage.cpp b/src/node/blockstorage.cpp index 7ca469f2b1fa81..316e7796475f1e 100644 --- a/src/node/blockstorage.cpp +++ b/src/node/blockstorage.cpp @@ -702,11 +702,11 @@ bool BlockManager::ReadBlockUndo(CBlockUndo& blockundo, const CBlockIndex& index uint256 hashChecksum; filein >> hashChecksum; if (hashChecksum != verifier.GetHash()) { - LogError("%s: Checksum mismatch at %s\n", __func__, pos.ToString()); + LogError("%s: Checksum mismatch at %s", __func__, pos.ToString()); return false; } } catch (const std::exception& e) { - LogError("%s: Deserialize or I/O error - %s at %s\n", __func__, e.what(), pos.ToString()); + LogError("%s: Deserialize or I/O error - %s at %s", __func__, e.what(), pos.ToString()); return false; } @@ -959,13 +959,13 @@ bool BlockManager::WriteBlockUndo(const CBlockUndo& blockundo, BlockValidationSt FlatFilePos pos; const unsigned int blockundo_size{static_cast(GetSerializeSize(blockundo))}; if (!FindUndoPos(state, block.nFile, pos, blockundo_size + UNDO_DATA_DISK_OVERHEAD)) { - LogError("FindUndoPos failed"); + LogError("%s: FindUndoPos failed", __func__); return false; } // Open history file to append AutoFile fileout{m_undo_file_seq.Open(pos, false), {}}; // We'll obfuscate ourselves if (fileout.IsNull()) { - LogError("FlatFileSeq::Open failed"); + LogError("%s: FlatFileSeq::Open failed", __func__); return FatalError(m_opts.notifications, state, _("Failed to write undo data.")); } @@ -1029,7 +1029,7 @@ bool BlockManager::ReadBlock(CBlock& block, FlatFilePos pos) const // Open history file to read AutoFile filein{OpenBlockFile(pos, true)}; if (filein.IsNull()) { - LogError("%s: OpenBlockFile failed for %s\n", __func__, pos.ToString()); + LogError("%s: OpenBlockFile failed for %s", __func__, pos.ToString()); return false; } @@ -1037,7 +1037,7 @@ bool BlockManager::ReadBlock(CBlock& block, FlatFilePos pos) const // Read block filein >> blk_size; if (blk_size > MAX_SIZE) { - LogError("Refusing to read block of size: %s", blk_size); + LogError("Refusing to read block of size: %d", blk_size); return false; } @@ -1045,19 +1045,19 @@ bool BlockManager::ReadBlock(CBlock& block, FlatFilePos pos) const filein >> Span{mem}; SpanReader(mem) >> TX_WITH_WITNESS(block); } catch (const std::exception& e) { - LogError("%s: Deserialize or I/O error - %s at %s\n", __func__, e.what(), pos.ToString()); + LogError("%s: Deserialize or I/O error - %s at %s", __func__, e.what(), pos.ToString()); return false; } // Check the header if (!CheckProofOfWork(block.GetHash(), block.nBits, GetConsensus())) { - LogError("%s: Errors in block header at %s\n", __func__, pos.ToString()); + LogError("%s: Errors in block header at %s", __func__, pos.ToString()); return false; } // Signet only: check block solution if (GetConsensus().signet_blocks && !CheckSignetBlockSolution(block, GetConsensus())) { - LogError("%s: Errors in block solution at %s\n", __func__, pos.ToString()); + LogError("%s: Errors in block solution at %s", __func__, pos.ToString()); return false; } @@ -1128,12 +1128,12 @@ FlatFilePos BlockManager::WriteBlock(const CBlock& block, int nHeight) const unsigned int block_size{static_cast(GetSerializeSize(TX_WITH_WITNESS(block)))}; FlatFilePos pos{FindNextBlockPos(block_size + BLOCK_SERIALIZATION_HEADER_SIZE, nHeight, block.GetBlockTime())}; if (pos.IsNull()) { - LogError("FindNextBlockPos failed"); + LogError("%s: FindNextBlockPos failed", __func__); return FlatFilePos(); } AutoFile fileout{m_block_file_seq.Open(pos, false), {}}; // We'll obfuscate ourselves if (fileout.IsNull()) { - LogError("FlatFileSeq::Open failed"); + LogError("%s: FlatFileSeq::Open failed", __func__); m_opts.notifications.fatalError(_("Failed to write block.")); return FlatFilePos(); }