MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / GetWalletAddressesForKey

Function GetWalletAddressesForKey

src/wallet/rpcdump.cpp:68–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66}
67
68static bool GetWalletAddressesForKey(CWallet * const pwallet, const CKeyID &keyid, std::string &strAddr, std::string &strLabel)
69{
70 bool fLabelFound = false;
71 CKey key;
72 pwallet->GetKey(keyid, key);
73 for (const auto& dest : GetAllDestinationsForKey(key.GetPubKey())) {
74 if (pwallet->mapAddressBook.count(dest)) {
75 if (!strAddr.empty()) {
76 strAddr += ",";
77 }
78 strAddr += EncodeDestination(dest);
79 strLabel = EncodeDumpString(pwallet->mapAddressBook[dest].name);
80 fLabelFound = true;
81 }
82 }
83 if (!fLabelFound) {
84 strAddr = EncodeDestination(GetDestinationForKey(key.GetPubKey(), pwallet->m_default_address_type));
85 }
86 return fLabelFound;
87}
88
89static const int64_t TIMESTAMP_MIN = 0;
90

Callers 1

dumpwalletFunction · 0.85

Calls 8

GetAllDestinationsForKeyFunction · 0.85
EncodeDestinationFunction · 0.85
EncodeDumpStringFunction · 0.85
GetDestinationForKeyFunction · 0.85
GetKeyMethod · 0.45
GetPubKeyMethod · 0.45
countMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected