Skip to content

Commit 8dba7fb

Browse files
committed
Ran gofmt
1 parent e91adc1 commit 8dba7fb

29 files changed

+90
-90
lines changed

btcutil/blockchain/chain.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ import (
1313
"time"
1414

1515
"github.com/mit-dci/lit/btcutil"
16-
"github.com/mit-dci/lit/coinparam"
1716
"github.com/mit-dci/lit/btcutil/chaincfg/chainhash"
1817
"github.com/mit-dci/lit/btcutil/database"
1918
"github.com/mit-dci/lit/btcutil/txscript"
19+
"github.com/mit-dci/lit/coinparam"
2020
"github.com/mit-dci/lit/wire"
2121
)
2222

btcutil/blockchain/checkpoints.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ import (
88
"fmt"
99

1010
"github.com/mit-dci/lit/btcutil"
11-
"github.com/mit-dci/lit/coinparam"
1211
"github.com/mit-dci/lit/btcutil/chaincfg/chainhash"
1312
"github.com/mit-dci/lit/btcutil/database"
1413
"github.com/mit-dci/lit/btcutil/txscript"
14+
"github.com/mit-dci/lit/coinparam"
1515
)
1616

1717
// CheckpointConfirmations is the number of blocks before the end of the current

btcutil/blockchain/compress.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
package blockchain
66

77
import (
8-
"github.com/mit-dci/lit/crypto/koblitz"
98
"github.com/mit-dci/lit/btcutil/txscript"
9+
"github.com/mit-dci/lit/crypto/koblitz"
1010
)
1111

1212
// -----------------------------------------------------------------------------

btcutil/blockchain/validate.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ import (
1212
"time"
1313

1414
"github.com/mit-dci/lit/btcutil"
15-
"github.com/mit-dci/lit/coinparam"
1615
"github.com/mit-dci/lit/btcutil/chaincfg/chainhash"
1716
"github.com/mit-dci/lit/btcutil/txscript"
17+
"github.com/mit-dci/lit/coinparam"
1818
"github.com/mit-dci/lit/wire"
1919
)
2020

btcutil/certgen.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ func NewTLSCertPair(organization string, validUntil time.Time, extraHosts []stri
110110

111111
KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature |
112112
x509.KeyUsageCertSign,
113-
IsCA: true, // so can sign self.
113+
IsCA: true, // so can sign self.
114114
BasicConstraintsValid: true,
115115

116116
DNSNames: dnsNames,

btcutil/txscript/engine.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import (
99
"fmt"
1010
"math/big"
1111

12-
"github.com/mit-dci/lit/crypto/koblitz"
1312
"github.com/mit-dci/lit/crypto/fastsha256"
13+
"github.com/mit-dci/lit/crypto/koblitz"
1414
"github.com/mit-dci/lit/wire"
1515
)
1616

btcutil/txscript/sigcache.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ package txscript
77
import (
88
"sync"
99

10-
"github.com/mit-dci/lit/crypto/koblitz"
1110
"github.com/mit-dci/lit/btcutil/chaincfg/chainhash"
11+
"github.com/mit-dci/lit/crypto/koblitz"
1212
)
1313

1414
// sigCacheEntry represents an entry in the SigCache. Entries within the

btcutil/wif.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import (
88
"bytes"
99
"errors"
1010
"github.com/mit-dci/lit/btcutil/base58"
11-
"github.com/mit-dci/lit/coinparam"
1211
"github.com/mit-dci/lit/btcutil/chaincfg/chainhash"
12+
"github.com/mit-dci/lit/coinparam"
1313
"github.com/mit-dci/lit/crypto/koblitz"
1414
)
1515

cmd/lit-af/lit-af.go

+12-12
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
"fmt"
55
"os"
66
"path/filepath"
7-
"strings"
87
"strconv"
8+
"strings"
99

1010
"github.com/chzyer/readline"
1111
"github.com/fatih/color"
@@ -48,17 +48,17 @@ type litAfClient struct {
4848
}
4949

5050
type litAfConfig struct {
51-
Con string `long:"con" description:"host to connect to in the form of [<lnadr>@][<host>][:<port>]"`
52-
LitHomeDir string `long:"litHomeDir" description:"directory to save settings"`
53-
Port string `long:"autoListenPort" description:"port that the lit is listening to."`
54-
Tracker string `long:"tracker" description:"service to use for looking up node addresses"`
55-
LogLevel []bool `short:"v" description:"Set verbosity level to verbose (-v), very verbose (-vv) or very very verbose (-vvv)"`
51+
Con string `long:"con" description:"host to connect to in the form of [<lnadr>@][<host>][:<port>]"`
52+
LitHomeDir string `long:"litHomeDir" description:"directory to save settings"`
53+
Port string `long:"autoListenPort" description:"port that the lit is listening to."`
54+
Tracker string `long:"tracker" description:"service to use for looking up node addresses"`
55+
LogLevel []bool `short:"v" description:"Set verbosity level to verbose (-v), very verbose (-vv) or very very verbose (-vvv)"`
5656
}
5757

5858
var (
59-
defaultCon = "2448"
60-
defaultLitHomeDirName = filepath.Join(os.Getenv("HOME"), litHomeDirName)
61-
defaultTracker = "http://hubris.media.mit.edu:46580"
59+
defaultCon = "2448"
60+
defaultLitHomeDirName = filepath.Join(os.Getenv("HOME"), litHomeDirName)
61+
defaultTracker = "http://hubris.media.mit.edu:46580"
6262
)
6363

6464
// newConfigParser returns a new command line flags parser.
@@ -147,9 +147,9 @@ func main() {
147147
var err error
148148
lc := new(litAfClient)
149149
conf := litAfConfig{
150-
Con: defaultCon,
151-
LitHomeDir: defaultLitHomeDirName,
152-
Tracker: defaultTracker,
150+
Con: defaultCon,
151+
LitHomeDir: defaultLitHomeDirName,
152+
Tracker: defaultTracker,
153153
}
154154
lc.litAfSetup(conf) // setup lit-af to start
155155

lndc/noise.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
"crypto/cipher"
55
"crypto/sha256"
66
"encoding/binary"
7-
"fmt"
87
"errors"
8+
"fmt"
99
"io"
1010
"math"
1111
"time"

lnutil/btclib_test.go

+10-10
Original file line numberDiff line numberDiff line change
@@ -42,32 +42,32 @@ func TestOutPointsEqual(t *testing.T) {
4242
// hash of inA is not the same as hash of inB
4343
// index of inA is not the same as index of inB
4444
{
45-
wire.OutPoint{Hash: hash1, Index:u2}, // inA
46-
wire.OutPoint{Hash: hash2, Index:u1}, // inB
45+
wire.OutPoint{Hash: hash1, Index: u2}, // inA
46+
wire.OutPoint{Hash: hash2, Index: u1}, // inB
4747
false,
4848
},
4949

5050
// hash of inA is not the same as hash of inB
5151
// index of inA is the same as index of inB
5252
{
53-
wire.OutPoint{Hash: hash1, Index:u1}, // inA
54-
wire.OutPoint{Hash: hash2, Index:u1}, // inB
53+
wire.OutPoint{Hash: hash1, Index: u1}, // inA
54+
wire.OutPoint{Hash: hash2, Index: u1}, // inB
5555
false,
5656
},
5757

5858
// hash of inA is the same as hash of inB
5959
// index of inA is not the same as index of inB
6060
{
61-
wire.OutPoint{Hash: hash1, Index:u1}, // inA
62-
wire.OutPoint{Hash: hash1, Index:u2}, // inB
61+
wire.OutPoint{Hash: hash1, Index: u1}, // inA
62+
wire.OutPoint{Hash: hash1, Index: u2}, // inB
6363
false,
6464
},
6565

6666
// hash of inA is the same as hash of inB
6767
// index of inA is the same as index of inB
6868
{
69-
wire.OutPoint{Hash: hash1, Index:u1}, // inA
70-
wire.OutPoint{Hash: hash1, Index:u1}, // inB
69+
wire.OutPoint{Hash: hash1, Index: u1}, // inA
70+
wire.OutPoint{Hash: hash1, Index: u1}, // inB
7171
true,
7272
},
7373

@@ -81,13 +81,13 @@ func TestOutPointsEqual(t *testing.T) {
8181
// hash of inA is just initialized
8282
{
8383
wire.OutPoint{Hash: [32]byte{}, Index: u1}, // inA
84-
wire.OutPoint{Hash: hash1, Index:u1}, // inB
84+
wire.OutPoint{Hash: hash1, Index: u1}, // inB
8585
false,
8686
},
8787

8888
// hash of inB is just initialized
8989
{
90-
wire.OutPoint{Hash: hash1, Index:u1}, // inA
90+
wire.OutPoint{Hash: hash1, Index: u1}, // inA
9191
wire.OutPoint{Hash: [32]byte{}, Index: u1}, // inB
9292
false,
9393
},

lnutil/curvelib.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import (
66
"math/big"
77
"sort"
88

9-
"github.com/mit-dci/lit/crypto/koblitz"
109
"github.com/mit-dci/lit/btcutil/chaincfg/chainhash"
10+
"github.com/mit-dci/lit/crypto/koblitz"
1111
)
1212

1313
// PrivKeyAddBytes adds bytes to a private key.

lnutil/curvelib_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ package lnutil
33
import (
44
"testing"
55

6-
"github.com/mit-dci/lit/crypto/koblitz"
76
"github.com/mit-dci/lit/btcutil/chaincfg/chainhash"
7+
"github.com/mit-dci/lit/crypto/koblitz"
88
)
99

1010
var (

logging/log.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ import (
2323
type LogLevel int
2424

2525
const (
26-
LogLevelError LogLevel = 0
27-
LogLevelWarning LogLevel = 1
28-
LogLevelInfo LogLevel = 2
29-
LogLevelDebug LogLevel = 3
26+
LogLevelError LogLevel = 0
27+
LogLevelWarning LogLevel = 1
28+
LogLevelInfo LogLevel = 2
29+
LogLevelDebug LogLevel = 3
3030
)
3131

3232
var logLevel = LogLevelError // the default

portxo/derive.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
"fmt"
55
"math/big"
66

7-
"github.com/mit-dci/lit/crypto/koblitz"
87
"github.com/mit-dci/lit/btcutil/hdkeychain"
8+
"github.com/mit-dci/lit/crypto/koblitz"
99
)
1010

1111
// DerivePrivateKey returns the private key for a utxo based on a master key

qln/basewallet.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ package qln
33
import (
44
"fmt"
55

6-
"github.com/mit-dci/lit/uspv"
76
"github.com/mit-dci/lit/btcutil/chaincfg/chainhash"
87
"github.com/mit-dci/lit/coinparam"
98
"github.com/mit-dci/lit/crypto/koblitz"
109
"github.com/mit-dci/lit/lnutil"
1110
"github.com/mit-dci/lit/portxo"
11+
"github.com/mit-dci/lit/uspv"
1212
"github.com/mit-dci/lit/wire"
1313
)
1414

qln/buildtx.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ func (q *Qchan) SimpleCloseTx() (*wire.MsgTx, error) {
9292
theirScript := lnutil.DirectWPKHScript(q.TheirRefundPub)
9393
var theirAmt int64
9494
var theirOutput *wire.TxOut
95-
if q.Value - q.State.MyAmt != 0 {
95+
if q.Value-q.State.MyAmt != 0 {
9696
theirAmt = (q.Value - q.State.MyAmt) - fee
9797
theirOutput = wire.NewTxOut(theirAmt, theirScript)
9898
}

qln/close.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,9 @@ func (nd *LitNode) CloseReqHandler(msg lnutil.CloseReqMsg) {
211211

212212
// Broadcast that we've closed a channel
213213
closed := ChannelStateUpdateEvent{
214-
Action: "closed",
215-
ChanIdx: q.Idx(),
216-
State: q.State,
214+
Action: "closed",
215+
ChanIdx: q.Idx(),
216+
State: q.State,
217217
TheirPub: peer.GetPubkey(),
218218
CoinType: q.Coin(),
219219
}

qln/dlc.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import (
44
"fmt"
55

66
"github.com/mit-dci/lit/btcutil"
7-
"github.com/mit-dci/lit/crypto/koblitz"
87
"github.com/mit-dci/lit/btcutil/txscript"
98
"github.com/mit-dci/lit/btcutil/txsort"
9+
"github.com/mit-dci/lit/crypto/koblitz"
1010
"github.com/mit-dci/lit/dlc"
1111
"github.com/mit-dci/lit/lnutil"
1212
"github.com/mit-dci/lit/logging"

qln/events.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package qln
22

33
import (
4-
"github.com/mit-dci/lit/eventbus"
54
"github.com/mit-dci/lit/crypto/koblitz"
5+
"github.com/mit-dci/lit/eventbus"
66
)
77

88
// ChannelStateUpdateEvent is a struct for a channel state update event

qln/fund.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -736,9 +736,9 @@ func (nd *LitNode) SigProofHandler(msg lnutil.SigProofMsg, peer *RemotePeer) {
736736
existingPeer := nd.PeerMan.GetPeerByIdx(int32(peerIdx))
737737

738738
sigProofEvent := ChannelStateUpdateEvent{
739-
Action: "sigproof",
740-
ChanIdx: qc.Idx(),
741-
State: qc.State,
739+
Action: "sigproof",
740+
ChanIdx: qc.Idx(),
741+
State: qc.State,
742742
TheirPub: existingPeer.GetPubkey(),
743743
CoinType: qc.Coin(),
744744
}

qln/init.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"path/filepath"
66
"sync"
77

8-
"github.com/mit-dci/lit/wallit"
98
"github.com/boltdb/bolt"
109
"github.com/mit-dci/lit/btcutil"
1110
"github.com/mit-dci/lit/btcutil/hdkeychain"
@@ -17,6 +16,7 @@ import (
1716
"github.com/mit-dci/lit/lnp2p"
1817
"github.com/mit-dci/lit/logging"
1918
"github.com/mit-dci/lit/portxo"
19+
"github.com/mit-dci/lit/wallit"
2020
"github.com/mit-dci/lit/watchtower"
2121
)
2222

qln/msghandler.go

+19-19
Original file line numberDiff line numberDiff line change
@@ -422,29 +422,29 @@ func (nd *LitNode) OPEventHandler(OPEventChan chan lnutil.OutPointEvent) {
422422
// spend event (note: happens twice!)
423423

424424
if theQ.Height > 0 {
425-
logging.Debugf("Second time this is confirmed, send out real confirm event")
425+
logging.Debugf("Second time this is confirmed, send out real confirm event")
426426

427-
// TODO: abstract important channel things into a channel manager type of thing
428-
peerIdx := theQ.Peer()
429-
peer := nd.PeerMan.GetPeerByIdx(int32(peerIdx))
427+
// TODO: abstract important channel things into a channel manager type of thing
428+
peerIdx := theQ.Peer()
429+
peer := nd.PeerMan.GetPeerByIdx(int32(peerIdx))
430430
if peer == nil {
431431
logging.Errorf("Please use errors in peermanager rather than just returning could be nil or 0 or something else")
432432
} else {
433-
confirmEvent := ChannelStateUpdateEvent{
434-
Action: "opconfirm",
435-
ChanIdx: theQ.Idx(),
436-
State: theQ.State,
437-
TheirPub: peer.GetPubkey(),
438-
CoinType: theQ.Coin(),
439-
}
440-
441-
if succeed, err := nd.Events.Publish(confirmEvent); err != nil {
442-
logging.Errorf("ConfirmHandler publish err %s", err)
443-
return
444-
} else if !succeed {
445-
logging.Errorf("ConfirmHandler publish did not succeed")
446-
return
447-
}
433+
confirmEvent := ChannelStateUpdateEvent{
434+
Action: "opconfirm",
435+
ChanIdx: theQ.Idx(),
436+
State: theQ.State,
437+
TheirPub: peer.GetPubkey(),
438+
CoinType: theQ.Coin(),
439+
}
440+
441+
if succeed, err := nd.Events.Publish(confirmEvent); err != nil {
442+
logging.Errorf("ConfirmHandler publish err %s", err)
443+
return
444+
} else if !succeed {
445+
logging.Errorf("ConfirmHandler publish did not succeed")
446+
return
447+
}
448448
}
449449
}
450450

qln/pushpull.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -881,8 +881,8 @@ func (nd *LitNode) SigRevHandler(msg lnutil.SigRevMsg, qc *Qchan) error {
881881
peer := nd.PeerMan.GetPeerByIdx(int32(peerIdx))
882882

883883
sigrevEvent := ChannelStateUpdateEvent{
884-
ChanIdx: qc.Idx(),
885-
State: qc.State,
884+
ChanIdx: qc.Idx(),
885+
State: qc.State,
886886
TheirPub: peer.GetPubkey(),
887887
CoinType: qc.Coin(),
888888
}

0 commit comments

Comments
 (0)