diff --git a/nano/lib/numbers.cpp b/nano/lib/numbers.cpp index fd826d43..af667f7c 100644 --- a/nano/lib/numbers.cpp +++ b/nano/lib/numbers.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include @@ -11,6 +12,8 @@ #include #include +bool nano_wallet_compatibility_mode = nano::env::get ("NANO_WALLET_COMPATIBILITY").value_or(false); + namespace { char const * account_lookup ("13456789abcdefghijkmnopqrstuwxyz"); @@ -77,7 +80,7 @@ void nano::public_key::encode_account (std::ostream & os) const } // Write prefix - os << "dn_"; + os << (nano_wallet_compatibility_mode ? "nano_" : "dn_"); // Write encoded characters os.write (encoded.data (), encoded.size ()); @@ -97,7 +100,7 @@ nano::public_key const & nano::public_key::null () std::string nano::public_key::to_node_id () const { - return to_account ().replace (0, 2, "node"); + return to_account ().replace (0, nano_wallet_compatibility_mode ? 4 : 2, "node"); } bool nano::public_key::decode_node_id (std::string const & source_a)