File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 3434 }
3535)
3636
37+ const InfiniteDuration = (24 * 31 * 12 * 100 ) * time .Hour
38+
3739// Parameters is a set of parameters provided by the user which guide
3840// how we assess liquidity.
3941type Parameters struct {
@@ -404,6 +406,18 @@ func RpcToParameters(req *clientrpc.LiquidityParameters) (*Parameters,
404406 time .Second
405407 }
406408
409+ // If an old-style budget was written to storage then express it by
410+ // using the new auto budget parameters. If the newly added parameters
411+ // have the 0 default value, but a budget was defined that means the
412+ // client is using the old style budget parameters.
413+ if req .AutoloopBudgetRefreshPeriodSec == 0 &&
414+ req .AutoloopBudgetSat != 0 {
415+
416+ params .AutoFeeRefreshPeriod = InfiniteDuration
417+ params .AutoloopBudgetLastRefresh = time .Unix (
418+ int64 (req .AutoloopBudgetStartSec ), 0 )
419+ }
420+
407421 for _ , rule := range req .Rules {
408422 peerRule := rule .Pubkey != nil
409423 chanRule := rule .ChannelId != 0
You can’t perform that action at this time.
0 commit comments