From e92822b61eb27380a6816949eedc012c20eb1b82 Mon Sep 17 00:00:00 2001 From: blondfrogs <8285518+blondfrogs@users.noreply.github.com> Date: Mon, 30 Jan 2023 10:09:21 -0700 Subject: [PATCH 1/2] Add backwards capabilities to gbt node names --- src/rpc/mining.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index 8c6cd937f..7416425aa 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -746,11 +746,15 @@ UniValue getblocktemplate(const UniValue& params, bool fHelp) CTxDestination dest; ExtractDestination(payout.second.first, dest); - result.pushKV(std::string(start + "_fluxnode_address"), EncodeDestination(dest)); - result.pushKV(std::string(start + "_fluxlnode_payout"), payout.second.second); - + /** Only use named (cumulus, nimbus, stratus) when using fluxnode naming scheme */ result.pushKV(std::string(start_rename + "_fluxnode_address"), EncodeDestination(dest)); result.pushKV(std::string(start_rename + "_fluxnode_payout"), payout.second.second); + + /** We must keep zelnode here for backwards capabilities so pools don't break when they upgrade to latest releases */ + result.pushKV(std::string(start + "_zelnode_address"), EncodeDestination(dest)); + result.pushKV(std::string(start + "_zelnode_payout"), payout.second.second); + result.pushKV(std::string(start_rename + "_zelnode_address"), EncodeDestination(dest)); + result.pushKV(std::string(start_rename + "_zelnode_payout"), payout.second.second); } // These should never be on the same block. So to keep it clean for pools we will use the same From 2d2736bf634168db5e233162a2d2ef7ff030eb5c Mon Sep 17 00:00:00 2001 From: blondfrogs <8285518+blondfrogs@users.noreply.github.com> Date: Mon, 30 Jan 2023 11:13:46 -0700 Subject: [PATCH 2/2] make max reorg height a signed int --- src/main.cpp | 6 +++++- src/main.h | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 68478f713..f541c189b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -7605,7 +7605,11 @@ CMutableTransaction CreateNewContextualCMutableTransaction(const Consensus::Para return mtx; } -unsigned int GetMaxReorgDepth(const int64_t nHeight) { +/** This must always be a signed int. Because when comparing it to the chainActive.Height() +we need to compare similar types or i < j will not function correctly +You must compare (int < int) because (int < unsigned int) can give incorrectly results +*/ +int64_t GetMaxReorgDepth(const int64_t nHeight) { if (nHeight > MAX_REORG_LENGTH_UPDATED_HEIGHT) { return MAX_REORG_LENGTH_UPDATED; } diff --git a/src/main.h b/src/main.h index 83e1aec8e..a5bbb63d3 100644 --- a/src/main.h +++ b/src/main.h @@ -265,7 +265,7 @@ CAmount GetFluxnodeSubsidy(int nHeight, const CAmount& blockValue, int nNodeTier CAmount GetExchangeFundAmount(int nHeight, const Consensus::Params& consensusParams); CAmount GetFoundationFundAmount(int nHeight, const Consensus::Params& consensusParams); bool IsSwapPoolInterval(const int64_t nHeight); -unsigned int GetMaxReorgDepth(const int64_t nHeight); +int64_t GetMaxReorgDepth(const int64_t nHeight); /** * Prune block and undo files (blk???.dat and undo???.dat) so that the disk space used is less than a user-defined target.