| 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 | { |
nothing calls this directly
no test coverage detected