Skip to content

Commit f8c1607

Browse files
committed
loopout, liquidity: turn vars to constants
There are some numeric constants that used to be defined as vars complicating their usage. They were turned into constants: MinLoopOutPreimageRevealDelta, DefaultSweepConfTarget, DefaultHtlcConfTarget, DefaultSweepConfTargetDelta. Also make liquidity.defaultHtlcConfTarget a constant, not a var.
1 parent 6c62ded commit f8c1607

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

liquidity/liquidity.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,13 @@ const (
106106
// time we reach timeout. We set this to a high estimate so that we can
107107
// account for worst-case fees, (1250 * 4 / 1000) = 50 sat/byte.
108108
defaultLoopInSweepFee = chainfee.SatPerKWeight(1250)
109-
)
110109

111-
var (
112110
// defaultHtlcConfTarget is the default confirmation target we use for
113111
// loop in swap htlcs, set to the same default at the client.
114112
defaultHtlcConfTarget = loop.DefaultHtlcConfTarget
113+
)
115114

115+
var (
116116
// defaultBudget is the default autoloop budget we set. This budget will
117117
// only be used for automatically dispatched swaps if autoloop is
118118
// explicitly enabled, so we are happy to set a non-zero value here. The

loopout.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,18 @@ const (
3838
// We'll try to sweep with MuSig2 at most 10 times. If that fails we'll
3939
// fail back to using standard scriptspend sweep.
4040
maxMusigSweepRetries = 10
41-
)
4241

43-
var (
4442
// MinLoopOutPreimageRevealDelta configures the minimum number of
4543
// remaining blocks before htlc expiry required to reveal preimage.
46-
MinLoopOutPreimageRevealDelta int32 = 20
44+
MinLoopOutPreimageRevealDelta = 20
4745

4846
// DefaultSweepConfTarget is the default confirmation target we'll use
4947
// when sweeping on-chain HTLCs.
50-
DefaultSweepConfTarget int32 = 9
48+
DefaultSweepConfTarget = 9
5149

5250
// DefaultHtlcConfTarget is the default confirmation target we'll use
5351
// for on-chain htlcs published by the swap client for Loop In.
54-
DefaultHtlcConfTarget int32 = 6
52+
DefaultHtlcConfTarget = 6
5553

5654
// DefaultSweepConfTargetDelta is the delta of blocks from a Loop Out
5755
// swap's expiration height at which we begin to use the default sweep

0 commit comments

Comments
 (0)