From a74a1a87a551209809242fc6a9b5e0ddbeec79bc Mon Sep 17 00:00:00 2001 From: HCLivess Date: Sat, 2 Nov 2019 20:07:49 +0100 Subject: [PATCH] prepare for hardfork --- dbhandler.py | 9 +++++++-- digest.py | 18 ++++++++---------- fork.py | 2 +- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/dbhandler.py b/dbhandler.py index e55e314..8647e8f 100644 --- a/dbhandler.py +++ b/dbhandler.py @@ -251,9 +251,14 @@ def hn_reward(self,node,block_array,miner_tx,mirror_hash): fork = Fork() if node.last_block >= fork.POW_FORK or (node.is_testnet and node.last_block >= fork.POW_FORK_TESTNET): - self.reward_sum = "24" + self.reward_sum = 24 - 10*(node.last_block + 5 - fork.POW_FORK)/3000000 else: - self.reward_sum = "8" + self.reward_sum = 24 + + if self.reward_sum < 0.5: + self.reward_sum = 0.5 + + self.reward_sum = '{:.8f}'.format(self.reward_sum) self.execute_param(self.c, self.SQL_TO_TRANSACTIONS, (-block_array.block_height_new, str(miner_tx.q_block_timestamp), "Hypernode Payouts", diff --git a/digest.py b/digest.py index 3ee32ba..307e3e9 100644 --- a/digest.py +++ b/digest.py @@ -212,19 +212,17 @@ def process_transactions(block): # decide reward if tx_index == block_instance.tx_count - 1: db_amount = 0 # prevent spending from another address, because mining txs allow delegation - if node.last_block <= 10000000: - if node.last_block >= fork.POW_FORK or (node.is_testnet and node.last_block >= fork.POW_FORK_TESTNET): - block_instance.mining_reward = 15 - (quantize_eight(block_instance.block_height_new) / quantize_eight(1000000 / 2)) - Decimal("2.4") - else: - block_instance.mining_reward = 15 - (quantize_eight(block_instance.block_height_new) / quantize_eight(1000000 / 2)) - Decimal("0.8") - - if block_instance.mining_reward < 0: - block_instance.mining_reward = 0 + if node.last_block >= fork.POW_FORK or (node.is_testnet and node.last_block >= fork.POW_FORK_TESTNET): + block_instance.mining_reward = 15 - (block_instance.block_height_new - fork.POW_FORK) / 1100000 - 9.5 else: - block_instance.mining_reward = 0 + block_instance.mining_reward = 15 - (quantize_eight(block_instance.block_height_new) / quantize_eight(1000000 / 2)) - Decimal("2.4") + + if block_instance.mining_reward < 0.5: + block_instance.mining_reward = 0.5 + + reward = '{:.8f}'.format(block_instance.mining_reward + sum(fees_block)) - reward = quantize_eight(block_instance.mining_reward + sum(fees_block)) # don't request a fee for mined block so new accounts can mine fee = 0 else: diff --git a/fork.py b/fork.py index a4b19d6..8a6afab 100644 --- a/fork.py +++ b/fork.py @@ -1,6 +1,6 @@ class Fork(): def __init__(self): - self.POW_FORK = 1200000 + self.POW_FORK = 1450000 self.POW_FORK_TESTNET = 894170 self.FORK_AHEAD = 5 self.versions_remove = ['mainnet0019', 'mainnet0018', 'mainnet0017']