From f27e0baf7c579dc1a68ba5d22663586ff4a99971 Mon Sep 17 00:00:00 2001 From: Wilmer Paulino Date: Mon, 11 Jun 2018 16:25:34 -0700 Subject: [PATCH] rpcserver: return err when paying 0 amt invoice and amt is not specified --- rpcserver.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rpcserver.go b/rpcserver.go index 8383b6e0..d976ed49 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -1890,6 +1890,12 @@ func extractPaymentIntent(rpcPayReq *rpcPaymentRequest) (rpcPaymentIntent, error // We override the amount to pay with the amount provided from // the payment request. 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( btcutil.Amount(rpcPayReq.Amt), )