Skip to content

Commit

Permalink
Merge bitcoin#14097: validation: Log FormatStateMessage on ConnectBlo…
Browse files Browse the repository at this point in the history
…ck error in ConnectTip

fa309dc validation: Log FormatStateMessage on ConnectBlock error in ConnectTip (MarcoFalke)

Pull request description:

  This change additionally logs the validation state on error, which is not logged at all on current master.

  Before:
  ```
  ERROR: ConnectTip(): ConnectBlock ffffff.... failed
  ```

  After:
  ```
  ERROR: ConnectTip: ConnectBlock ffffff.... failed, bad-cb-amount (code 16)
  ```

Tree-SHA512: e69ee0266772b3f77c0193c4a959c2444bf1a51259bd29d790cf665582b037997e520c8567f70b36362c071dcfe1a8ebd7c0f2286cf1b842df5731960e7e1ba0

# Conflicts:
#	src/validation.cpp
  • Loading branch information
laanwj authored and Munkybooty committed Jul 2, 2021
1 parent bb592c2 commit 271112d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/validation.cpp
Expand Up @@ -2841,7 +2841,7 @@ bool CChainState::ConnectTip(CValidationState& state, const CChainParams& chainp
if (!rv) {
if (state.IsInvalid())
InvalidBlockFound(pindexNew, state);
return error("ConnectTip(): ConnectBlock %s failed with %s", pindexNew->GetBlockHash().ToString(), FormatStateMessage(state));
return error("%s: ConnectBlock %s failed, %s", __func__, pindexNew->GetBlockHash().ToString(), FormatStateMessage(state));
}
nTime3 = GetTimeMicros(); nTimeConnectTotal += nTime3 - nTime2;
LogPrint(BCLog::BENCHMARK, " - Connect total: %.2fms [%.2fs (%.2fms/blk)]\n", (nTime3 - nTime2) * MILLI, nTimeConnectTotal * MICRO, nTimeConnectTotal * MILLI / nBlocksTotal);
Expand Down

0 comments on commit 271112d

Please sign in to comment.