MCPcopy Create free account
hub / github.com/ElementsProject/elements / operator()

Method operator()

src/key_io.cpp:34–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32 explicit DestinationEncoder(const CChainParams& params, const bool for_parent) : m_params(params), for_parent(for_parent) {}
33
34 std::string operator()(const PKHash& id) const
35 {
36 if (id.blinding_pubkey.IsFullyValid()) {
37 std::vector<unsigned char> data = m_params.Base58Prefix(CChainParams::BLINDED_ADDRESS);
38 // Blinded addresses have the actual address type prefix inside the payload.
39 std::vector<unsigned char> prefix = m_params.Base58Prefix(CChainParams::PUBKEY_ADDRESS);
40 data.insert(data.end(), prefix.begin(), prefix.end());
41 data.insert(data.end(), id.blinding_pubkey.begin(), id.blinding_pubkey.end());
42 data.insert(data.end(), id.begin(), id.end());
43 return EncodeBase58Check(data);
44 }
45
46 CChainParams::Base58Type type = for_parent ? CChainParams::PARENT_PUBKEY_ADDRESS : CChainParams::PUBKEY_ADDRESS;
47 std::vector<unsigned char> data = m_params.Base58Prefix(type);
48 data.insert(data.end(), id.begin(), id.end());
49 return EncodeBase58Check(data);
50 }
51
52 std::string operator()(const ScriptHash& id) const
53 {

Callers

nothing calls this directly

Calls 8

EncodeBase58CheckFunction · 0.85
IsFullyValidMethod · 0.80
EncodeFunction · 0.70
insertMethod · 0.45
endMethod · 0.45
beginMethod · 0.45
reserveMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected