package consensusreward
import (
+ "fmt"
"math/big"
"github.com/vapor/consensus"
}
func (s *StandbyNodeReward) getStandbyNodeReward(height uint64) error {
+ fmt.Println(height)
voteInfos, err := s.node.GetVoteByHeight(height)
if err != nil {
return errors.Wrapf(err, "get alternative node reward")
}
func (s *StandbyNodeReward) Settlement() error {
- for height := s.startHeight; height < s.endHeight; height += consensus.ActiveNetParams.RoundVoteBlockNums {
- if err := s.getStandbyNodeReward(height); err != nil {
+ for height := s.startHeight + consensus.ActiveNetParams.RoundVoteBlockNums; height <= s.endHeight; height += consensus.ActiveNetParams.RoundVoteBlockNums {
+ if err := s.getStandbyNodeReward(height - consensus.ActiveNetParams.RoundVoteBlockNums); err != nil {
return err
}
}