aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/chain.h
diff options
context:
space:
mode:
authorAntoine Riard <ariard@student.42.fr>2019-07-09 20:07:39 -0400
committerAntoine Riard <ariard@student.42.fr>2020-04-30 14:31:19 -0400
commitb855592d835bf4b3fb1263b88d4f96669a1722b1 (patch)
tree8e36d5158106b46fb12b4bb1813eb0685a03d0a7 /src/interfaces/chain.h
parent0f204dd3f21b997334a0e99954c939db154b64ca (diff)
downloadbitcoin-b855592d835bf4b3fb1263b88d4f96669a1722b1.tar.xz
[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.
Diffstat (limited to 'src/interfaces/chain.h')
-rw-r--r--src/interfaces/chain.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/interfaces/chain.h b/src/interfaces/chain.h
index fb77c81cdc..03635fd74f 100644
--- a/src/interfaces/chain.h
+++ b/src/interfaces/chain.h
@@ -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;