multi: fix linter errors
This commit is contained in:
parent
3207c8a736
commit
21baa7bf18
@ -1790,7 +1790,8 @@ func (c *OpenChannel) RemoveFwdPkg(height uint64) error {
|
|||||||
|
|
||||||
// RevocationLogTail returns the "tail", or the end of the current revocation
|
// RevocationLogTail returns the "tail", or the end of the current revocation
|
||||||
// log. This entry represents the last previous state for the remote node's
|
// log. This entry represents the last previous state for the remote node's
|
||||||
// commitment chain. The ChannelDelta returned by this method will always lag one state behind the most current (unrevoked) state of the remote node's
|
// commitment chain. The ChannelDelta returned by this method will always lag
|
||||||
|
// one state behind the most current (unrevoked) state of the remote node's
|
||||||
// commitment chain.
|
// commitment chain.
|
||||||
func (c *OpenChannel) RevocationLogTail() (*ChannelCommitment, error) {
|
func (c *OpenChannel) RevocationLogTail() (*ChannelCommitment, error) {
|
||||||
c.RLock()
|
c.RLock()
|
||||||
|
@ -1194,11 +1194,7 @@ func (s *Switch) handlePacketForward(packet *htlcPacket) error {
|
|||||||
fail.Reason = circuit.ErrorEncrypter.EncryptMalformedError(
|
fail.Reason = circuit.ErrorEncrypter.EncryptMalformedError(
|
||||||
fail.Reason,
|
fail.Reason,
|
||||||
)
|
)
|
||||||
if err != nil {
|
|
||||||
err = fmt.Errorf("unable to obfuscate "+
|
|
||||||
"error: %v", err)
|
|
||||||
log.Error(err)
|
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
// Otherwise, it's a forwarded error, so we'll perform a
|
// Otherwise, it's a forwarded error, so we'll perform a
|
||||||
// wrapper encryption as normal.
|
// wrapper encryption as normal.
|
||||||
|
@ -11,14 +11,14 @@ import (
|
|||||||
|
|
||||||
var (
|
var (
|
||||||
testRootKey = []byte("dummyRootKey")
|
testRootKey = []byte("dummyRootKey")
|
||||||
testId = []byte("dummyId")
|
testID = []byte("dummyId")
|
||||||
testLocation = "lnd"
|
testLocation = "lnd"
|
||||||
testVersion = macaroon.LatestVersion
|
testVersion = macaroon.LatestVersion
|
||||||
expectedTimeCaveatSubstring = "time-before " + string(time.Now().Year())
|
expectedTimeCaveatSubstring = "time-before " + string(time.Now().Year())
|
||||||
)
|
)
|
||||||
|
|
||||||
func createDummyMacaroon(t *testing.T) *macaroon.Macaroon {
|
func createDummyMacaroon(t *testing.T) *macaroon.Macaroon {
|
||||||
dummyMacaroon, err := macaroon.New(testRootKey, testId,
|
dummyMacaroon, err := macaroon.New(testRootKey, testID,
|
||||||
testLocation, testVersion)
|
testLocation, testVersion)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Error creating initial macaroon: %v", err)
|
t.Fatalf("Error creating initial macaroon: %v", err)
|
||||||
|
@ -665,7 +665,7 @@ func (c *ClientDB) RegisterChannel(chanID lnwire.ChannelID,
|
|||||||
case err == ErrChannelNotRegistered:
|
case err == ErrChannelNotRegistered:
|
||||||
|
|
||||||
// Unexpected error.
|
// Unexpected error.
|
||||||
case err != nil:
|
default:
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ func ReadElement(r io.Reader, element interface{}) error {
|
|||||||
return nil
|
return nil
|
||||||
|
|
||||||
// Fail if error is not UnknownElementType.
|
// Fail if error is not UnknownElementType.
|
||||||
case err != nil:
|
default:
|
||||||
if _, ok := err.(UnknownElementType); !ok {
|
if _, ok := err.(UnknownElementType); !ok {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -80,7 +80,7 @@ func WriteElement(w io.Writer, element interface{}) error {
|
|||||||
return nil
|
return nil
|
||||||
|
|
||||||
// Fail if error is not UnknownElementType.
|
// Fail if error is not UnknownElementType.
|
||||||
case err != nil:
|
default:
|
||||||
if _, ok := err.(UnknownElementType); !ok {
|
if _, ok := err.(UnknownElementType); !ok {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user