Skip to content

Commit

Permalink
MAT-1132 - fix review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mankenavenkatesh committed May 10, 2020
1 parent 9c5638e commit 462312f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions bridge/setu/listener/rootchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,12 @@ func (rl *RootChainListener) ProcessHeader(newHeader *types.Header) {

// confirmation
confirmationBlocks := big.NewInt(0).SetUint64(requiredConfirmations)
confirmationBlocks = confirmationBlocks.Add(confirmationBlocks, big.NewInt(1))
if latestNumber.Uint64() > confirmationBlocks.Uint64() {
latestNumber = latestNumber.Sub(latestNumber, confirmationBlocks)

if latestNumber.Cmp(confirmationBlocks) <= 0 {
rl.Logger.Error("Block number less than Confirmations required", "blockNumber", latestNumber.Uint64, "confirmationsRequired", confirmationBlocks.Uint64)
return
}
latestNumber = latestNumber.Sub(latestNumber, confirmationBlocks)

// default fromBlock
fromBlock := latestNumber
Expand Down

0 comments on commit 462312f

Please sign in to comment.