MCPcopy Create free account
hub / github.com/WaykiChain/WaykiChain / GetTxIndex

Method GetTxIndex

src/persistence/block.cpp:123–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121}
122
123std::tuple<bool, int> CBlock::GetTxIndex(const uint256& txid) const {
124 for (size_t i = 0; i < vMerkleTree.size(); i++) {
125 if (txid == vMerkleTree[i]) {
126 return std::make_tuple(true, i);
127 }
128 }
129
130 return std::make_tuple(false, 0);
131}
132
133//////////////////////////////////////////////////////////////////////////////
134// global functions

Callers 3

GetTxIndexInBlockMethod · 0.80
IsTxInTipBlockMethod · 0.80
getcontractregidFunction · 0.80

Calls 1

sizeMethod · 0.45

Tested by 2

GetTxIndexInBlockMethod · 0.64
IsTxInTipBlockMethod · 0.64