Skip to content

Commit

Permalink
fix testnet
Browse files Browse the repository at this point in the history
  • Loading branch information
hclivess committed Nov 6, 2019
1 parent 8360eb3 commit 74ebf3b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion dbhandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,10 @@ def dev_reward(self,node,block_array,miner_tx,mining_reward,mirror_hash):
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):
if node.is_testnet and node.last_block >= fork.POW_FORK_TESTNET:
self.reward_sum = 24 - 10 * (node.last_block + 5 - fork.POW_FORK_TESTNET) / 3000000

elif node.last_block >= fork.POW_FORK:
self.reward_sum = 24 - 10*(node.last_block + 5 - fork.POW_FORK)/3000000
else:
self.reward_sum = 24
Expand Down
4 changes: 3 additions & 1 deletion digest.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,9 @@ def process_transactions(block):
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 >= fork.POW_FORK or (node.is_testnet and node.last_block >= fork.POW_FORK_TESTNET):
if node.is_testnet and node.last_block >= fork.POW_FORK_TESTNET:
block_instance.mining_reward = 15 - (block_instance.block_height_new - fork.POW_FORK_TESTNET) / 1100000 - 9.5
elif node.last_block >= fork.POW_FORK:
block_instance.mining_reward = 15 - (block_instance.block_height_new - fork.POW_FORK) / 1100000 - 9.5
else:
block_instance.mining_reward = 15 - (quantize_eight(block_instance.block_height_new) / quantize_eight(1000000 / 2)) - Decimal("2.4")
Expand Down

0 comments on commit 74ebf3b

Please sign in to comment.