Skip to content

Commit

Permalink
Emit Block state change for confirmed block number
Browse files Browse the repository at this point in the history
Fix #2894
  • Loading branch information
LefterisJP committed Oct 26, 2018
1 parent 42e154e commit 3fc9b06
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions raiden/raiden_service.py
Expand Up @@ -530,6 +530,7 @@ def _callback_new_block(self, latest_block):
latest_block_number = latest_block['number']
confirmation_blocks = self.config['blockchain']['confirmation_blocks']
confirmed_block_number = latest_block_number - confirmation_blocks
confirmed_block = self.chain.client.web3.eth.getBlock(confirmed_block_number)

# handle testing private chains
confirmed_block_number = max(GENESIS_BLOCK_NUMBER, confirmed_block_number)
Expand All @@ -550,9 +551,9 @@ def _callback_new_block(self, latest_block):
# been processed but the Block state change has not been
# dispatched.
state_change = Block(
block_number=latest_block_number,
gas_limit=latest_block['gasLimit'],
block_hash=bytes(latest_block['hash']),
block_number=confirmed_block_number,
gas_limit=confirmed_block['gasLimit'],
block_hash=bytes(confirmed_block['hash']),
)
self.handle_state_change(state_change)

Expand Down

0 comments on commit 3fc9b06

Please sign in to comment.