Change wallet prefix to dn_

This commit is contained in:
Minecon724 2025-08-31 06:52:23 +02:00
commit 7d595911c7
Signed by: Minecon724
GPG key ID: A02E6E67AB961189

View file

@ -77,7 +77,7 @@ void nano::public_key::encode_account (std::ostream & os) const
}
// Write prefix
os << "nano_";
os << "dn_";
// Write encoded characters
os.write (encoded.data (), encoded.size ());
@ -97,7 +97,7 @@ nano::public_key const & nano::public_key::null ()
std::string nano::public_key::to_node_id () const
{
return to_account ().replace (0, 4, "node");
return to_account ().replace (0, 2, "node");
}
bool nano::public_key::decode_node_id (std::string const & source_a)
@ -112,13 +112,14 @@ bool nano::public_key::decode_account (std::string const & source_a)
{
auto xrb_prefix (source_a[0] == 'x' && source_a[1] == 'r' && source_a[2] == 'b' && (source_a[3] == '_' || source_a[3] == '-'));
auto nano_prefix (source_a[0] == 'n' && source_a[1] == 'a' && source_a[2] == 'n' && source_a[3] == 'o' && (source_a[4] == '_' || source_a[4] == '-'));
auto dn_prefix (source_a[0] == 'd' && source_a[1] == 'n' && (source_a[2] == '_' || source_a[2] == '-'));
auto node_id_prefix = (source_a[0] == 'n' && source_a[1] == 'o' && source_a[2] == 'd' && source_a[3] == 'e' && source_a[4] == '_');
error = (xrb_prefix && source_a.size () != 64) || (nano_prefix && source_a.size () != 65);
error = (xrb_prefix && source_a.size () != 64) || (nano_prefix && source_a.size () != 65) || (dn_prefix && source_a.size () != 63);
if (!error)
{
if (xrb_prefix || nano_prefix || node_id_prefix)
if (xrb_prefix || nano_prefix || dn_prefix || node_id_prefix)
{
auto i (source_a.begin () + (xrb_prefix ? 4 : 5));
auto i (source_a.begin () + (xrb_prefix ? 4 : (nano_prefix ? 5 : 3)));
if (*i == '1' || *i == '3')
{
nano::uint512_t number_l;