Skip to content

Commit a3a6090

Browse files
committed
refactoring: introduce unused ChainActive()
in preparation for the following scripted-diff commit.
1 parent 1b6e6fc commit a3a6090

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/validation.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,8 @@ class CChainState {
220220
void EraseBlockData(CBlockIndex* index) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
221221
} g_chainstate;
222222

223+
CChain& ChainActive() { return g_chainstate.m_chain; }
224+
223225
/**
224226
* Mutex to guard access to validation specific variables, such as reading
225227
* or changing the chainstate.

src/validation.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,9 @@ void ResetBlockFailureFlags(CBlockIndex* pindex) EXCLUSIVE_LOCKS_REQUIRED(cs_mai
438438
/** The currently-connected chain of blocks (protected by cs_main). */
439439
extern CChain& chainActive;
440440

441+
/** @returns the most-work chain. */
442+
CChain& ChainActive();
443+
441444
/** Global variable that points to the coins database (protected by cs_main) */
442445
extern std::unique_ptr<CCoinsViewDB> pcoinsdbview;
443446

0 commit comments

Comments
 (0)