Skip to content

Commit

Permalink
Merge pull request #141 from AdminXeq/stake_patch
Browse files Browse the repository at this point in the history
Stake amount patch to count correct amount_from_portions before hf_17
  • Loading branch information
AdminXeq committed Mar 22, 2023
2 parents 20a0650 + c14b90d commit b462161
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/simplewallet/simplewallet.cpp
Expand Up @@ -6929,8 +6929,12 @@ bool simple_wallet::register_service_node_main(
}

uint64_t unlock_block = bc_height + locked_blocks;
uint8_t hf_ver = m_wallet->get_current_hard_fork();
uint64_t expected_staking_requirement;

uint64_t expected_staking_requirement = std::max(service_nodes::get_staking_requirement(m_wallet->nettype(), bc_height), service_nodes::get_staking_requirement(m_wallet->nettype(), bc_height + STAKING_REQUIREMENT_LOCK_BLOCKS_EXCESS));
if (hf_ver < 12) expected_staking_requirement = std::max(service_nodes::get_staking_requirement(m_wallet->nettype(), bc_height), service_nodes::get_staking_requirement(m_wallet->nettype(), bc_height + STAKING_REQUIREMENT_LOCK_BLOCKS_EXCESS));
else if (hf_ver < 17) expected_staking_requirement = MAX_OPERATOR_V12 * COIN;
else expected_staking_requirement = std::max(service_nodes::get_staking_requirement(m_wallet->nettype(), bc_height), service_nodes::get_staking_requirement(m_wallet->nettype(), bc_height + STAKING_REQUIREMENT_LOCK_BLOCKS_EXCESS));

const uint64_t DUST = MAX_NUMBER_OF_CONTRIBUTORS;

Expand Down Expand Up @@ -6958,7 +6962,6 @@ bool simple_wallet::register_service_node_main(
}

uint64_t amount_burned = 0;
uint8_t hf_ver = m_wallet->get_current_hard_fork();

if (hf_ver < 16) amount_burned += (amount_payable_by_operator / 1000);
else amount_burned += 1;
Expand Down
2 changes: 1 addition & 1 deletion src/version.cpp.in
@@ -1,5 +1,5 @@
#define DEF_XEQ_VERSION_MAJOR 17
#define DEF_XEQ_VERSION_MINOR 0
#define DEF_XEQ_VERSION_MINOR 1
#define DEF_XEQ_VERSION_PATCH 0
#define DEF_XEQ_VERSION_IS_RELEASE @VERSION_IS_RELEASE@

Expand Down

0 comments on commit b462161

Please sign in to comment.