Generate a dummy address with invalid CRC, starting with the network prefix.
| 103 | |
| 104 | // Generate a dummy address with invalid CRC, starting with the network prefix. |
| 105 | static std::string DummyAddress(const CChainParams ¶ms) |
| 106 | { |
| 107 | std::vector<unsigned char> dummydata = ParseHex("02217226f8114ad5807e90402a534ff3311a44f498ce5c0f1f56ccd9e60383d01e"); |
| 108 | std::vector<unsigned char> sourcedata; |
| 109 | CPubKey dummy_key(dummydata); |
| 110 | ScriptHash script_dest(CScriptID(), dummy_key); |
| 111 | std::string dest_str = EncodeDestination(script_dest); |
| 112 | if (!DecodeBase58(dest_str, sourcedata, 21)) { |
| 113 | return ""; |
| 114 | } |
| 115 | for(int i=0; i<256; ++i) { // Try every trailing byte |
| 116 | std::string s = EncodeBase58(sourcedata); |
| 117 | if (!IsValidDestinationString(s)) { |
| 118 | return s; |
| 119 | } |
| 120 | sourcedata[sourcedata.size()-1] += 1; |
| 121 | } |
| 122 | return ""; |
| 123 | } |
| 124 | |
| 125 | void setupAddressWidget(QValidatedLineEdit *widget, QWidget *parent) |
| 126 | { |
no test coverage detected