MCPcopy Create free account
hub / github.com/ElementsProject/elements / BlindingPubkeyVisitor

Class BlindingPubkeyVisitor

src/rpc/util.cpp:1080–1124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1078// ELEMENTS
1079
1080class BlindingPubkeyVisitor
1081{
1082public:
1083 explicit BlindingPubkeyVisitor() {}
1084
1085 CPubKey operator()(const CNoDestination& dest) const
1086 {
1087 return CPubKey();
1088 }
1089
1090 CPubKey operator()(const PKHash& keyID) const
1091 {
1092 return keyID.blinding_pubkey;
1093 }
1094
1095 CPubKey operator()(const ScriptHash& scriptID) const
1096 {
1097 return scriptID.blinding_pubkey;
1098 }
1099
1100 CPubKey operator()(const WitnessV0KeyHash& id) const
1101 {
1102 return id.blinding_pubkey;
1103 }
1104
1105 CPubKey operator()(const WitnessV0ScriptHash& id) const
1106 {
1107 return id.blinding_pubkey;
1108 }
1109
1110 CPubKey operator()(const WitnessV1Taproot& tap) const
1111 {
1112 return tap.blinding_pubkey;
1113 }
1114
1115 CPubKey operator()(const WitnessUnknown& id) const
1116 {
1117 return id.blinding_pubkey;
1118 }
1119
1120 CPubKey operator()(const NullData& id) const
1121 {
1122 return CPubKey();
1123 }
1124};
1125
1126CPubKey GetDestinationBlindingKey(const CTxDestination& dest) {
1127 return std::visit(BlindingPubkeyVisitor(), dest);

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected