Skip to content

Commit

Permalink
fix dpos bug on fork3
Browse files Browse the repository at this point in the history
  • Loading branch information
elvis88 committed Nov 15, 2019
1 parent cbab68a commit 94adbbd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions consensus/dpos/vote.go
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,8 @@ func (sys *System) UpdateElectedCandidates1(pepoch uint64, epoch uint64, number
activatedTotalQuantity = new(big.Int).Add(activatedTotalQuantity, candidateInfo.TotalQuantity)
}
}
gstate.ActivatedCandidateSchedule = activatedCandidateSchedule
gstate.ActivatedTotalQuantity = activatedTotalQuantity
} else {
tstate := &GlobalState{
Epoch: math.MaxUint64,
Expand Down Expand Up @@ -733,10 +735,11 @@ func (sys *System) UpdateElectedCandidates1(pepoch uint64, epoch uint64, number
index++
}
}
gstate.ActivatedCandidateSchedule = activatedCandidateSchedule
gstate.ActivatedTotalQuantity = activatedTotalQuantity
}
}
gstate.ActivatedCandidateSchedule = activatedCandidateSchedule
gstate.ActivatedTotalQuantity = activatedTotalQuantity

if err := sys.SetState(gstate); err != nil {
return err
}
Expand Down

0 comments on commit 94adbbd

Please sign in to comment.