Page MenuHomePhabricator

Merge #11406: Add state message print to AcceptBlock failure message.
ClosedPublic

Authored by jasonbcox on Jun 5 2019, 00:14.

Details

Summary

6643b80 Add state message print to AcceptBlock failure message. (Matt Corallo)

Pull request description:

This should make it easier to debug issues where the CheckBlock at
the top of ProcessNewBlock fails (which does not print, in contrast
to AcceptBlock, which always prints).

This was motivated by #11371 which appears to be exactly such a case, and is not debuggable from the information provided. Not sure how much this would have helped in that case, but it is kinda weird that we can reject a block without ever printing why.

Tree-SHA512: 7a1c2c76080b810212da885c38e091609e409c62918cc326bb36a1096e09b2ae7e26fd4bdaefd79863d2894e2823e463005700a524940f177a59ef09f589b2f1

Backport of Core PR11406
https://github.com/bitcoin/bitcoin/pull/11406/files

Test Plan
# on master
test_runner.py --nocleanup

grep -rni "acceptblock fail" /tmp/<bitcoin-temp-dir>
# example error:
ERROR: ProcessNewBlock: AcceptBlock FAILED

# with this patch
make check
test_runner.py

grep -rni "acceptblock fail" /tmp/<bitcoin-temp-dir>
# example error:
ERROR: ProcessNewBlock: AcceptBlock FAILED (Transaction order is invalid (01fc91cfedbea4a49c943158746de0467801cd24594139c8482ce976f3ed6101 < ce56a7306a2c9b1a6a7ecb8a31f17883023f3d224e1b09c2709ba8dca5dae53c))

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable