Skip to content

Commit

Permalink
fix newAck to pay attention to vm height not vm.List len
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulSnow committed Jul 28, 2018
1 parent ae017c9 commit 52c05bc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions state/stateConsensus.go
Expand Up @@ -374,7 +374,7 @@ func CheckDBKeyMR(s *State, ht uint32, hash string) error {
func (s *State) ReviewHolding() {

preReviewHoldingTime := time.Now()
if len(s.XReview) > 0 || s.Syncing || s.Saving {
if len(s.XReview) > 0 {
return
}

Expand Down Expand Up @@ -2396,12 +2396,12 @@ func (s *State) NewAck(msg interfaces.IMsg, balanceHash interfaces.IHash) interf
ack.MessageHash = msg.GetMsgHash()
ack.LeaderChainID = s.IdentityChainID
ack.BalanceHash = balanceHash
listlen := len(s.LeaderPL.VMs[vmIndex].List)
if listlen == 0 {
position := s.LeaderPL.VMs[vmIndex].Height
if position == 0 {
ack.Height = 0
ack.SerialHash = ack.MessageHash
} else {
last := s.LeaderPL.GetAckAt(vmIndex, listlen-1)
last := s.LeaderPL.GetAckAt(vmIndex, position-1)
ack.Height = last.Height + 1
ack.SerialHash, _ = primitives.CreateHash(last.MessageHash, ack.MessageHash)
}
Expand Down

0 comments on commit 52c05bc

Please sign in to comment.