Skip to content

Commit f0bb038

Browse files
authored
fix: panic on invalid event (#70)
1 parent 06cba74 commit f0bb038

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

comm/p2p/manager.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func (sm *StreamManager) ReleaseStreams(sessionID string) {
4949

5050
err := stream.Close()
5151
if err != nil {
52-
log.Err(err).Msgf("Cannot close stream to peer %s", peer.String())
52+
log.Debug().Msgf("Cannot close stream to peer %s, err: %s", peer.String(), err.Error())
5353
}
5454
}
5555

protocol/across/deposit.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ func (h *AcrossDepositFetcher) fetchDepositByHash(ctx context.Context, hash comm
6868
continue
6969
}
7070

71+
if len(l.Topics) < 3 {
72+
continue
73+
}
74+
7175
if l.Topics[0] != events.AcrossDepositSig.GetTopic() {
7276
continue
7377
}

0 commit comments

Comments
 (0)