mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-18 13:17:55 +02: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:
parent
615f7c2884
commit
e4d0b44373
4 changed files with 29 additions and 15 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue