Page MenuHomePhabricator

Merge #13439: rpc: Avoid "duplicate" return value for invalid submitblock
ClosedPublic

Authored by jasonbcox on Aug 12 2019, 18:31.

Details

Summary

f74894480 Only set fNewBlock to true in AcceptBlock when we write to disk (Matt Corallo)
fa6e49731 rpc: Avoid "duplicate" return value for invalid submitblock (MarcoFalke)

Pull request description:

This is #13395 with one more commit tacked on. MarcoFalke got tired of dealing with the stupidity of fixing a return code with too many rounds of review (not that I blame him). Honestly we should probably have no return whatsoever, but for now, this fixes it (as well as nLastBlockTime for eviction purposes).

Original description:

When `submitblock` of an invalid block, the return value should not be `"duplicate"`.

This is only seen when the header was previously found (denoted by the incorrectly named boolean `fBlockPresent`). Fix this bug by removing `fBlockPresent`.

Tree-SHA512: 0ce3092655d5d904b4c8c5ff7479f73ce387144a738f20472b8af132564005c6db5594ae366e589508f6258506ee7a28b1c7995a83a8328b334f99316006bf2d

Backport of Core PR13439
https://github.com/bitcoin/bitcoin/pull/13439/files

Test Plan
make check
test_runner.py

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

jasonbcox created this revision.Aug 12 2019, 18:31
nakihito accepted this revision.Aug 12 2019, 22:54
This revision is now accepted and ready to land.Aug 12 2019, 22:54
jasonbcox planned changes to this revision.Sep 6 2019, 00:24

After some discussion with Fabien, we decided it wasn't urgent to get this change in without tests to accompany it (or at least be landed shortly after). https://github.com/bitcoin/bitcoin/pull/13983/ This PR and it's dependencies get us there, but will take some more time. Putting this diff on the back burner until then.

Tracking PR13983 in T686

jasonbcox updated this revision to Diff 11228.Sep 11 2019, 21:18

D4047 (T686) is ready for review. Consider it while reviewing this change and I will land the stack together once they're all green.

This revision is now accepted and ready to land.Sep 11 2019, 21:18
jasonbcox requested review of this revision.Sep 11 2019, 21:19
deadalnix accepted this revision.Sep 12 2019, 08:24
This revision is now accepted and ready to land.Sep 12 2019, 08:24