File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -679,12 +679,23 @@ func addInvoice(cli *cli.Context) error {
679
679
680
680
var (
681
681
assetAmount = cli .Uint64 ("asset_amount" )
682
+ msatAmount = cli .Int64 ("amt_msat" )
683
+ satAmount = cli .Int64 ("amt" )
682
684
preimage []byte
683
685
descHash []byte
684
686
err error
685
687
)
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" )
688
699
}
689
700
690
701
if cli .IsSet ("preimage" ) {
@@ -731,6 +742,8 @@ func addInvoice(cli *cli.Context) error {
731
742
Memo : cli .String ("memo" ),
732
743
RPreimage : preimage ,
733
744
DescriptionHash : descHash ,
745
+ Value : satAmount ,
746
+ ValueMsat : msatAmount ,
734
747
FallbackAddr : cli .String ("fallback_addr" ),
735
748
Expiry : expirySeconds ,
736
749
Private : cli .Bool ("private" ),
You can’t perform that action at this time.
0 commit comments