aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/chain.h
diff options
context:
space:
mode:
authorAntoine Riard <ariard@student.42.fr>2019-07-15 18:20:12 -0400
committerAntoine Riard <ariard@student.42.fr>2020-04-30 14:37:21 -0400
commitde13363a472ea30dff2f8f55c6ae572281115380 (patch)
tree7e220b1927512f48b0c39d6c0120e6e99e22074b /src/interfaces/chain.h
parentb855592d835bf4b3fb1263b88d4f96669a1722b1 (diff)
[wallet] Move getBlockHeight from Chain::Lock interface to simple Chain
Add HaveChain to assert chain access for wallet-tool in LoadToWallet.
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 03635fd74f..b85484c11b 100644
--- a/src/interfaces/chain.h
+++ b/src/interfaces/chain.h
@@ -87,11 +87,6 @@ public:
public:
virtual ~Lock() {}
- //! 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.
- virtual Optional<int> getBlockHeight(const uint256& hash) = 0;
-
//! Get block hash. Height must be valid or this function will abort.
virtual uint256 getBlockHash(int height) = 0;
@@ -135,6 +130,11 @@ public:
//! 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.
+ virtual Optional<int> getBlockHeight(const uint256& hash) = 0;
+
//! Return whether node has the block and optionally return block metadata
//! or contents.
virtual bool findBlock(const uint256& hash, const FoundBlock& block={}) = 0;