From 035f82f605666afea958f15bae4c78dc00adc630 Mon Sep 17 00:00:00 2001 From: sowle Date: Wed, 9 Aug 2023 13:48:36 +0200 Subject: [PATCH] minor fix for sequence factor comparison in on_get_pos_mining_details() --- src/currency_core/currency_config.h | 2 +- src/rpc/core_rpc_server.cpp | 2 +- src/wallet/wallet2.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/currency_core/currency_config.h b/src/currency_core/currency_config.h index 68194132..2a2a5d69 100644 --- a/src/currency_core/currency_config.h +++ b/src/currency_core/currency_config.h @@ -159,7 +159,7 @@ #else # define BLOCKCHAIN_HEIGHT_FOR_POS_STRICT_SEQUENCE_LIMITATION 18000 #endif -#define BLOCK_POS_STRICT_SEQUENCE_LIMIT 20 +#define BLOCK_POS_STRICT_SEQUENCE_LIMIT 20 // the highest allowed sequence factor for a PoS block (i.e., the max total number of sequential PoS blocks is BLOCK_POS_STRICT_SEQUENCE_LIMIT + 1) #define WALLET_FILE_SIGNATURE_OLD 0x1111012101101011LL // Bender's nightmare diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp index 826f84d3..7c36e0ee 100644 --- a/src/rpc/core_rpc_server.cpp +++ b/src/rpc/core_rpc_server.cpp @@ -543,7 +543,7 @@ namespace currency res.pos_sequence_factor_is_good = true; uint64_t new_block_expected_height = m_core.get_blockchain_storage().get_top_block_height() + 1; - size_t new_block_expected_sequence_factor = m_core.get_blockchain_storage().get_current_sequence_factor(true) + 1; + size_t new_block_expected_sequence_factor = m_core.get_blockchain_storage().get_current_sequence_factor(true); if (new_block_expected_height > BLOCKCHAIN_HEIGHT_FOR_POS_STRICT_SEQUENCE_LIMITATION && new_block_expected_sequence_factor > BLOCK_POS_STRICT_SEQUENCE_LIMIT) res.pos_sequence_factor_is_good = false; diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 30a7db01..1cd051f9 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -4281,7 +4281,7 @@ bool wallet2::try_mint_pos(const currency::account_public_address& miner_address if (!ctx.is_pos_sequence_factor_good) { - WLT_LOG_YELLOW("PoS sequence factor is too big, waiting for a PoW block...", LOG_LEVEL_0); + WLT_LOG_YELLOW("PoS sequence factor is too high, waiting for a PoW block...", LOG_LEVEL_0); return true; }