MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / DummyAddress

Function DummyAddress

src/qt/guiutil.cpp:94–106  ·  view source on GitHub ↗

Generate a dummy address with invalid CRC, starting with the network prefix.

Source from the content-addressed store, hash-verified

92
93// Generate a dummy address with invalid CRC, starting with the network prefix.
94static std::string DummyAddress(const CChainParams &params)
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
108void setupAddressWidget(QValidatedLineEdit *widget, QWidget *parent)
109{

Callers 1

setupAddressWidgetFunction · 0.85

Calls 6

EncodeBase58Function · 0.85
IsValidDestinationStringFunction · 0.85
insertMethod · 0.45
endMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected