From 747e0f57d13e05608e6ee73921a1b3e2a85e386c Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Sun, 30 Jul 2017 18:22:38 -0700 Subject: [PATCH] multi: fix linter errors --- fundingmanager.go | 2 +- htlcswitch/test_utils.go | 9 ++++++--- lnwallet/channel.go | 4 ++-- lnwallet/channel_test.go | 4 ++-- lnwallet/script_utils.go | 2 +- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/fundingmanager.go b/fundingmanager.go index f291ed0ec..4e789c99b 100644 --- a/fundingmanager.go +++ b/fundingmanager.go @@ -1095,7 +1095,7 @@ func (f *fundingManager) waitForFundingConfirmation(completeChan *channeldb.Open // consider the channel open by presenting the remote party with our // next revocation key. Without the revocation key, the remote party // will be unable to propose state transitions. - nextRevocation, err := channel.NextRevocationkey() + nextRevocation, err := channel.NextRevocationKey() if err != nil { fndgLog.Errorf("unable to create next revocation: %v", err) return diff --git a/htlcswitch/test_utils.go b/htlcswitch/test_utils.go index 36f25182c..4d3ca67f8 100644 --- a/htlcswitch/test_utils.go +++ b/htlcswitch/test_utils.go @@ -163,7 +163,10 @@ func createTestChannel(alicePrivKey, bobPrivKey []byte, var obsfucator [lnwallet.StateHintSize]byte copy(obsfucator[:], aliceFirstRevoke[:]) - estimator := &lnwallet.StaticFeeEstimator{24, 6} + estimator := &lnwallet.StaticFeeEstimator{ + FeeRate: 24, + Confirmation: 6, + } feePerKw := btcutil.Amount(estimator.EstimateFeePerWeight(1) * 1000) commitFee := (feePerKw * btcutil.Amount(724)) / 1000 @@ -227,7 +230,7 @@ func createTestChannel(alicePrivKey, bobPrivKey []byte, // Now that the channel are open, simulate the start of a session by // having Alice and Bob extend their revocation windows to each other. - aliceNextRevoke, err := channelAlice.NextRevocationkey() + aliceNextRevoke, err := channelAlice.NextRevocationKey() if err != nil { return nil, nil, nil, err } @@ -235,7 +238,7 @@ func createTestChannel(alicePrivKey, bobPrivKey []byte, return nil, nil, nil, err } - bobNextRevoke, err := channelBob.NextRevocationkey() + bobNextRevoke, err := channelBob.NextRevocationKey() if err != nil { return nil, nil, nil, err } diff --git a/lnwallet/channel.go b/lnwallet/channel.go index d50c5c99e..d47e31d9e 100644 --- a/lnwallet/channel.go +++ b/lnwallet/channel.go @@ -2495,7 +2495,7 @@ func genHtlcSigValidationJobs(localCommitmentView *commitment, // HLTC output. Given the sighash, and the signing key, we'll be able // to validate each signature within the worker pool. i := 0 - for index, _ := range localCommitmentView.txn.TxOut { + for index := range localCommitmentView.txn.TxOut { var sigHash func() ([]byte, error) outputIndex := int32(index) @@ -2953,7 +2953,7 @@ func (lc *LightningChannel) ReceiveRevocation(revMsg *lnwire.RevokeAndAck) ([]*P // height. The pubkey returned by this function is required by the remote party // along with their revocation base to to extend our commitment chain with a // new commitment. -func (lc *LightningChannel) NextRevocationkey() (*btcec.PublicKey, error) { +func (lc *LightningChannel) NextRevocationKey() (*btcec.PublicKey, error) { lc.RLock() defer lc.RUnlock() diff --git a/lnwallet/channel_test.go b/lnwallet/channel_test.go index ce7230818..6a5960980 100644 --- a/lnwallet/channel_test.go +++ b/lnwallet/channel_test.go @@ -142,7 +142,7 @@ func (m *mockNotfier) RegisterSpendNtfn(outpoint *wire.OutPoint, heightHint uint // // TODO(roasbeef): rename! func initRevocationWindows(chanA, chanB *LightningChannel, windowSize int) error { - aliceNextRevoke, err := chanA.NextRevocationkey() + aliceNextRevoke, err := chanA.NextRevocationKey() if err != nil { return err } @@ -150,7 +150,7 @@ func initRevocationWindows(chanA, chanB *LightningChannel, windowSize int) error return err } - bobNextRevoke, err := chanB.NextRevocationkey() + bobNextRevoke, err := chanB.NextRevocationKey() if err != nil { return err } diff --git a/lnwallet/script_utils.go b/lnwallet/script_utils.go index d0b09a4ed..c14200df2 100644 --- a/lnwallet/script_utils.go +++ b/lnwallet/script_utils.go @@ -1019,7 +1019,7 @@ func TweakPubKeyWithTweak(pubKey *btcec.PublicKey, tweakBytes []byte) *btcec.Pub } } -// TweakPrivKek tweaks the private key of a public base point given a per +// TweakPrivKey tweaks the private key of a public base point given a per // commitment point. The per commitment secret is the revealed revocation // secret for the commitment state in question. This private key will only need // to be generated in the case that a channel counter party broadcasts a