Skip to content

Commit

Permalink
Ensure that received timestamp is set in malfeasance handler
Browse files Browse the repository at this point in the history
  • Loading branch information
fasmat committed Sep 25, 2024
1 parent 8d19c88 commit 9ec65ed
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions malfeasance/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ func (h *Handler) HandleMalfeasanceProof(ctx context.Context, peer p2p.Peer, dat
}

func (h *Handler) validateAndSave(ctx context.Context, p *wire.MalfeasanceProof) (types.NodeID, error) {
p.SetReceived(time.Now())
nodeID, err := h.Validate(ctx, p)
switch {
case errors.Is(err, errUnknownProof):
Expand Down
2 changes: 1 addition & 1 deletion syncer/malsync/syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ func (s *Syncer) downloadNodeIDs(ctx context.Context, initial bool, updates chan
case <-ctx.Done():
return nil
// TODO(ivan4th) this has to be randomized in a followup
// when sync will be schedulled in advance, in order to smooth out request rate across the network
// when sync will be scheduled in advance, in order to smooth out request rate across the network
case <-s.clock.After(interval):
}
}
Expand Down

0 comments on commit 9ec65ed

Please sign in to comment.