Skip to content

Commit 72042ac

Browse files
furszyFuzzbawls
authored andcommitted
Move disconnectBlocks logging to use __func__ instead of hardcoded method name.
Github-Pull: #1735 Rebased-From: d4cf6c8
1 parent 0f66764 commit 72042ac

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/main.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2047,16 +2047,16 @@ DisconnectResult DisconnectBlock(CBlock& block, CBlockIndex* pindex, CCoinsViewC
20472047
CAmount nValueIn = 0;
20482048
CDiskBlockPos pos = pindex->GetUndoPos();
20492049
if (pos.IsNull()) {
2050-
error("DisconnectBlock() : no undo data available");
2050+
error("%s: no undo data available", __func__);
20512051
return DISCONNECT_FAILED;
20522052
}
20532053
if (!UndoReadFromDisk(blockUndo, pos, pindex->pprev->GetBlockHash())) {
2054-
error("DisconnectBlock() : failure reading undo data");
2054+
error("%s: failure reading undo data", __func__);
20552055
return DISCONNECT_FAILED;
20562056
}
20572057

20582058
if (blockUndo.vtxundo.size() + 1 != block.vtx.size()) {
2059-
error("DisconnectBlock() : block and undo data inconsistent");
2059+
error("%s: block and undo data inconsistent", __func__);
20602060
return DISCONNECT_FAILED;
20612061
}
20622062

@@ -2090,7 +2090,7 @@ DisconnectResult DisconnectBlock(CBlock& block, CBlockIndex* pindex, CCoinsViewC
20902090
if (outsBlock.nVersion < 0)
20912091
outs->nVersion = outsBlock.nVersion;
20922092
if (*outs != outsBlock)
2093-
fClean = fClean && error("DisconnectBlock() : added transaction mismatch? database corrupted");
2093+
fClean = fClean && error("%s : added transaction mismatch? database corrupted", __func__);
20942094

20952095
// remove outputs
20962096
outs->Clear();
@@ -2103,8 +2103,8 @@ DisconnectResult DisconnectBlock(CBlock& block, CBlockIndex* pindex, CCoinsViewC
21032103
// restore inputs
21042104
const CTxUndo& txundo = blockUndo.vtxundo[i - 1];
21052105
if (txundo.vprevout.size() != tx.vin.size()) {
2106-
error("DisconnectBlock() : transaction and undo data inconsistent - txundo.vprevout.siz=%d tx.vin.siz=%d",
2107-
txundo.vprevout.size(), tx.vin.size());
2106+
error("%s: transaction and undo data inconsistent - txundo.vprevout.siz=%d tx.vin.siz=%d",
2107+
__func__, txundo.vprevout.size(), tx.vin.size());
21082108
return DISCONNECT_FAILED;
21092109
}
21102110
for (unsigned int j = tx.vin.size(); j-- > 0;) {

0 commit comments

Comments
 (0)