add more logs to debug

This commit is contained in:
Nguyen Sy Thanh Son 2019-01-07 02:50:25 +00:00
parent 3c7ced7e1e
commit 00b49e91cf
2 changed files with 6 additions and 5 deletions

View file

@ -876,7 +876,7 @@ func (c *Posv) Finalize(chain consensus.ChainReader, header *types.Header, state
} }
if b == types.ReceiptStatusFailed { if b == types.ReceiptStatusFailed {
fmt.Println("Tx receipt status false") fmt.Println("Tx receipt status false", tx.Hash().Hex())
continue continue
} }
@ -896,6 +896,7 @@ func (c *Posv) Finalize(chain consensus.ChainReader, header *types.Header, state
vote.Masternode = *addr vote.Masternode = *addr
vote.Voter = *tx.From() vote.Voter = *tx.From()
fmt.Println("Remove from Votes cache", vote.Masternode.String(), vote.Voter.String())
c.Votes.Remove(vote) c.Votes.Remove(vote)
} }
} }

View file

@ -488,11 +488,11 @@ func GetRewardBalancesRate(c *posv.Posv, foudationWalletAddr common.Address, mas
voterCap = vCap.(*big.Int) voterCap = vCap.(*big.Int)
} else { } else {
voterCap, err = validator.GetVoterCap(opts, masterAddr, voteAddr) voterCap, err = validator.GetVoterCap(opts, masterAddr, voteAddr)
c.Votes.Add(vote, voterCap)
}
if err != nil { if err != nil {
log.Error("Fail to get vote capacity", "error", err) log.Crit("Fail to get vote capacity", "error", err)
return nil, err }
fmt.Println("Add to Votes cache", vote.Masternode.String(), vote.Voter.String(), voterCap.String())
c.Votes.Add(vote, voterCap)
} }
totalCap.Add(totalCap, voterCap) totalCap.Add(totalCap, voterCap)