From baec55a3aa237f112431af71694635709ac8d3b9 Mon Sep 17 00:00:00 2001 From: Olexandr88 Date: Sun, 8 Mar 2026 16:36:17 +0300 Subject: [PATCH] fix: guard against short reservation id when printing shortid --- cmd/loop/instantout.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/loop/instantout.go b/cmd/loop/instantout.go index a78100b8c..59647c7b5 100644 --- a/cmd/loop/instantout.go +++ b/cmd/loop/instantout.go @@ -88,6 +88,12 @@ func instantOut(ctx context.Context, cmd *cli.Command) error { fmt.Printf("Available reservations: \n\n") for _, res := range confirmedReservations { idx++ + if len(res.ReservationId) != reservation.IdLength { + return fmt.Errorf("invalid reservation id length: "+ + "got %d, expected %d", len(res.ReservationId), + reservation.IdLength) + } + fmt.Printf("Reservation %v: shortid %x, amt %v, expiry "+ "height %v \n", idx, res.ReservationId[:3], res.Amount, res.Expiry)