HomePhabricator

clarify GetBlockScriptFlags

Description

clarify GetBlockScriptFlags

Summary:
The effect of GetBlockScriptFlags is to return the "next block" flags
for a given block index, however the name, comments and parameter names
seem to contradict this. Fortunately, all actual code using this function
is doing the right thing. This Diff tries to make it all clear; besides
a change in an obscure error message, there is no functional change as
only comments and internal function/variable names are changed.

This may break backports but that is good since the function actually does
something different than in Core.

(Note: Calculating the next-block flags is clean & nice, since it means
that calling this function with the chain tip gives us exactly the
consensus flags that we should be applying to the mempool, even around
activation times. This can be contrasted to Core, where the function of
the same name returns flags for the given block instead; that creates a
weird off-by-one error for mempool acceptance around activation times.)

Test Plan: make check

Reviewers: deadalnix, jasonbcox, Fabien, #bitcoin_abc

Reviewed By: deadalnix, #bitcoin_abc

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

Event Timeline

Mark Lundeberg <36528214+markblundeberg@users.noreply.github.com> committed rSTAGINGc898daa3c1d7: clarify GetBlockScriptFlags (authored by Mark Lundeberg <36528214+markblundeberg@users.noreply.github.com>).Jun 18 2019, 21:08