Skip to content

Commit

Permalink
snow/engine/snowman: instantiate voter after issuer (ava-labs#1610)
Browse files Browse the repository at this point in the history
  • Loading branch information
gyuho authored Jun 13, 2023
1 parent 31db450 commit a3436f1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions snow/engine/snowman/transitive.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,11 @@ func (t *Transitive) Chits(ctx context.Context, nodeID ids.NodeID, requestID uin
zap.Stringer("nodeID", nodeID),
zap.Uint32("requestID", requestID))

added, err := t.issueFromByID(ctx, nodeID, blkID)
if err != nil {
return err
}

// Will record chits once [blkID] has been issued into consensus
v := &voter{
t: t,
Expand All @@ -265,10 +270,6 @@ func (t *Transitive) Chits(ctx context.Context, nodeID ids.NodeID, requestID uin
response: blkID,
}

added, err := t.issueFromByID(ctx, nodeID, blkID)
if err != nil {
return err
}
// Wait until [blkID] has been issued to consensus before applying this chit.
if !added {
v.deps.Add(blkID)
Expand Down

0 comments on commit a3436f1

Please sign in to comment.