mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-04 09:48:19 +01:00
multi: fix linter warnings with updated linter
This commit is contained in:
parent
7506383074
commit
92da6b1d44
11 changed files with 23 additions and 26 deletions
|
@ -444,7 +444,6 @@ func (h *htlcTimeoutResolver) sweepSecondLevelTx() error {
|
||||||
|
|
||||||
var inp input.Input
|
var inp input.Input
|
||||||
if h.isTaproot() {
|
if h.isTaproot() {
|
||||||
//nolint:lll
|
|
||||||
inp = lnutils.Ptr(input.MakeHtlcSecondLevelTimeoutTaprootInput(
|
inp = lnutils.Ptr(input.MakeHtlcSecondLevelTimeoutTaprootInput(
|
||||||
h.htlcResolution.SignedTimeoutTx,
|
h.htlcResolution.SignedTimeoutTx,
|
||||||
h.htlcResolution.SignDetails,
|
h.htlcResolution.SignDetails,
|
||||||
|
|
|
@ -159,7 +159,7 @@ func (r *resolverCtrlBlocks) Decode(reader io.Reader) error {
|
||||||
|
|
||||||
// resolverCtrlBlocksEncoder is a custom TLV encoder for the
|
// resolverCtrlBlocksEncoder is a custom TLV encoder for the
|
||||||
// resolverCtrlBlocks.
|
// resolverCtrlBlocks.
|
||||||
func resolverCtrlBlocksEncoder(w io.Writer, val any, buf *[8]byte) error {
|
func resolverCtrlBlocksEncoder(w io.Writer, val any, _ *[8]byte) error {
|
||||||
if typ, ok := val.(*resolverCtrlBlocks); ok {
|
if typ, ok := val.(*resolverCtrlBlocks); ok {
|
||||||
return (*typ).Encode(w)
|
return (*typ).Encode(w)
|
||||||
}
|
}
|
||||||
|
@ -168,7 +168,7 @@ func resolverCtrlBlocksEncoder(w io.Writer, val any, buf *[8]byte) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// rsolverCtrlBlocksDecoder is a custom TLV decoder for the resolverCtrlBlocks.
|
// rsolverCtrlBlocksDecoder is a custom TLV decoder for the resolverCtrlBlocks.
|
||||||
func resolverCtrlBlocksDecoder(r io.Reader, val any, buf *[8]byte,
|
func resolverCtrlBlocksDecoder(r io.Reader, val any, _ *[8]byte,
|
||||||
l uint64) error {
|
l uint64) error {
|
||||||
|
|
||||||
if typ, ok := val.(*resolverCtrlBlocks); ok {
|
if typ, ok := val.(*resolverCtrlBlocks); ok {
|
||||||
|
@ -259,7 +259,7 @@ func varBytesDecoder(r io.Reader, val any, buf *[8]byte, l uint64) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// ctrlBlockEncoder is a custom TLV encoder for the ctrlBlocks struct.
|
// ctrlBlockEncoder is a custom TLV encoder for the ctrlBlocks struct.
|
||||||
func ctrlBlockEncoder(w io.Writer, val any, buf *[8]byte) error {
|
func ctrlBlockEncoder(w io.Writer, val any, _ *[8]byte) error {
|
||||||
if t, ok := val.(**ctrlBlocks); ok {
|
if t, ok := val.(**ctrlBlocks); ok {
|
||||||
return (*t).Encode(w)
|
return (*t).Encode(w)
|
||||||
}
|
}
|
||||||
|
@ -268,7 +268,7 @@ func ctrlBlockEncoder(w io.Writer, val any, buf *[8]byte) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// ctrlBlockDecoder is a custom TLV decoder for the ctrlBlocks struct.
|
// ctrlBlockDecoder is a custom TLV decoder for the ctrlBlocks struct.
|
||||||
func ctrlBlockDecoder(r io.Reader, val any, buf *[8]byte, l uint64) error {
|
func ctrlBlockDecoder(r io.Reader, val any, _ *[8]byte, l uint64) error {
|
||||||
if typ, ok := val.(**ctrlBlocks); ok {
|
if typ, ok := val.(**ctrlBlocks); ok {
|
||||||
ctrlReader := io.LimitReader(r, int64(l))
|
ctrlReader := io.LimitReader(r, int64(l))
|
||||||
|
|
||||||
|
@ -458,7 +458,7 @@ func (h *htlcTapTweaks) Encode(w io.Writer) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// htlcTapTweaksEncoder is a custom TLV encoder for the htlcTapTweaks struct.
|
// htlcTapTweaksEncoder is a custom TLV encoder for the htlcTapTweaks struct.
|
||||||
func htlcTapTweaksEncoder(w io.Writer, val any, buf *[8]byte) error {
|
func htlcTapTweaksEncoder(w io.Writer, val any, _ *[8]byte) error {
|
||||||
if t, ok := val.(*htlcTapTweaks); ok {
|
if t, ok := val.(*htlcTapTweaks); ok {
|
||||||
return (*t).Encode(w)
|
return (*t).Encode(w)
|
||||||
}
|
}
|
||||||
|
@ -467,7 +467,7 @@ func htlcTapTweaksEncoder(w io.Writer, val any, buf *[8]byte) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// htlcTapTweaksDecoder is a custom TLV decoder for the htlcTapTweaks struct.
|
// htlcTapTweaksDecoder is a custom TLV decoder for the htlcTapTweaks struct.
|
||||||
func htlcTapTweaksDecoder(r io.Reader, val any, buf *[8]byte,
|
func htlcTapTweaksDecoder(r io.Reader, val any, _ *[8]byte,
|
||||||
l uint64) error {
|
l uint64) error {
|
||||||
|
|
||||||
if typ, ok := val.(*htlcTapTweaks); ok {
|
if typ, ok := val.(*htlcTapTweaks); ok {
|
||||||
|
@ -538,7 +538,7 @@ func newTapTweaks() *tapTweaks {
|
||||||
}
|
}
|
||||||
|
|
||||||
// tapTweaksEncoder is a custom TLV encoder for the tapTweaks struct.
|
// tapTweaksEncoder is a custom TLV encoder for the tapTweaks struct.
|
||||||
func tapTweaksEncoder(w io.Writer, val any, buf *[8]byte) error {
|
func tapTweaksEncoder(w io.Writer, val any, _ *[8]byte) error {
|
||||||
if t, ok := val.(**tapTweaks); ok {
|
if t, ok := val.(**tapTweaks); ok {
|
||||||
return (*t).Encode(w)
|
return (*t).Encode(w)
|
||||||
}
|
}
|
||||||
|
@ -547,7 +547,7 @@ func tapTweaksEncoder(w io.Writer, val any, buf *[8]byte) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// tapTweaksDecoder is a custom TLV decoder for the tapTweaks struct.
|
// tapTweaksDecoder is a custom TLV decoder for the tapTweaks struct.
|
||||||
func tapTweaksDecoder(r io.Reader, val any, buf *[8]byte, l uint64) error {
|
func tapTweaksDecoder(r io.Reader, val any, _ *[8]byte, l uint64) error {
|
||||||
if typ, ok := val.(**tapTweaks); ok {
|
if typ, ok := val.(**tapTweaks); ok {
|
||||||
tweakReader := io.LimitReader(r, int64(l))
|
tweakReader := io.LimitReader(r, int64(l))
|
||||||
|
|
||||||
|
|
|
@ -1528,6 +1528,7 @@ func (f *Manager) handleFundingOpen(peer lnpeer.Peer,
|
||||||
"channel")
|
"channel")
|
||||||
log.Error(err)
|
log.Error(err)
|
||||||
f.failFundingFlow(peer, cid, err)
|
f.failFundingFlow(peer, cid, err)
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
// The current variant of taproot channels can only be used with
|
// The current variant of taproot channels can only be used with
|
||||||
|
@ -3646,7 +3647,7 @@ func genFirstStateMusigNonce(channel *channeldb.OpenChannel,
|
||||||
|
|
||||||
// handleChannelReady finalizes the channel funding process and enables the
|
// handleChannelReady finalizes the channel funding process and enables the
|
||||||
// channel to enter normal operating mode.
|
// channel to enter normal operating mode.
|
||||||
func (f *Manager) handleChannelReady(peer lnpeer.Peer,
|
func (f *Manager) handleChannelReady(peer lnpeer.Peer, //nolint:funlen
|
||||||
msg *lnwire.ChannelReady) {
|
msg *lnwire.ChannelReady) {
|
||||||
|
|
||||||
defer f.wg.Done()
|
defer f.wg.Done()
|
||||||
|
|
|
@ -432,7 +432,7 @@ func createContextV100RC2(privKey *btcec.PrivateKey,
|
||||||
// draft version 0.4.0.
|
// draft version 0.4.0.
|
||||||
func createContextV040(privKey *btcec.PrivateKey,
|
func createContextV040(privKey *btcec.PrivateKey,
|
||||||
allSignerPubKeys []*btcec.PublicKey, tweaks *MuSig2Tweaks,
|
allSignerPubKeys []*btcec.PublicKey, tweaks *MuSig2Tweaks,
|
||||||
sessionOpts ...musig2.SessionOption,
|
_ ...musig2.SessionOption,
|
||||||
) (*musig2v040.Context, *musig2v040.Session, error) {
|
) (*musig2v040.Context, *musig2v040.Session, error) {
|
||||||
|
|
||||||
// The context keeps track of all signing keys and our local key.
|
// The context keeps track of all signing keys and our local key.
|
||||||
|
|
|
@ -142,7 +142,7 @@ func testBasicChannelFunding(ht *lntest.HarnessTest) {
|
||||||
chansCommitType == lnrpc.CommitmentType_ANCHORS:
|
chansCommitType == lnrpc.CommitmentType_ANCHORS:
|
||||||
|
|
||||||
case expType == lnrpc.CommitmentType_STATIC_REMOTE_KEY &&
|
case expType == lnrpc.CommitmentType_STATIC_REMOTE_KEY &&
|
||||||
chansCommitType == lnrpc.CommitmentType_STATIC_REMOTE_KEY:
|
chansCommitType == lnrpc.CommitmentType_STATIC_REMOTE_KEY: //nolint:lll
|
||||||
|
|
||||||
case expType == lnrpc.CommitmentType_LEGACY &&
|
case expType == lnrpc.CommitmentType_LEGACY &&
|
||||||
chansCommitType == lnrpc.CommitmentType_LEGACY:
|
chansCommitType == lnrpc.CommitmentType_LEGACY:
|
||||||
|
@ -221,7 +221,7 @@ func basicChannelFundingTest(ht *lntest.HarnessTest,
|
||||||
)
|
)
|
||||||
|
|
||||||
// Deprecated fields.
|
// Deprecated fields.
|
||||||
newResp.Balance += int64(local) // nolint:staticcheck
|
newResp.Balance += int64(local)
|
||||||
ht.AssertChannelBalanceResp(node, newResp)
|
ht.AssertChannelBalanceResp(node, newResp)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -393,11 +393,6 @@ func testUnconfirmedChannelFunding(ht *lntest.HarnessTest) {
|
||||||
// testChannelFundingInputTypes tests that any type of supported input type can
|
// testChannelFundingInputTypes tests that any type of supported input type can
|
||||||
// be used to fund channels.
|
// be used to fund channels.
|
||||||
func testChannelFundingInputTypes(ht *lntest.HarnessTest) {
|
func testChannelFundingInputTypes(ht *lntest.HarnessTest) {
|
||||||
const (
|
|
||||||
chanAmt = funding.MaxBtcFundingAmount
|
|
||||||
burnAddr = "bcrt1qxsnqpdc842lu8c0xlllgvejt6rhy49u6fmpgyz"
|
|
||||||
)
|
|
||||||
|
|
||||||
// We'll start off by creating a node for Carol.
|
// We'll start off by creating a node for Carol.
|
||||||
carol := ht.NewNode("Carol", nil)
|
carol := ht.NewNode("Carol", nil)
|
||||||
|
|
||||||
|
|
|
@ -211,7 +211,7 @@ func (w *WitnessScriptDesc) WitnessScriptToSign() []byte {
|
||||||
// An error is returned if the path is unknown. This is useful as when
|
// An error is returned if the path is unknown. This is useful as when
|
||||||
// constructing a contrl block for a given path, one also needs witness script
|
// constructing a contrl block for a given path, one also needs witness script
|
||||||
// being signed.
|
// being signed.
|
||||||
func (w *WitnessScriptDesc) WitnessScriptForPath(path input.ScriptPath,
|
func (w *WitnessScriptDesc) WitnessScriptForPath(_ input.ScriptPath,
|
||||||
) ([]byte, error) {
|
) ([]byte, error) {
|
||||||
|
|
||||||
return w.WitnessScript, nil
|
return w.WitnessScript, nil
|
||||||
|
|
|
@ -657,13 +657,15 @@ func (r *RPCKeyRing) ComputeInputScript(tx *wire.MsgTx,
|
||||||
func (r *RPCKeyRing) MuSig2CreateSession(bipVersion input.MuSig2Version,
|
func (r *RPCKeyRing) MuSig2CreateSession(bipVersion input.MuSig2Version,
|
||||||
keyLoc keychain.KeyLocator, pubKeys []*btcec.PublicKey,
|
keyLoc keychain.KeyLocator, pubKeys []*btcec.PublicKey,
|
||||||
tweaks *input.MuSig2Tweaks, otherNonces [][musig2.PubNonceSize]byte,
|
tweaks *input.MuSig2Tweaks, otherNonces [][musig2.PubNonceSize]byte,
|
||||||
sessionOpts ...musig2.SessionOption) (*input.MuSig2SessionInfo, error) {
|
_ ...musig2.SessionOption) (*input.MuSig2SessionInfo, error) {
|
||||||
|
|
||||||
apiVersion, err := signrpc.MarshalMuSig2Version(bipVersion)
|
apiVersion, err := signrpc.MarshalMuSig2Version(bipVersion)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(roasbeef): add protos to specify session options
|
||||||
|
|
||||||
// We need to serialize all data for the RPC call. We can do that by
|
// We need to serialize all data for the RPC call. We can do that by
|
||||||
// putting everything directly into the request struct.
|
// putting everything directly into the request struct.
|
||||||
req := &signrpc.MuSig2SessionRequest{
|
req := &signrpc.MuSig2SessionRequest{
|
||||||
|
|
|
@ -26,7 +26,7 @@ func (m *Musig2Nonce) Record() tlv.Record {
|
||||||
}
|
}
|
||||||
|
|
||||||
// nonceTypeEncoder is a custom TLV encoder for the Musig2Nonce type.
|
// nonceTypeEncoder is a custom TLV encoder for the Musig2Nonce type.
|
||||||
func nonceTypeEncoder(w io.Writer, val interface{}, buf *[8]byte) error {
|
func nonceTypeEncoder(w io.Writer, val interface{}, _ *[8]byte) error {
|
||||||
if v, ok := val.(*Musig2Nonce); ok {
|
if v, ok := val.(*Musig2Nonce); ok {
|
||||||
_, err := w.Write(v[:])
|
_, err := w.Write(v[:])
|
||||||
return err
|
return err
|
||||||
|
@ -36,7 +36,7 @@ func nonceTypeEncoder(w io.Writer, val interface{}, buf *[8]byte) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// nonceTypeDecoder is a custom TLV decoder for the Musig2Nonce record.
|
// nonceTypeDecoder is a custom TLV decoder for the Musig2Nonce record.
|
||||||
func nonceTypeDecoder(r io.Reader, val interface{}, buf *[8]byte,
|
func nonceTypeDecoder(r io.Reader, val interface{}, _ *[8]byte,
|
||||||
l uint64) error {
|
l uint64) error {
|
||||||
|
|
||||||
if v, ok := val.(*Musig2Nonce); ok {
|
if v, ok := val.(*Musig2Nonce); ok {
|
||||||
|
|
|
@ -137,7 +137,7 @@ func (p *PartialSigWithNonce) Record() tlv.Record {
|
||||||
// partialSigWithNonceTypeEncoder encodes 98-byte musig2 extended partial
|
// partialSigWithNonceTypeEncoder encodes 98-byte musig2 extended partial
|
||||||
// signature as: s {32} || nonce {66}.
|
// signature as: s {32} || nonce {66}.
|
||||||
func partialSigWithNonceTypeEncoder(w io.Writer, val interface{},
|
func partialSigWithNonceTypeEncoder(w io.Writer, val interface{},
|
||||||
buf *[8]byte) error {
|
_ *[8]byte) error {
|
||||||
|
|
||||||
if v, ok := val.(*PartialSigWithNonce); ok {
|
if v, ok := val.(*PartialSigWithNonce); ok {
|
||||||
sigBytes := v.Sig.Bytes()
|
sigBytes := v.Sig.Bytes()
|
||||||
|
|
|
@ -29,7 +29,7 @@ func (s *ShutdownNonce) Record() tlv.Record {
|
||||||
|
|
||||||
// shutdownNonceTypeEncoder is a custom TLV encoder for the Musig2Nonce type.
|
// shutdownNonceTypeEncoder is a custom TLV encoder for the Musig2Nonce type.
|
||||||
func shutdownNonceTypeEncoder(w io.Writer, val interface{},
|
func shutdownNonceTypeEncoder(w io.Writer, val interface{},
|
||||||
buf *[8]byte) error {
|
_ *[8]byte) error {
|
||||||
|
|
||||||
if v, ok := val.(*ShutdownNonce); ok {
|
if v, ok := val.(*ShutdownNonce); ok {
|
||||||
_, err := w.Write(v[:])
|
_, err := w.Write(v[:])
|
||||||
|
@ -40,7 +40,7 @@ func shutdownNonceTypeEncoder(w io.Writer, val interface{},
|
||||||
}
|
}
|
||||||
|
|
||||||
// shutdownNonceTypeDecoder is a custom TLV decoder for the Musig2Nonce record.
|
// shutdownNonceTypeDecoder is a custom TLV decoder for the Musig2Nonce record.
|
||||||
func shutdownNonceTypeDecoder(r io.Reader, val interface{}, buf *[8]byte,
|
func shutdownNonceTypeDecoder(r io.Reader, val interface{}, _ *[8]byte,
|
||||||
l uint64) error {
|
l uint64) error {
|
||||||
|
|
||||||
if v, ok := val.(*ShutdownNonce); ok {
|
if v, ok := val.(*ShutdownNonce); ok {
|
||||||
|
|
|
@ -1462,7 +1462,7 @@
|
||||||
|
|
||||||
|
|
||||||
; Set to enable support for the experimental taproot channel type.
|
; Set to enable support for the experimental taproot channel type.
|
||||||
; protocol.simple-taproot-chans
|
; protocol.simple-taproot-chans=false
|
||||||
|
|
||||||
[db]
|
[db]
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue