Changeset View
Changeset View
Standalone View
Standalone View
src/cashaddrenc.cpp
Show First 20 Lines • Show All 106 Lines • ▼ Show 20 Lines | if (content.hash.size() == 0) { | ||||
return CNoDestination{}; | return CNoDestination{}; | ||||
} | } | ||||
return DecodeCashAddrDestination(content); | return DecodeCashAddrDestination(content); | ||||
} | } | ||||
CashAddrContent DecodeCashAddrContent(const std::string &addr, | CashAddrContent DecodeCashAddrContent(const std::string &addr, | ||||
const std::string &expectedPrefix) { | const std::string &expectedPrefix) { | ||||
std::string prefix; | auto [prefix, payload] = cashaddr::Decode(addr, expectedPrefix); | ||||
std::vector<uint8_t> payload; | |||||
std::tie(prefix, payload) = cashaddr::Decode(addr, expectedPrefix); | |||||
if (prefix != expectedPrefix) { | if (prefix != expectedPrefix) { | ||||
return {}; | return {}; | ||||
} | } | ||||
if (payload.empty()) { | if (payload.empty()) { | ||||
return {}; | return {}; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 55 Lines • Show Last 20 Lines |