@@ -35,16 +35,16 @@ type InstantOut struct {
35
35
// State is the current state of the swap.
36
36
State fsm.StateType
37
37
38
- // cltvExpiry is the expiry of the swap.
39
- cltvExpiry int32
38
+ // CltvExpiry is the expiry of the swap.
39
+ CltvExpiry int32
40
40
41
41
// outgoingChanSet optionally specifies the short channel ids of the
42
42
// channels that may be used to loop out.
43
43
outgoingChanSet loopdb.ChannelSet
44
44
45
- // reservations are the reservations that are used in as inputs for the
45
+ // Reservations are the Reservations that are used in as inputs for the
46
46
// instant out swap.
47
- reservations []* reservation.Reservation
47
+ Reservations []* reservation.Reservation
48
48
49
49
// protocolVersion is the version of the protocol that is used for the
50
50
// swap.
@@ -53,8 +53,8 @@ type InstantOut struct {
53
53
// initiationHeight is the height at which the swap was initiated.
54
54
initiationHeight int32
55
55
56
- // value is the amount that is swapped.
57
- value btcutil.Amount
56
+ // Value is the amount that is swapped.
57
+ Value btcutil.Amount
58
58
59
59
// keyLocator is the key locator that is used for the swap.
60
60
keyLocator keychain.KeyLocator
@@ -81,9 +81,9 @@ type InstantOut struct {
81
81
// SweepTxHash is the hash of the sweep transaction.
82
82
SweepTxHash * chainhash.Hash
83
83
84
- // finalizedSweeplessSweepTx is the transaction that is used to sweep
84
+ // FinalizedSweeplessSweepTx is the transaction that is used to sweep
85
85
// the funds in the cooperative path.
86
- finalizedSweeplessSweepTx * wire.MsgTx
86
+ FinalizedSweeplessSweepTx * wire.MsgTx
87
87
88
88
// sweepConfirmationHeight is the height at which the sweep
89
89
// transaction was confirmed.
@@ -93,7 +93,7 @@ type InstantOut struct {
93
93
// getHtlc returns the swap.htlc for the instant out.
94
94
func (i * InstantOut ) getHtlc (chainParams * chaincfg.Params ) (* swap.Htlc , error ) {
95
95
return swap .NewHtlcV2 (
96
- i .cltvExpiry , pubkeyTo33ByteSlice (i .serverPubkey ),
96
+ i .CltvExpiry , pubkeyTo33ByteSlice (i .serverPubkey ),
97
97
pubkeyTo33ByteSlice (i .clientPubkey ), i .SwapHash , chainParams ,
98
98
)
99
99
}
@@ -104,11 +104,11 @@ func (i *InstantOut) createMusig2Session(ctx context.Context,
104
104
[][]byte , error ) {
105
105
106
106
// Create the htlc musig2 context.
107
- musig2Sessions := make ([]* input.MuSig2SessionInfo , len (i .reservations ))
108
- clientNonces := make ([][]byte , len (i .reservations ))
107
+ musig2Sessions := make ([]* input.MuSig2SessionInfo , len (i .Reservations ))
108
+ clientNonces := make ([][]byte , len (i .Reservations ))
109
109
110
110
// Create the sessions and nonces from the reservations.
111
- for idx , reservation := range i .reservations {
111
+ for idx , reservation := range i .Reservations {
112
112
session , err := reservation .Musig2CreateSession (ctx , signer )
113
113
if err != nil {
114
114
return nil , nil , err
@@ -123,12 +123,12 @@ func (i *InstantOut) createMusig2Session(ctx context.Context,
123
123
124
124
// getInputReservation returns the input reservation for the instant out.
125
125
func (i * InstantOut ) getInputReservations () (InputReservations , error ) {
126
- if len (i .reservations ) == 0 {
126
+ if len (i .Reservations ) == 0 {
127
127
return nil , errors .New ("no reservations" )
128
128
}
129
129
130
- inputs := make (InputReservations , len (i .reservations ))
131
- for idx , reservation := range i .reservations {
130
+ inputs := make (InputReservations , len (i .Reservations ))
131
+ for idx , reservation := range i .Reservations {
132
132
pkScript , err := reservation .GetPkScript ()
133
133
if err != nil {
134
134
return nil , err
@@ -170,7 +170,7 @@ func (i *InstantOut) createHtlcTransaction(network *chaincfg.Params) (
170
170
// Estimate the fee
171
171
weight := htlcWeight (len (inputReservations ))
172
172
fee := i .htlcFeeRate .FeeForWeight (weight )
173
- if fee > i .value / 5 {
173
+ if fee > i .Value / 5 {
174
174
return nil , errors .New ("fee is higher than 20% of " +
175
175
"sweep value" )
176
176
}
@@ -182,7 +182,7 @@ func (i *InstantOut) createHtlcTransaction(network *chaincfg.Params) (
182
182
183
183
// Create the sweep output
184
184
sweepOutput := & wire.TxOut {
185
- Value : int64 (i .value ) - int64 (fee ),
185
+ Value : int64 (i .Value ) - int64 (fee ),
186
186
PkScript : htlc .PkScript ,
187
187
}
188
188
@@ -214,7 +214,7 @@ func (i *InstantOut) createSweeplessSweepTx(feerate chainfee.SatPerKWeight) (
214
214
// Estimate the fee
215
215
weight := sweeplessSweepWeight (len (inputReservations ))
216
216
fee := feerate .FeeForWeight (weight )
217
- if fee > i .value / 5 {
217
+ if fee > i .Value / 5 {
218
218
return nil , errors .New ("fee is higher than 20% of " +
219
219
"sweep value" )
220
220
}
@@ -226,7 +226,7 @@ func (i *InstantOut) createSweeplessSweepTx(feerate chainfee.SatPerKWeight) (
226
226
227
227
// Create the sweep output
228
228
sweepOutput := & wire.TxOut {
229
- Value : int64 (i .value ) - int64 (fee ),
229
+ Value : int64 (i .Value ) - int64 (fee ),
230
230
PkScript : pkscript ,
231
231
}
232
232
0 commit comments