@@ -578,11 +578,22 @@ func (s *swapClientServer) GetLiquidityParams(_ context.Context,
578578 SweepFeeRateSatPerVbyte : uint64 (satPerByte ),
579579 SweepConfTarget : cfg .SweepConfTarget ,
580580 FailureBackoffSec : uint64 (cfg .FailureBackOff .Seconds ()),
581+ AutoLoopOut : cfg .AutoOut ,
582+ AutoOutBudgetSat : uint64 (cfg .AutoFeeBudget ),
583+ AutoMaxInFlight : uint64 (cfg .MaxAutoInFlight ),
581584 Rules : make (
582585 []* looprpc.LiquidityRule , 0 , len (cfg .ChannelRules ),
583586 ),
584587 }
585588
589+ // Zero golang time is different to a zero unix time, so we only set
590+ // our start date if it is non-zero.
591+ if ! cfg .AutoFeeStartDate .IsZero () {
592+ rpcCfg .AutoOutBudgetStartSec = uint64 (
593+ cfg .AutoFeeStartDate .Unix (),
594+ )
595+ }
596+
586597 for channel , rule := range cfg .ChannelRules {
587598 rpcRule := & looprpc.LiquidityRule {
588599 ChannelId : channel .ToUint64 (),
@@ -617,12 +628,22 @@ func (s *swapClientServer) SetLiquidityParams(_ context.Context,
617628 SweepConfTarget : in .Parameters .SweepConfTarget ,
618629 FailureBackOff : time .Duration (in .Parameters .FailureBackoffSec ) *
619630 time .Second ,
631+ AutoOut : in .Parameters .AutoLoopOut ,
632+ AutoFeeBudget : btcutil .Amount (in .Parameters .AutoOutBudgetSat ),
633+ MaxAutoInFlight : int (in .Parameters .AutoMaxInFlight ),
620634 ChannelRules : make (
621635 map [lnwire.ShortChannelID ]* liquidity.ThresholdRule ,
622636 len (in .Parameters .Rules ),
623637 ),
624638 }
625639
640+ // Zero unix time is different to zero golang time.
641+ if in .Parameters .AutoOutBudgetStartSec != 0 {
642+ params .AutoFeeStartDate = time .Unix (
643+ int64 (in .Parameters .AutoOutBudgetStartSec ), 0 ,
644+ )
645+ }
646+
626647 for _ , rule := range in .Parameters .Rules {
627648 var (
628649 shortID = lnwire .NewShortChanIDFromInt (rule .ChannelId )
0 commit comments