mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
GUI: Use CT address for examples
This commit is contained in:
parent
0d11cd0de9
commit
d4d45b6f0a
1 changed files with 5 additions and 3 deletions
|
|
@ -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<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)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue