From 7d595911c72501fe0837666d8f54ca46482d139d Mon Sep 17 00:00:00 2001 From: Minecon724 Date: Sun, 31 Aug 2025 06:52:23 +0200 Subject: [PATCH] Change wallet prefix to dn_ --- nano/lib/numbers.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/nano/lib/numbers.cpp b/nano/lib/numbers.cpp index 00ad310a..fd826d43 100644 --- a/nano/lib/numbers.cpp +++ b/nano/lib/numbers.cpp @@ -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;