[wallet] Move getBlockHeight from Chain::Lock interface to simple Chain

Add HaveChain to assert chain access for wallet-tool in LoadToWallet.
This commit is contained in:
Antoine Riard
2019-07-15 18:20:12 -04:00
parent b855592d83
commit de13363a47
4 changed files with 20 additions and 18 deletions

View File

@@ -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;