cryptonote: fix get_unit for non default settings

Found by codacy.com
This commit is contained in:
moneromooo-monero 2018-11-23 13:51:58 +00:00
parent d4f50cb109
commit 5d9915ab9e
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3

View file

@ -883,7 +883,7 @@ namespace cryptonote
{ {
if (decimal_point == (unsigned int)-1) if (decimal_point == (unsigned int)-1)
decimal_point = default_decimal_point; decimal_point = default_decimal_point;
switch (std::atomic_load(&default_decimal_point)) switch (decimal_point)
{ {
case 12: case 12:
return "monero"; return "monero";
@ -896,7 +896,7 @@ namespace cryptonote
case 0: case 0:
return "piconero"; return "piconero";
default: default:
ASSERT_MES_AND_THROW("Invalid decimal point specification: " << default_decimal_point); ASSERT_MES_AND_THROW("Invalid decimal point specification: " << decimal_point);
} }
} }
//--------------------------------------------------------------- //---------------------------------------------------------------