From d4d45b6f0ae13403c22537e594a6051dad7c499a Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Tue, 8 Jan 2019 15:48:50 +0000 Subject: [PATCH] GUI: Use CT address for examples --- src/qt/guiutil.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index 74522ea695..b917d88015 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -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 ¶ms) { - std::vector sourcedata = params.Base58Prefix(CChainParams::PUBKEY_ADDRESS); - sourcedata.insert(sourcedata.end(), dummydata, dummydata + sizeof(dummydata)); + std::vector 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)) {