mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
validation: Move FindForkInGlobalIndex to BlockManager
[META] This commit should be followed up by removing the comments and
assertions meant only to show that the change is correct.
FindForkInGlobalIndex only acts on BlockManager.
Note to reviewers: Since FindForkInGlobalIndex is always called with
::ChainActive() as its first parameter, it is possible to move
FindForkInGlobalIndex to CChainState and remove this const CChain&
parameter to instead use m_chain. However, it seems like the original
intention was for FindForkInGlobalIndex to work with _any_ chain, not
just the current active chain. Let me know if this should be changed.
This commit is contained in:
parent
3664a150ac
commit
b026e318c3
5 changed files with 10 additions and 9 deletions
|
|
@ -447,7 +447,7 @@ public:
|
|||
{
|
||||
LOCK(cs_main);
|
||||
const CChain& active = Assert(m_node.chainman)->ActiveChain();
|
||||
if (CBlockIndex* fork = FindForkInGlobalIndex(active, locator)) {
|
||||
if (CBlockIndex* fork = g_chainman.m_blockman.FindForkInGlobalIndex(active, locator)) {
|
||||
return fork->nHeight;
|
||||
}
|
||||
return nullopt;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue