Page MenuHomePhabricator

Merge #13983: rpc: Return more specific reject reason for submitblock
ClosedPublic

Authored by jasonbcox on Sep 11 2019, 21:16.

Details

Summary

fa6ab8ada1 rpc: Return more specific reject reason for submitblock (MarcoFalke)

Pull request description:

The second commit in #13439 made the `TODO` in the first commit impossible to solve.

The meaning of `fNewBlock` changed from "This is the first time we process this block" to "We are about to write the new *valid* block".

So whenever `fNewBlock` is true, the block was valid. And whenever the `fNewBlock` is false, the block is either valid or invalid. If it was valid and not new, we know it is a `"duplicate"`. In all other cases, the `BIP22ValidationResult()` will return the reason why it is invalid.

Tree-SHA512: 4b6edf7a912339c3acb0fccfabbdd6d812a0321fb1639c244c2714e58dc119aa2b8c6bf8f7d61ea609a1b861bbc23f920370fcf989c48452721e259a8ce93d24

Backport Core PR13983
https://github.com/bitcoin/bitcoin/pull/13983/files
Completes T686
Depends on D4046

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.Sep 11 2019, 21:16
Fabien accepted this revision.Sep 12 2019, 06:37
Fabien added a subscriber: Fabien.
Fabien added inline comments.
test/functional/mining_basic.py
248 ↗(On Diff #11227)

Nit: move comment above.

This revision is now accepted and ready to land.Sep 12 2019, 06:37
jasonbcox updated this revision to Diff 11264.Sep 12 2019, 20:26

Rebase + fix nit