From 00b49e91cf8243207c3d2ce0b3f6cde7f9dc4e0d Mon Sep 17 00:00:00 2001 From: Nguyen Sy Thanh Son Date: Mon, 7 Jan 2019 02:50:25 +0000 Subject: [PATCH] add more logs to debug --- consensus/posv/posv.go | 3 ++- contracts/utils.go | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/consensus/posv/posv.go b/consensus/posv/posv.go index 7fd611fb85..cff6bf6c9c 100644 --- a/consensus/posv/posv.go +++ b/consensus/posv/posv.go @@ -876,7 +876,7 @@ func (c *Posv) Finalize(chain consensus.ChainReader, header *types.Header, state } if b == types.ReceiptStatusFailed { - fmt.Println("Tx receipt status false") + fmt.Println("Tx receipt status false", tx.Hash().Hex()) continue } @@ -896,6 +896,7 @@ func (c *Posv) Finalize(chain consensus.ChainReader, header *types.Header, state vote.Masternode = *addr vote.Voter = *tx.From() + fmt.Println("Remove from Votes cache", vote.Masternode.String(), vote.Voter.String()) c.Votes.Remove(vote) } } diff --git a/contracts/utils.go b/contracts/utils.go index b42df94207..7a1a40389d 100644 --- a/contracts/utils.go +++ b/contracts/utils.go @@ -488,12 +488,12 @@ func GetRewardBalancesRate(c *posv.Posv, foudationWalletAddr common.Address, mas voterCap = vCap.(*big.Int) } else { voterCap, err = validator.GetVoterCap(opts, masterAddr, voteAddr) + if err != nil { + log.Crit("Fail to get vote capacity", "error", err) + } + fmt.Println("Add to Votes cache", vote.Masternode.String(), vote.Voter.String(), voterCap.String()) c.Votes.Add(vote, voterCap) } - if err != nil { - log.Error("Fail to get vote capacity", "error", err) - return nil, err - } totalCap.Add(totalCap, voterCap) voterCaps[voteAddr] = voterCap