Page MenuHomePhabricator

[rpc] add getfinalizedblockhash to return the current finalized block
ClosedPublic

Authored by Fabien on Nov 21 2018, 20:06.

Details

Summary

As per title. Add an API so that node operators can introspect the currently
finalized block in case they need to make manual adjustments.

Test Plan
make check && ./test/functional/test_runner.py

Diff Detail

Repository
rABC Bitcoin ABC
Branch
arcpatch-D2114_2
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 4051
Build 6173: Bitcoin ABC Buildbot (legacy)
Build 6172: arc lint + arc unit

Event Timeline

schancel changed the visibility from "Public (No Login Required)" to "Restricted Project (Project)".Nov 21 2018, 20:06
schancel edited the summary of this revision. (Show Details)

Remove mistaken dependency on D2064

Remove unnecessary whitespace change

Fabien added inline comments.
test/functional/abc-finalize-block.py
47 ↗(On Diff #6000)

Could alt_node.generate(AUTO_FINALIZATION_DEPTH) make the test more repeatable against maxreorgdepth values ?

deadalnix requested changes to this revision.Nov 22 2018, 00:15
deadalnix added a subscriber: deadalnix.
deadalnix added inline comments.
src/rpc/blockchain.cpp
192 ↗(On Diff #6000)

If no block is finalized, returning null is more appropriate.

src/validation.h
639 ↗(On Diff #6000)

It seems like this should just return the CBlockIndex.

This revision now requires changes to proceed.Nov 22 2018, 00:15
Fabien added a reviewer: schancel.

GetFinalizedBlock returns CBlockIndex *

deadalnix added inline comments.
src/validation.cpp
2918 ↗(On Diff #6012)

prefix const

src/validation.h
639 ↗(On Diff #6012)

Prefix const

This revision is now accepted and ready to land.Nov 22 2018, 15:01
deadalnix changed the visibility from "Restricted Project (Project)" to "Public (No Login Required)".Nov 22 2018, 15:09
deadalnix requested changes to this revision.Nov 22 2018, 15:15
deadalnix added inline comments.
src/rpc/blockchain.cpp
193 ↗(On Diff #6013)

const prefix

This revision now requires changes to proceed.Nov 22 2018, 15:15
This revision is now accepted and ready to land.Nov 22 2018, 15:17
This revision was automatically updated to reflect the committed changes.