(252 . 14)(252 . 14)
5 };
6
7 // base58-encoded bitcoin addresses
8 // Addresses have version 0 or 111 (testnet)
9 // Addresses have version 0
10 // The data vector contains RIPEMD160(SHA256(pubkey)), where pubkey is the serialized public key
11 class CBitcoinAddress : public CBase58Data
12 {
13 public:
14 bool SetHash160(const uint160& hash160)
15 {
16 SetData(fTestNet ? 111 : 0, &hash160, 20);
17 SetData(0, &hash160, 20);
18 return true;
19 }
20
(271 . 20)(271 . 15)
22 bool IsValid() const
23 {
24 int nExpectedSize = 20;
25 bool fExpectTestNet = false;
26 switch(nVersion)
27 {
28 case 0:
29 break;
30
31 case 111:
32 fExpectTestNet = true;
33 break;
34
35 default:
36 return false;
37 }
38 return fExpectTestNet == fTestNet && vchData.size() == nExpectedSize;
39 return vchData.size() == nExpectedSize;
40 }
41
42 CBitcoinAddress()