Page MenuHomePhabricator

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

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



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
Completes T686
Depends on D4046

Test Plan
make check

Diff Detail

rABC Bitcoin ABC
Automatic diff as part of commit; lint not applicable.
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.
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