interfaces, chain, refactor: Remove unused getTipLocator
Also removed CChain::GetLocator() and replaced its call with GetLocator() which uses LocatorEntries instead. Co-authored-by: ryanofsky <ryan@ofsky.org> Co-authored-by: l0rinc <l0rinc@users.noreply.github.com>
This commit is contained in:
1 parent
daca51bf80
commit
110a0f405c
5 files changed
+1
-17
No files matched your search
@@ -52,11 +52,6 @@ CBlockLocator GetLocator(const CBlockIndex* index)
|
|||||||
return CBlockLocator{LocatorEntries(index)};
|
return CBlockLocator{LocatorEntries(index)};
|
||||||
}
|
}
|
||||||
|
|
||||||
CBlockLocator CChain::GetLocator() const
|
|
||||||
{
|
|
||||||
return ::GetLocator(Tip());
|
|
||||||
}
|
|
||||||
|
|
||||||
const CBlockIndex *CChain::FindFork(const CBlockIndex *pindex) const {
|
const CBlockIndex *CChain::FindFork(const CBlockIndex *pindex) const {
|
||||||
if (pindex == nullptr) {
|
if (pindex == nullptr) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|||||||
@@ -467,9 +467,6 @@ public:
|
|||||||
/** Set/initialize a chain with a given tip. */
|
/** Set/initialize a chain with a given tip. */
|
||||||
void SetTip(CBlockIndex& block);
|
void SetTip(CBlockIndex& block);
|
||||||
|
|
||||||
/** Return a CBlockLocator that refers to the tip in of this chain. */
|
|
||||||
CBlockLocator GetLocator() const;
|
|
||||||
|
|
||||||
/** Find the last common block between this chain and a block index entry. */
|
/** Find the last common block between this chain and a block index entry. */
|
||||||
const CBlockIndex* FindFork(const CBlockIndex* pindex) const;
|
const CBlockIndex* FindFork(const CBlockIndex* pindex) const;
|
||||||
|
|
||||||
|
|||||||
@@ -143,9 +143,6 @@ public:
|
|||||||
//! pruned), and contains transactions.
|
//! pruned), and contains transactions.
|
||||||
virtual bool haveBlockOnDisk(int height) = 0;
|
virtual bool haveBlockOnDisk(int height) = 0;
|
||||||
|
|
||||||
//! Get locator for the current chain tip.
|
|
||||||
virtual CBlockLocator getTipLocator() = 0;
|
|
||||||
|
|
||||||
//! Return a locator that refers to a block in the active chain.
|
//! Return a locator that refers to a block in the active chain.
|
||||||
//! If specified block is not in the active chain, return locator for the latest ancestor that is in the chain.
|
//! If specified block is not in the active chain, return locator for the latest ancestor that is in the chain.
|
||||||
virtual CBlockLocator getActiveChainLocator(const uint256& block_hash) = 0;
|
virtual CBlockLocator getActiveChainLocator(const uint256& block_hash) = 0;
|
||||||
|
|||||||
@@ -559,11 +559,6 @@ public:
|
|||||||
const CBlockIndex* block{chainman().ActiveChain()[height]};
|
const CBlockIndex* block{chainman().ActiveChain()[height]};
|
||||||
return block && ((block->nStatus & BLOCK_HAVE_DATA) != 0) && block->nTx > 0;
|
return block && ((block->nStatus & BLOCK_HAVE_DATA) != 0) && block->nTx > 0;
|
||||||
}
|
}
|
||||||
CBlockLocator getTipLocator() override
|
|
||||||
{
|
|
||||||
LOCK(::cs_main);
|
|
||||||
return chainman().ActiveChain().GetLocator();
|
|
||||||
}
|
|
||||||
CBlockLocator getActiveChainLocator(const uint256& block_hash) override
|
CBlockLocator getActiveChainLocator(const uint256& block_hash) override
|
||||||
{
|
{
|
||||||
LOCK(::cs_main);
|
LOCK(::cs_main);
|
||||||
|
|||||||
+1
-1
@@ -2919,7 +2919,7 @@ bool Chainstate::FlushStateToDisk(
|
|||||||
}
|
}
|
||||||
if (full_flush_completed && m_chainman.m_options.signals) {
|
if (full_flush_completed && m_chainman.m_options.signals) {
|
||||||
// Update best block in wallet (so we can detect restored wallets).
|
// Update best block in wallet (so we can detect restored wallets).
|
||||||
m_chainman.m_options.signals->ChainStateFlushed(this->GetRole(), m_chain.GetLocator());
|
m_chainman.m_options.signals->ChainStateFlushed(this->GetRole(), GetLocator(m_chain.Tip()));
|
||||||
}
|
}
|
||||||
} catch (const std::runtime_error& e) {
|
} catch (const std::runtime_error& e) {
|
||||||
return FatalError(m_chainman.GetNotifications(), state, strprintf(_("System error while flushing: %s"), e.what()));
|
return FatalError(m_chainman.GetNotifications(), state, strprintf(_("System error while flushing: %s"), e.what()));
|
||||||
|
|||||||
Reference in new issue
Block a user