@@ -981,7 +981,7 @@ bool BlockManager::WriteBlockToDisk(const CBlock& block, FlatFilePos& pos) const
981
981
// Open history file to append
982
982
AutoFile fileout{OpenBlockFile (pos)};
983
983
if (fileout.IsNull ()) {
984
- LogError (" WriteBlockToDisk : OpenBlockFile failed\n " );
984
+ LogError (" %s : OpenBlockFile failed\n " , __func__ );
985
985
return false ;
986
986
}
987
987
@@ -992,7 +992,7 @@ bool BlockManager::WriteBlockToDisk(const CBlock& block, FlatFilePos& pos) const
992
992
// Write block
993
993
long fileOutPos = ftell (fileout.Get ());
994
994
if (fileOutPos < 0 ) {
995
- LogError (" WriteBlockToDisk : ftell failed\n " );
995
+ LogError (" %s : ftell failed\n " , __func__ );
996
996
return false ;
997
997
}
998
998
pos.nPos = (unsigned int )fileOutPos;
@@ -1011,7 +1011,7 @@ bool BlockManager::WriteUndoDataForBlock(const CBlockUndo& blockundo, BlockValid
1011
1011
if (block.GetUndoPos ().IsNull ()) {
1012
1012
FlatFilePos _pos;
1013
1013
if (!FindUndoPos (state, block.nFile , _pos, ::GetSerializeSize (blockundo) + 40 )) {
1014
- LogError (" ConnectBlock() : FindUndoPos failed\n " );
1014
+ LogError (" %s : FindUndoPos failed\n " , __func__ );
1015
1015
return false ;
1016
1016
}
1017
1017
if (!UndoWriteToDisk (blockundo, _pos, block.pprev ->GetBlockHash ())) {
@@ -1050,7 +1050,7 @@ bool BlockManager::ReadBlockFromDisk(CBlock& block, const FlatFilePos& pos) cons
1050
1050
// Open history file to read
1051
1051
AutoFile filein{OpenBlockFile (pos, true )};
1052
1052
if (filein.IsNull ()) {
1053
- LogError (" ReadBlockFromDisk : OpenBlockFile failed for %s\n " , pos.ToString ());
1053
+ LogError (" %s : OpenBlockFile failed for %s\n " , __func__ , pos.ToString ());
1054
1054
return false ;
1055
1055
}
1056
1056
@@ -1064,13 +1064,13 @@ bool BlockManager::ReadBlockFromDisk(CBlock& block, const FlatFilePos& pos) cons
1064
1064
1065
1065
// Check the header
1066
1066
if (!CheckProofOfWork (block.GetHash (), block.nBits , GetConsensus ())) {
1067
- LogError (" ReadBlockFromDisk : Errors in block header at %s\n " , pos.ToString ());
1067
+ LogError (" %s : Errors in block header at %s\n " , __func__ , pos.ToString ());
1068
1068
return false ;
1069
1069
}
1070
1070
1071
1071
// Signet only: check block solution
1072
1072
if (GetConsensus ().signet_blocks && !CheckSignetBlockSolution (block, GetConsensus ())) {
1073
- LogError (" ReadBlockFromDisk : Errors in block solution at %s\n " , pos.ToString ());
1073
+ LogError (" %s : Errors in block solution at %s\n " , __func__ , pos.ToString ());
1074
1074
return false ;
1075
1075
}
1076
1076
@@ -1085,8 +1085,7 @@ bool BlockManager::ReadBlockFromDisk(CBlock& block, const CBlockIndex& index) co
1085
1085
return false ;
1086
1086
}
1087
1087
if (block.GetHash () != index.GetBlockHash ()) {
1088
- LogError (" ReadBlockFromDisk(CBlock&, CBlockIndex*): GetHash() doesn't match index for %s at %s\n " ,
1089
- index.ToString (), block_pos.ToString ());
1088
+ LogError (" %s: GetHash() doesn't match index for %s at %s\n " , __func__, index.ToString (), block_pos.ToString ());
1090
1089
return false ;
1091
1090
}
1092
1091
return true ;
0 commit comments