MCPcopy Create free account
hub / github.com/ElementsProject/elements / getHeight

Method getHeight

src/node/interfaces.cpp:458–467  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

456public:
457 explicit ChainImpl(NodeContext& node) : m_node(node) {}
458 std::optional<int> getHeight() override
459 {
460 LOCK(::cs_main);
461 const CChain& active = Assert(m_node.chainman)->ActiveChain();
462 int height = active.Height();
463 if (height >= 0) {
464 return height;
465 }
466 return std::nullopt;
467 }
468 uint256 getBlockHash(int height) override
469 {
470 LOCK(::cs_main);

Callers 1

AttachChainMethod · 0.80

Calls 1

HeightMethod · 0.80

Tested by

no test coverage detected