mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 06:43:45 +01:00
Refactor FormatStateMessage into ValidationState
This commit is contained in:
@@ -26,7 +26,6 @@
|
||||
#include <txmempool.h>
|
||||
#include <util/system.h>
|
||||
#include <util/strencodings.h>
|
||||
#include <util/validation.h>
|
||||
|
||||
#include <memory>
|
||||
#include <typeinfo>
|
||||
@@ -1432,7 +1431,7 @@ void static ProcessGetBlockData(CNode* pfrom, const CChainParams& chainparams, c
|
||||
if (need_activate_chain) {
|
||||
BlockValidationState state;
|
||||
if (!ActivateBestChain(state, Params(), a_recent_block)) {
|
||||
LogPrint(BCLog::NET, "failed to activate chain (%s)\n", FormatStateMessage(state));
|
||||
LogPrint(BCLog::NET, "failed to activate chain (%s)\n", state.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2342,7 +2341,7 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
|
||||
}
|
||||
BlockValidationState state;
|
||||
if (!ActivateBestChain(state, Params(), a_recent_block)) {
|
||||
LogPrint(BCLog::NET, "failed to activate chain (%s)\n", FormatStateMessage(state));
|
||||
LogPrint(BCLog::NET, "failed to activate chain (%s)\n", state.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2636,7 +2635,7 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
|
||||
{
|
||||
LogPrint(BCLog::MEMPOOLREJ, "%s from peer=%d was not accepted: %s\n", tx.GetHash().ToString(),
|
||||
pfrom->GetId(),
|
||||
FormatStateMessage(state));
|
||||
state.ToString());
|
||||
MaybePunishNodeForTx(pfrom->GetId(), state);
|
||||
}
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user