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

Method GetTxIndexInBlock

src/tests/system_test.cpp:95–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93 }
94
95 bool GetTxIndexInBlock(const uint256& txid, int& index) {
96 CBlockIndex* pIndex = chainActive.Tip();
97 CBlock block;
98 if (!ReadBlockFromDisk(pIndex, block))
99 return false;
100
101 block.BuildMerkleTree();
102 std::tuple<bool,int> ret = block.GetTxIndex(txid);
103 if (!std::get<0>(ret)) {
104 return false;
105 }
106
107 index = std::get<1>(ret);
108 return true;
109 }
110
111 bool GetRegScript(map<string, string>& mapRegScript) {
112 CRegID regId;

Callers

nothing calls this directly

Calls 4

ReadBlockFromDiskFunction · 0.85
TipMethod · 0.80
BuildMerkleTreeMethod · 0.80
GetTxIndexMethod · 0.80

Tested by

no test coverage detected