Skip to content

Commit 74f2c96

Browse files
committed
looprpc: add custom client sizes for autoloop
1 parent 3f0fc14 commit 74f2c96

File tree

4 files changed

+206
-152
lines changed

4 files changed

+206
-152
lines changed

loopd/swapclient_server.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,8 @@ func (s *swapClientServer) GetLiquidityParams(_ context.Context,
587587
Rules: make(
588588
[]*looprpc.LiquidityRule, 0, len(cfg.ChannelRules),
589589
),
590+
MinSwapAmount: uint64(cfg.ClientRestrictions.Minimum),
591+
MaxSwapAmount: uint64(cfg.ClientRestrictions.Maximum),
590592
}
591593

592594
// Zero golang time is different to a zero unix time, so we only set
@@ -638,6 +640,10 @@ func (s *swapClientServer) SetLiquidityParams(ctx context.Context,
638640
map[lnwire.ShortChannelID]*liquidity.ThresholdRule,
639641
len(in.Parameters.Rules),
640642
),
643+
ClientRestrictions: liquidity.Restrictions{
644+
Minimum: btcutil.Amount(in.Parameters.MinSwapAmount),
645+
Maximum: btcutil.Amount(in.Parameters.MaxSwapAmount),
646+
},
641647
}
642648

643649
// Zero unix time is different to zero golang time.

0 commit comments

Comments
 (0)