mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Rename getTipHash() to getTip() and return BlockRef
This commit is contained in:
parent
89a8f74bbb
commit
ebb8215f23
3 changed files with 9 additions and 6 deletions
|
|
@ -17,6 +17,7 @@
|
|||
#include <interfaces/handler.h>
|
||||
#include <interfaces/mining.h>
|
||||
#include <interfaces/node.h>
|
||||
#include <interfaces/types.h>
|
||||
#include <interfaces/wallet.h>
|
||||
#include <kernel/chain.h>
|
||||
#include <kernel/context.h>
|
||||
|
|
@ -67,6 +68,7 @@
|
|||
|
||||
#include <boost/signals2/signal.hpp>
|
||||
|
||||
using interfaces::BlockRef;
|
||||
using interfaces::BlockTemplate;
|
||||
using interfaces::BlockTip;
|
||||
using interfaces::Chain;
|
||||
|
|
@ -925,12 +927,12 @@ public:
|
|||
return chainman().IsInitialBlockDownload();
|
||||
}
|
||||
|
||||
std::optional<uint256> getTipHash() override
|
||||
std::optional<BlockRef> getTip() override
|
||||
{
|
||||
LOCK(::cs_main);
|
||||
CBlockIndex* tip{chainman().ActiveChain().Tip()};
|
||||
if (!tip) return {};
|
||||
return tip->GetBlockHash();
|
||||
return BlockRef{tip->GetBlockHash(), tip->nHeight};
|
||||
}
|
||||
|
||||
bool processNewBlock(const std::shared_ptr<const CBlock>& block, bool* new_block) override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue