Skip to content

Commit b4f70ad

Browse files
committed
send notification after snapshoted
1 parent 5658ebb commit b4f70ad

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

solana/observer.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1027,10 +1027,19 @@ func (node *Node) sendTransferNotification(ctx context.Context) error {
10271027
if hash == "" {
10281028
continue
10291029
}
1030-
_, err := bot.SafeNotifySnapshot(ctx, hash, 0, n.OpponentId, node.SafeUser())
1030+
req, err := common.SafeReadTransactionRequestUntilSufficient(ctx, node.mixin, n.TraceId)
10311031
if err != nil {
10321032
return err
10331033
}
1034+
if req.SnapshotHash == "" {
1035+
continue
1036+
}
1037+
1038+
_, err = bot.SafeNotifySnapshot(ctx, hash, 0, n.OpponentId, node.SafeUser())
1039+
if err != nil {
1040+
logger.Printf("bot.SafeNotifySnapshot(%s %s %s) => %v", n.TraceId, hash, n.OpponentId, err)
1041+
return err
1042+
}
10341043
err = node.store.MarkNotificationDone(ctx, n.TraceId)
10351044
if err != nil {
10361045
return err

0 commit comments

Comments
 (0)