fix: guard against short reservation id when printing shortid

This commit is contained in:
Olexandr88 2026-03-08 16:36:17 +03:00 committed by Slyghtning
parent 5b68d40920
commit 7b1c60dba2
No known key found for this signature in database
GPG key ID: F82D456EA023C9BF

View file

@ -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)