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

Function GetDestinationForKey

src/outputtype.cpp:45–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43}
44
45CTxDestination GetDestinationForKey(const CPubKey& key, OutputType type)
46{
47 switch (type) {
48 case OutputType::LEGACY: return key.GetID();
49 case OutputType::P2SH_SEGWIT:
50 case OutputType::BECH32: {
51 if (!key.IsCompressed()) return key.GetID();
52 CTxDestination witdest = WitnessV0KeyHash(key.GetID());
53 CScript witprog = GetScriptForDestination(witdest);
54 if (type == OutputType::P2SH_SEGWIT) {
55 return CScriptID(witprog);
56 } else {
57 return witdest;
58 }
59 }
60 default: assert(false);
61 }
62}
63
64std::vector<CTxDestination> GetAllDestinationsForKey(const CPubKey& key)
65{

Callers 9

getnewaddressFunction · 0.85
getrawchangeaddressFunction · 0.85
GetWalletAddressesForKeyFunction · 0.85
GetLabelDestinationMethod · 0.85
CreateTransactionMethod · 0.85
fetchPaymentACKMethod · 0.85
addRowMethod · 0.85
TestGUIFunction · 0.85

Calls 5

WitnessV0KeyHashClass · 0.85
GetScriptForDestinationFunction · 0.85
GetIDMethod · 0.80
CScriptIDClass · 0.70
IsCompressedMethod · 0.45

Tested by 2

TestGUIFunction · 0.68