| 331 | } // namespace |
| 332 | |
| 333 | class CBitcoinAddressVisitor : public boost::static_visitor<bool> |
| 334 | { |
| 335 | private: |
| 336 | CBitcoinAddress* addr; |
| 337 | |
| 338 | public: |
| 339 | CBitcoinAddressVisitor(CBitcoinAddress* addrIn) : addr(addrIn) {} |
| 340 | |
| 341 | bool operator()(const CKeyID& id) const { return addr->Set(id); } |
| 342 | bool operator()(const CScriptID& id) const { return addr->Set(id); } |
| 343 | bool operator()(const WitnessV0KeyHash& id) const { return addr; } |
| 344 | bool operator()(const WitnessV0ScriptHash& id) const { return addr; } |
| 345 | bool operator()(const WitnessUnknown& id) const { return addr; } |
| 346 | bool operator()(const CNoDestination& no) const { return false; } |
| 347 | }; |
| 348 | |
| 349 | bool CBitcoinAddress::Set(const CKeyID& id) |
| 350 | { |