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
Branch
pr13983
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 7434
Build 12911: Bitcoin ABC Buildbot (legacy)
Build 12910: arc lint + arc unit

Event Timeline

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