Skip to content

Commit 97c53cc

Browse files
authored
Merge pull request #1546 from lightninglabs/invoice-amt
rpcserver: fix "mutually exclusive" err when using sats
2 parents 5b7aeff + 2822b1b commit 97c53cc

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

rpcserver.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8142,7 +8142,13 @@ func (r *rpcServer) AddInvoice(ctx context.Context,
81428142
return nil, fmt.Errorf("error validating invoice amount: %w",
81438143
err)
81448144
}
8145+
8146+
// We'll forward the invoice request to lnd, where we can only set one
8147+
// of the two values. Since we've calculated the amount in mSat (but the
8148+
// user might've set the satoshi value initially), we need to reset the
8149+
// value field.
81458150
iReq.ValueMsat = int64(invoiceAmtMsat)
8151+
iReq.Value = 0
81468152

81478153
// If this is a hodl invoice, then we'll copy over the relevant fields,
81488154
// then route this through the invoicerpc instead.

0 commit comments

Comments
 (0)