HomePhabricator

[refactor] refactor FinalizeBlockAndInvalidate

Description

[refactor] refactor FinalizeBlockAndInvalidate

Summary:
Upcoming Core PR15971 requires InvalidateBlock to not hold cs_main lock. Currently the function FinalizeBlockAndInvalidate does both things, requires cs_main to be locked and has only one callsite (FinalizeBlock RPC method)

This diff extracts the RPC method exclusive functionality and refactors FinalizeBlockAndInvalidate to FinalizeBlock, requiring cs_main to be held while allowing for the upcoming diff to move the InvalidateBlock call outside the scope of the lock.

Test Plan:

ninja check-all

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Subscribers: deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D6861

Details

Provenance
majcostaAuthored on Jul 8 2020, 20:35
majcostaPushed on Jul 14 2020, 01:43
Reviewer
Restricted Project
Differential Revision
D6861: [refactor] refactor FinalizeBlockAndInvalidate
Parents
rABC19491d131486: [land-bot] Pass committer name/email to land bot endpoint
Branches
Unknown
Tags
Unknown