MCPcopy Create free account
hub / github.com/ElementsProject/elements / operator[]

Method operator[]

src/chain.h:591–596  ·  view source on GitHub ↗

Returns the index entry at a particular height in this chain, or nullptr if no such height exists. */

Source from the content-addressed store, hash-verified

589
590 /** Returns the index entry at a particular height in this chain, or nullptr if no such height exists. */
591 CBlockIndex* operator[](int nHeight) const
592 {
593 if (nHeight < 0 || nHeight >= (int)vChain.size())
594 return nullptr;
595 return vChain[nHeight];
596 }
597
598 /** Efficiently check whether a block is present in this chain. */
599 bool Contains(const CBlockIndex* pindex) const

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected