@@ -35,16 +35,16 @@ type InstantOut struct {
3535 // State is the current state of the swap.
3636 State fsm.StateType
3737
38- // cltvExpiry is the expiry of the swap.
39- cltvExpiry int32
38+ // CltvExpiry is the expiry of the swap.
39+ CltvExpiry int32
4040
4141 // outgoingChanSet optionally specifies the short channel ids of the
4242 // channels that may be used to loop out.
4343 outgoingChanSet loopdb.ChannelSet
4444
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
4646 // instant out swap.
47- reservations []* reservation.Reservation
47+ Reservations []* reservation.Reservation
4848
4949 // protocolVersion is the version of the protocol that is used for the
5050 // swap.
@@ -53,8 +53,8 @@ type InstantOut struct {
5353 // initiationHeight is the height at which the swap was initiated.
5454 initiationHeight int32
5555
56- // value is the amount that is swapped.
57- value btcutil.Amount
56+ // Value is the amount that is swapped.
57+ Value btcutil.Amount
5858
5959 // keyLocator is the key locator that is used for the swap.
6060 keyLocator keychain.KeyLocator
@@ -81,9 +81,9 @@ type InstantOut struct {
8181 // SweepTxHash is the hash of the sweep transaction.
8282 SweepTxHash * chainhash.Hash
8383
84- // finalizedSweeplessSweepTx is the transaction that is used to sweep
84+ // FinalizedSweeplessSweepTx is the transaction that is used to sweep
8585 // the funds in the cooperative path.
86- finalizedSweeplessSweepTx * wire.MsgTx
86+ FinalizedSweeplessSweepTx * wire.MsgTx
8787
8888 // sweepConfirmationHeight is the height at which the sweep
8989 // transaction was confirmed.
@@ -93,7 +93,7 @@ type InstantOut struct {
9393// getHtlc returns the swap.htlc for the instant out.
9494func (i * InstantOut ) getHtlc (chainParams * chaincfg.Params ) (* swap.Htlc , error ) {
9595 return swap .NewHtlcV2 (
96- i .cltvExpiry , pubkeyTo33ByteSlice (i .serverPubkey ),
96+ i .CltvExpiry , pubkeyTo33ByteSlice (i .serverPubkey ),
9797 pubkeyTo33ByteSlice (i .clientPubkey ), i .SwapHash , chainParams ,
9898 )
9999}
@@ -104,11 +104,11 @@ func (i *InstantOut) createMusig2Session(ctx context.Context,
104104 [][]byte , error ) {
105105
106106 // 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 ))
109109
110110 // Create the sessions and nonces from the reservations.
111- for idx , reservation := range i .reservations {
111+ for idx , reservation := range i .Reservations {
112112 session , err := reservation .Musig2CreateSession (ctx , signer )
113113 if err != nil {
114114 return nil , nil , err
@@ -123,12 +123,12 @@ func (i *InstantOut) createMusig2Session(ctx context.Context,
123123
124124// getInputReservation returns the input reservation for the instant out.
125125func (i * InstantOut ) getInputReservations () (InputReservations , error ) {
126- if len (i .reservations ) == 0 {
126+ if len (i .Reservations ) == 0 {
127127 return nil , errors .New ("no reservations" )
128128 }
129129
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 {
132132 pkScript , err := reservation .GetPkScript ()
133133 if err != nil {
134134 return nil , err
@@ -170,7 +170,7 @@ func (i *InstantOut) createHtlcTransaction(network *chaincfg.Params) (
170170 // Estimate the fee
171171 weight := htlcWeight (len (inputReservations ))
172172 fee := i .htlcFeeRate .FeeForWeight (weight )
173- if fee > i .value / 5 {
173+ if fee > i .Value / 5 {
174174 return nil , errors .New ("fee is higher than 20% of " +
175175 "sweep value" )
176176 }
@@ -182,7 +182,7 @@ func (i *InstantOut) createHtlcTransaction(network *chaincfg.Params) (
182182
183183 // Create the sweep output
184184 sweepOutput := & wire.TxOut {
185- Value : int64 (i .value ) - int64 (fee ),
185+ Value : int64 (i .Value ) - int64 (fee ),
186186 PkScript : htlc .PkScript ,
187187 }
188188
@@ -214,7 +214,7 @@ func (i *InstantOut) createSweeplessSweepTx(feerate chainfee.SatPerKWeight) (
214214 // Estimate the fee
215215 weight := sweeplessSweepWeight (len (inputReservations ))
216216 fee := feerate .FeeForWeight (weight )
217- if fee > i .value / 5 {
217+ if fee > i .Value / 5 {
218218 return nil , errors .New ("fee is higher than 20% of " +
219219 "sweep value" )
220220 }
@@ -226,7 +226,7 @@ func (i *InstantOut) createSweeplessSweepTx(feerate chainfee.SatPerKWeight) (
226226
227227 // Create the sweep output
228228 sweepOutput := & wire.TxOut {
229- Value : int64 (i .value ) - int64 (fee ),
229+ Value : int64 (i .Value ) - int64 (fee ),
230230 PkScript : pkscript ,
231231 }
232232
0 commit comments