mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
fix: guard against short reservation id when printing shortid
This commit is contained in:
parent
5b68d40920
commit
7b1c60dba2
1 changed files with 6 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue