mirror of
https://github.com/aljazceru/breez-lnd.git
synced 2025-12-18 14:44:22 +01:00
Merge pull request #1374 from wpaulino/zero-amount-invoice-error
rpcserver: return err when paying 0 amt invoice and amt is not specified
This commit is contained in:
@@ -1989,6 +1989,12 @@ func extractPaymentIntent(rpcPayReq *rpcPaymentRequest) (rpcPaymentIntent, error
|
|||||||
// We override the amount to pay with the amount provided from
|
// We override the amount to pay with the amount provided from
|
||||||
// the payment request.
|
// the payment request.
|
||||||
if payReq.MilliSat == nil {
|
if payReq.MilliSat == nil {
|
||||||
|
if rpcPayReq.Amt == 0 {
|
||||||
|
return payIntent, errors.New("amount must be " +
|
||||||
|
"specified when paying a zero amount " +
|
||||||
|
"invoice")
|
||||||
|
}
|
||||||
|
|
||||||
payIntent.msat = lnwire.NewMSatFromSatoshis(
|
payIntent.msat = lnwire.NewMSatFromSatoshis(
|
||||||
btcutil.Amount(rpcPayReq.Amt),
|
btcutil.Amount(rpcPayReq.Amt),
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user