| 10 | #include "script/standard.h" |
| 11 | |
| 12 | std::string EncodeDestination(const CTxDestination &dst, |
| 13 | const CChainParams ¶ms, |
| 14 | const Config &cfg, |
| 15 | bool tokenAwareAddress) |
| 16 | { |
| 17 | if (cfg.UseCashAddrEncoding()) |
| 18 | { |
| 19 | return EncodeCashAddr(dst, params, tokenAwareAddress); |
| 20 | } |
| 21 | if (tokenAwareAddress) |
| 22 | { |
| 23 | throw std::runtime_error("Legacy addresses don't support token-awareness"); |
| 24 | } |
| 25 | return EncodeLegacyAddr(dst, params); |
| 26 | } |
| 27 | |
| 28 | CTxDestination DecodeDestination(const std::string &addr, const CChainParams ¶ms, bool *tokenAwareAddressOut) |
| 29 | { |