mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
cmd/loop: parseAmt fails in negative amounts
This commit is contained in:
parent
ea9f902de2
commit
e8f5a54b22
1 changed files with 6 additions and 1 deletions
|
|
@ -361,8 +361,13 @@ func displayOutDetails(l *outLimits, warning string, req *looprpc.QuoteRequest,
|
|||
func parseAmt(text string) (btcutil.Amount, error) {
|
||||
amtInt64, err := strconv.ParseInt(text, 10, 64)
|
||||
if err != nil {
|
||||
return 0, fmt.Errorf("invalid amt value")
|
||||
return 0, fmt.Errorf("invalid amt value %q", text)
|
||||
}
|
||||
|
||||
if amtInt64 < 0 {
|
||||
return 0, fmt.Errorf("negative amount %d", amtInt64)
|
||||
}
|
||||
|
||||
return btcutil.Amount(amtInt64), nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue