mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Merge 601bfc417d into merged_master (Bitcoin PR bitcoin/bitcoin#24515)
This commit is contained in:
commit
fa21dc5b5d
10 changed files with 155 additions and 130 deletions
|
|
@ -490,7 +490,7 @@ public:
|
|||
{
|
||||
LOCK(cs_main);
|
||||
const CChainState& active = Assert(m_node.chainman)->ActiveChainstate();
|
||||
if (CBlockIndex* fork = active.FindForkInGlobalIndex(locator)) {
|
||||
if (const CBlockIndex* fork = active.FindForkInGlobalIndex(locator)) {
|
||||
return fork->nHeight;
|
||||
}
|
||||
return std::nullopt;
|
||||
|
|
@ -557,7 +557,7 @@ public:
|
|||
// used to limit the range, and passing min_height that's too low or
|
||||
// max_height that's too high will not crash or change the result.
|
||||
LOCK(::cs_main);
|
||||
if (CBlockIndex* block = chainman().m_blockman.LookupBlockIndex(block_hash)) {
|
||||
if (const CBlockIndex* block = chainman().m_blockman.LookupBlockIndex(block_hash)) {
|
||||
if (max_height && block->nHeight >= *max_height) block = block->GetAncestor(*max_height);
|
||||
for (; block->nStatus & BLOCK_HAVE_DATA; block = block->pprev) {
|
||||
// Check pprev to not segfault if min_height is too low
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue