MCPcopy Create free account
hub / github.com/citp/BlockSci / getNestingScriptHash

Method getNestingScriptHash

src/internal/address_index.cpp:169–183  ·  view source on GitHub ↗

Retrieve a list of dedup addresses that wrap the address. It's possible to receive multiple results, since multisig addresses are deduplicated, but their pubkeys might be arranged in different order, leading to different wrapping addresses. */

Source from the content-addressed store, hash-verified

167 It's possible to receive multiple results, since multisig addresses are deduplicated, but their pubkeys might be arranged in different order, leading to different wrapping addresses.
168 */
169 std::vector<DedupAddress> AddressIndex::getNestingScriptHash(const RawAddress &searchAddress) const {
170 std::vector<DedupAddress> parents;
171 rocksdb::Slice key{reinterpret_cast<const char *>(&searchAddress.scriptNum), sizeof(searchAddress.scriptNum)};
172 auto it = getNestedIterator(searchAddress.type);
173 it->Seek(key);
174 while (it->Valid() && it->key().starts_with(key)) {
175 auto foundKey = it->key();
176 foundKey.remove_prefix(sizeof(uint32_t));
177 DedupAddress rawParent;
178 memcpy(&rawParent, foundKey.data(), sizeof(rawParent));
179 parents.push_back(rawParent);
180 it->Next();
181 }
182 return parents;
183 }
184
185 std::unordered_set<DedupAddress> AddressIndex::getPossibleNestedEquivalentUp(const RawAddress &searchAddress) const {
186 std::unordered_set<RawAddress> addressesToSearch{searchAddress};

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected