mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-07 22:24:34 +01:00
Consistently log CValidationState on failure
Seems providing at least minimal visibility to the failure is a good practice. The only remaining ignored state is in LoadExternalBlockFile, where logging would likely be spammy.
This commit is contained in:
@@ -1100,8 +1100,10 @@ void static ProcessGetBlockData(CNode* pfrom, const Consensus::Params& consensus
|
||||
}
|
||||
} // release cs_main before calling ActivateBestChain
|
||||
if (need_activate_chain) {
|
||||
CValidationState dummy;
|
||||
ActivateBestChain(dummy, Params(), a_recent_block);
|
||||
CValidationState state;
|
||||
if (!ActivateBestChain(state, Params(), a_recent_block)) {
|
||||
LogPrint(BCLog::NET, "failed to activate chain (%s)\n", FormatStateMessage(state));
|
||||
}
|
||||
}
|
||||
|
||||
LOCK(cs_main);
|
||||
@@ -1992,8 +1994,10 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
|
||||
LOCK(cs_most_recent_block);
|
||||
a_recent_block = most_recent_block;
|
||||
}
|
||||
CValidationState dummy;
|
||||
ActivateBestChain(dummy, Params(), a_recent_block);
|
||||
CValidationState state;
|
||||
if (!ActivateBestChain(state, Params(), a_recent_block)) {
|
||||
LogPrint(BCLog::NET, "failed to activate chain (%s)\n", FormatStateMessage(state));
|
||||
}
|
||||
}
|
||||
|
||||
LOCK(cs_main);
|
||||
|
||||
Reference in New Issue
Block a user