mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-05 10:42:13 +02:00
[wallet] Move getHeight from Chain::Lock interface to simple Chain
Instead of calling getHeight, we rely on CWallet::m_last_block processed_height where it's possible.
This commit is contained in:
@@ -87,11 +87,6 @@ public:
|
||||
public:
|
||||
virtual ~Lock() {}
|
||||
|
||||
//! Get current chain height, not including genesis block (returns 0 if
|
||||
//! chain only contains genesis block, nullopt if chain does not contain
|
||||
//! any blocks).
|
||||
virtual Optional<int> getHeight() = 0;
|
||||
|
||||
//! Get block height above genesis block. Returns 0 for genesis block,
|
||||
//! 1 for following block, and so on. Returns nullopt for a block not
|
||||
//! included in the current chain.
|
||||
@@ -135,6 +130,11 @@ public:
|
||||
//! unlocked when the returned interface is freed.
|
||||
virtual std::unique_ptr<Lock> lock(bool try_lock = false) = 0;
|
||||
|
||||
//! Get current chain height, not including genesis block (returns 0 if
|
||||
//! chain only contains genesis block, nullopt if chain does not contain
|
||||
//! any blocks)
|
||||
virtual Optional<int> getHeight() = 0;
|
||||
|
||||
//! Return whether node has the block and optionally return block metadata
|
||||
//! or contents.
|
||||
virtual bool findBlock(const uint256& hash, const FoundBlock& block={}) = 0;
|
||||
|
||||
Reference in New Issue
Block a user