mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-20 13:37:28 +02:00
Merge 7ba0850c49 into merged_master (Bitcoin PR bitcoin/bitcoin#25036)
This commit is contained in:
commit
f6f9f6b155
8 changed files with 68 additions and 24 deletions
|
|
@ -524,20 +524,27 @@ public:
|
|||
}
|
||||
bool haveBlockOnDisk(int height) override
|
||||
{
|
||||
LOCK(cs_main);
|
||||
LOCK(::cs_main);
|
||||
const CChain& active = Assert(m_node.chainman)->ActiveChain();
|
||||
CBlockIndex* block = active[height];
|
||||
return block && ((block->nStatus & BLOCK_HAVE_DATA) != 0) && block->nTx > 0;
|
||||
}
|
||||
CBlockLocator getTipLocator() override
|
||||
{
|
||||
LOCK(cs_main);
|
||||
LOCK(::cs_main);
|
||||
const CChain& active = Assert(m_node.chainman)->ActiveChain();
|
||||
return active.GetLocator();
|
||||
}
|
||||
CBlockLocator getActiveChainLocator(const uint256& block_hash) override
|
||||
{
|
||||
LOCK(::cs_main);
|
||||
const CBlockIndex* index = chainman().m_blockman.LookupBlockIndex(block_hash);
|
||||
if (!index) return {};
|
||||
return chainman().ActiveChain().GetLocator(index);
|
||||
}
|
||||
std::optional<int> findLocatorFork(const CBlockLocator& locator) override
|
||||
{
|
||||
LOCK(cs_main);
|
||||
LOCK(::cs_main);
|
||||
const CChainState& active = Assert(m_node.chainman)->ActiveChainstate();
|
||||
if (const CBlockIndex* fork = active.FindForkInGlobalIndex(locator)) {
|
||||
return fork->nHeight;
|
||||
|
|
@ -593,7 +600,7 @@ public:
|
|||
void findCoins(std::map<COutPoint, Coin>& coins) override { return FindCoins(m_node, coins); }
|
||||
double guessVerificationProgress(const uint256& block_hash) override
|
||||
{
|
||||
LOCK(cs_main);
|
||||
LOCK(::cs_main);
|
||||
return GuessVerificationProgress(chainman().m_blockman.LookupBlockIndex(block_hash), chainman().GetParams().GetConsensus().nPowTargetSpacing);
|
||||
}
|
||||
bool hasBlocks(const uint256& block_hash, int min_height, std::optional<int> max_height) override
|
||||
|
|
@ -694,7 +701,7 @@ public:
|
|||
CFeeRate relayDustFee() override { return ::dustRelayFee; }
|
||||
bool havePruned() override
|
||||
{
|
||||
LOCK(cs_main);
|
||||
LOCK(::cs_main);
|
||||
return m_node.chainman->m_blockman.m_have_pruned;
|
||||
}
|
||||
bool isReadyToBroadcast() override { return !node::fImporting && !node::fReindex && !isInitialBlockDownload(); }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue