Skip to content

Commit

Permalink
GUI: Use CT address for examples
Browse files Browse the repository at this point in the history
  • Loading branch information
luke-jr authored and instagibbs committed Apr 9, 2019
1 parent 0d11cd0 commit d4d45b6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/qt/guiutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,15 @@ QFont fixedPitchFont()
}

// Just some dummy data to generate a convincing random-looking (but consistent) address
static const uint8_t dummydata[] = {0xeb,0x15,0x23,0x1d,0xfc,0xeb,0x60,0x92,0x58,0x86,0xb6,0x7d,0x06,0x52,0x99,0x92,0x59,0x15,0xae,0xb1,0x72,0xc0,0x66,0x47};
static const uint8_t dummydata[33] = {3};

// Generate a dummy address with invalid CRC, starting with the network prefix.
static std::string DummyAddress(const CChainParams &params)
{
std::vector<unsigned char> sourcedata = params.Base58Prefix(CChainParams::PUBKEY_ADDRESS);
sourcedata.insert(sourcedata.end(), dummydata, dummydata + sizeof(dummydata));
std::vector<unsigned char> sourcedata;
CPubKey dummy_key(&dummydata[0], &dummydata[33]);
ScriptHash script_dest(uint160(), dummy_key);
DecodeBase58(EncodeDestination(script_dest), sourcedata);
for(int i=0; i<256; ++i) { // Try every trailing byte
std::string s = EncodeBase58(sourcedata.data(), sourcedata.data() + sourcedata.size());
if (!IsValidDestinationString(s)) {
Expand Down

0 comments on commit d4d45b6

Please sign in to comment.