Skip to content

Commit 605bf51

Browse files
authored
Merge pull request #1075 from GeorgeTsagk/ln-addinvoice-msats
Use sat/msat arguments of `ln addinvoice`
2 parents 0015ca2 + 78c2490 commit 605bf51

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

cmd/litcli/ln.go

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -679,12 +679,23 @@ func addInvoice(cli *cli.Context) error {
679679

680680
var (
681681
assetAmount = cli.Uint64("asset_amount")
682+
msatAmount = cli.Int64("amt_msat")
683+
satAmount = cli.Int64("amt")
682684
preimage []byte
683685
descHash []byte
684686
err error
685687
)
686-
if assetAmount == 0 {
687-
return fmt.Errorf("asset_amount argument missing")
688+
if assetAmount == 0 && msatAmount == 0 && satAmount == 0 {
689+
return fmt.Errorf("must set asset amount or sat/msat amount")
690+
}
691+
692+
if assetAmount != 0 && (msatAmount != 0 || satAmount != 0) {
693+
return fmt.Errorf("must only set one of asset amount or " +
694+
"sat/msat amount")
695+
}
696+
697+
if msatAmount != 0 && satAmount != 0 {
698+
return fmt.Errorf("must only set one of amt or amt_msat")
688699
}
689700

690701
if cli.IsSet("preimage") {
@@ -731,6 +742,8 @@ func addInvoice(cli *cli.Context) error {
731742
Memo: cli.String("memo"),
732743
RPreimage: preimage,
733744
DescriptionHash: descHash,
745+
Value: satAmount,
746+
ValueMsat: msatAmount,
734747
FallbackAddr: cli.String("fallback_addr"),
735748
Expiry: expirySeconds,
736749
Private: cli.Bool("private"),

docs/release-notes/release-notes-0.14.2.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@
9393
* All Taproot Asset Channel related commands (`litcli ln ...`) can now [use
9494
a new `--group_key` flag to interact with grouped asset
9595
channels](https://github.com/lightninglabs/lightning-terminal/pull/1052).
96+
* The `litcli ln addinvoice` command now supports adding an invoice with a fixed
97+
sat/msat amount.
9698

9799
# Contributors (Alphabetical Order)
98100

0 commit comments

Comments
 (0)