MCPcopy Create free account
hub / github.com/LUX-Core/lux / GetDestinationForKey

Function GetDestinationForKey

src/wallet.cpp:4674–4691  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4672}
4673
4674CTxDestination GetDestinationForKey(const CPubKey& key, OutputType type)
4675{
4676 switch (type) {
4677 case OUTPUT_TYPE_LEGACY: return key.GetID();
4678 case OUTPUT_TYPE_P2SH_SEGWIT:
4679 case OUTPUT_TYPE_BECH32: {
4680 if (!key.IsCompressed()) return key.GetID();
4681 CTxDestination witdest = WitnessV0KeyHash(key.GetID());
4682 CScript witprog = GetScriptForDestination(witdest);
4683 if (type == OUTPUT_TYPE_P2SH_SEGWIT) {
4684 return CScriptID(witprog);
4685 } else {
4686 return witdest;
4687 }
4688 }
4689 default: assert(false);
4690 }
4691}
4692
4693std::vector<CTxDestination> GetAllDestinationsForKey(const CPubKey& key)
4694{

Callers 5

getnewaddressFunction · 0.85
getrawchangeaddressFunction · 0.85
GetAccountDestinationMethod · 0.85
CreateTransactionMethod · 0.85
addRowMethod · 0.85

Calls 5

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

Tested by

no test coverage detected