mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-13 12:33:42 +02:00
QT: dummy address needs fully valid pubkey
This commit is contained in:
parent
c227c65a13
commit
93e26608c2
1 changed files with 4 additions and 5 deletions
|
|
@ -87,16 +87,15 @@ QFont fixedPitchFont()
|
|||
#endif
|
||||
}
|
||||
|
||||
// Just some dummy data to generate a convincing random-looking (but consistent) address
|
||||
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> dummydata = ParseHex("02217226f8114ad5807e90402a534ff3311a44f498ce5c0f1f56ccd9e60383d01e");
|
||||
std::vector<unsigned char> sourcedata;
|
||||
CPubKey dummy_key(&dummydata[0], &dummydata[33]);
|
||||
CPubKey dummy_key(dummydata);
|
||||
ScriptHash script_dest(uint160(), dummy_key);
|
||||
DecodeBase58(EncodeDestination(script_dest), sourcedata);
|
||||
std::string dest_str = EncodeDestination(script_dest);
|
||||
DecodeBase58(dest_str, 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