Generate a dummy address with invalid CRC, starting with the network prefix.
| 92 | |
| 93 | // Generate a dummy address with invalid CRC, starting with the network prefix. |
| 94 | static std::string DummyAddress(const CChainParams ¶ms) |
| 95 | { |
| 96 | std::vector<unsigned char> sourcedata = params.Base58Prefix(CChainParams::PUBKEY_ADDRESS); |
| 97 | sourcedata.insert(sourcedata.end(), dummydata, dummydata + sizeof(dummydata)); |
| 98 | for(int i=0; i<256; ++i) { // Try every trailing byte |
| 99 | std::string s = EncodeBase58(sourcedata.data(), sourcedata.data() + sourcedata.size()); |
| 100 | if (!IsValidDestinationString(s)) { |
| 101 | return s; |
| 102 | } |
| 103 | sourcedata[sourcedata.size()-1] += 1; |
| 104 | } |
| 105 | return ""; |
| 106 | } |
| 107 | |
| 108 | void setupAddressWidget(QValidatedLineEdit *widget, QWidget *parent) |
| 109 | { |
no test coverage detected