From aa64124c287f5d15a8cb9766128a67bb2e54d5b4 Mon Sep 17 00:00:00 2001 From: Some Random Crypto Guy Date: Fri, 14 Feb 2025 13:28:22 +0000 Subject: [PATCH] fix for supply_info command with SAL supply going negative --- README.md | 10 +++++----- src/blockchain_db/lmdb/db_lmdb.cpp | 5 +++++ src/version.cpp.in | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 5f08cfc..9b5137d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Salvium Zero v0.9.2 +# Salvium Zero v0.9.3 Copyright (c) 2023-2024, Salvium Portions Copyright (c) 2014-2023, The Monero Project @@ -172,7 +172,7 @@ invokes cmake commands as needed. ```bash cd salvium - git checkout v0.9.2 + git checkout v0.9.3 make ``` @@ -251,7 +251,7 @@ Tested on a Raspberry Pi Zero with a clean install of minimal Raspbian Stretch ( ```bash git clone https://github.com/salvium/salvium cd salvium - git checkout v0.9.2 + git checkout v0.9.3 ``` * Build: @@ -370,10 +370,10 @@ application. cd salvium ``` -* If you would like a specific [version/tag](https://github.com/salvium/salvium/tags), do a git checkout for that version. eg. 'v0.9.2'. If you don't care about the version and just want binaries from master, skip this step: +* If you would like a specific [version/tag](https://github.com/salvium/salvium/tags), do a git checkout for that version. eg. 'v0.9.3'. If you don't care about the version and just want binaries from master, skip this step: ```bash - git checkout v0.9.2 + git checkout v0.9.3 ``` * If you are on a 64-bit system, run: diff --git a/src/blockchain_db/lmdb/db_lmdb.cpp b/src/blockchain_db/lmdb/db_lmdb.cpp index 935bfb1..f9b5d3b 100644 --- a/src/blockchain_db/lmdb/db_lmdb.cpp +++ b/src/blockchain_db/lmdb/db_lmdb.cpp @@ -3778,6 +3778,11 @@ std::map BlockchainLMDB::get_circulating_supply() const //amount += m_coinbase; } + if (amount < 0) { + // Negative number can't be converted to a 64-bit UINT, so return 0, but retain -ve number privately + LOG_PRINT_L2("BlockchainLMDB::" << __func__ << " - supply of " << currency_label << " is negative (" << amount << ") but outputting zero"); + amount = 0; + } circulating_supply[currency_label] = amount.convert_to(); } diff --git a/src/version.cpp.in b/src/version.cpp.in index 88aa1d6..d28dc6a 100644 --- a/src/version.cpp.in +++ b/src/version.cpp.in @@ -1,5 +1,5 @@ #define DEF_SALVIUM_VERSION_TAG "@VERSIONTAG@" -#define DEF_SALVIUM_VERSION "0.9.2" +#define DEF_SALVIUM_VERSION "0.9.3" #define DEF_MONERO_VERSION_TAG "release" #define DEF_MONERO_VERSION "0.18.3.3" #define DEF_MONERO_RELEASE_NAME "Zero"