Skip to content

Commit

Permalink
Log voting power error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
pouya-eghbali committed Mar 15, 2024
1 parent d7b29f5 commit a648936
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions src/pos/pos.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,25 @@ func Start() {
os.Exit(1)
}

power, _ := GetVotingPower(addrHex, big.NewInt(0))
total, _ := GetTotalVotingPower()
power, err := GetVotingPower(addrHex, big.NewInt(0))

if err != nil {
log.Logger.
With("Error", err).
Error("Failed to get voting power")

return
}

total, err := GetTotalVotingPower()

if err != nil {
log.Logger.
With("Error", err).
Error("Failed to get total voting power")

return
}

log.Logger.
With("Power", VotingPowerToFloat(power)).
Expand Down

0 comments on commit a648936

Please sign in to comment.