File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7382,6 +7382,17 @@ func (r *rpcServer) AddInvoice(ctx context.Context,
73827382 return nil , fmt .Errorf ("unexpected response type: %T" , r )
73837383 }
73847384
7385+ // If the invoice is for an asset unit amount smaller than the minimal
7386+ // transportable amount, we'll return an error, as it wouldn't be
7387+ // payable by the network.
7388+ if acceptedQuote .MinTransportableUnits > req .AssetAmount {
7389+ return nil , fmt .Errorf ("cannot create invoice over %d asset " +
7390+ "units, as the minimal transportable amount is %d " +
7391+ "units with the current rate of %v units/BTC" ,
7392+ req .AssetAmount , acceptedQuote .MinTransportableUnits ,
7393+ acceptedQuote .AskAssetRate )
7394+ }
7395+
73857396 // Now that we have the accepted quote, we know the amount in Satoshi
73867397 // that we need to pay. We can now update the invoice with this amount.
73877398 //
You can’t perform that action at this time.
0 commit comments