mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-21 22:11:41 +01:00
multi: rename nolint:lll to nolint:ll
Find and replace all nolint instances refering to the `lll` linter and replace with `ll` which is the name of our custom version of the `lll` linter which can be used to ignore log lines during linting. The next commit will do the configuration of the custom linter and disable the default one.
This commit is contained in:
parent
88f5369066
commit
ab7aae0708
123 changed files with 286 additions and 286 deletions
|
@ -23,7 +23,7 @@ const (
|
|||
|
||||
// LogConfig holds logging configuration options.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
type LogConfig struct {
|
||||
Console *consoleLoggerCfg `group:"console" namespace:"console" description:"The logger writing to stdout and stderr."`
|
||||
File *FileLoggerConfig `group:"file" namespace:"file" description:"The logger writing to LND's standard log file."`
|
||||
|
@ -41,7 +41,7 @@ func (c *LogConfig) Validate() error {
|
|||
|
||||
// LoggerConfig holds options for a particular logger.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
type LoggerConfig struct {
|
||||
Disable bool `long:"disable" description:"Disable this logger."`
|
||||
NoTimestamps bool `long:"no-timestamps" description:"Omit timestamps from log lines."`
|
||||
|
@ -89,7 +89,7 @@ func (cfg *LoggerConfig) HandlerOptions() []btclog.HandlerOption {
|
|||
|
||||
// FileLoggerConfig extends LoggerConfig with specific log file options.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
type FileLoggerConfig struct {
|
||||
LoggerConfig
|
||||
Compressor string `long:"compressor" description:"Compression algorithm to use when rotating logs." choice:"gzip" choice:"zstd"`
|
||||
|
|
|
@ -22,7 +22,7 @@ const (
|
|||
// consoleLoggerCfg extends the LoggerConfig struct by adding a Color option
|
||||
// which is only available for a console logger.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
type consoleLoggerCfg struct {
|
||||
LoggerConfig
|
||||
Style bool `long:"style" description:"If set, the output will be styled with color and fonts"`
|
||||
|
|
|
@ -6,7 +6,7 @@ package build
|
|||
// consoleLoggerCfg embeds the LoggerConfig struct along with any extensions
|
||||
// specific to a production deployment.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
type consoleLoggerCfg struct {
|
||||
LoggerConfig
|
||||
}
|
||||
|
|
|
@ -256,7 +256,7 @@ out:
|
|||
// TODO(wilmer): add retry logic if rescan fails?
|
||||
b.wg.Add(1)
|
||||
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
go func(msg *chainntnfs.HistoricalConfDispatch) {
|
||||
defer b.wg.Done()
|
||||
|
||||
|
@ -301,7 +301,7 @@ out:
|
|||
// TODO(wilmer): add retry logic if rescan fails?
|
||||
b.wg.Add(1)
|
||||
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
go func(msg *chainntnfs.HistoricalSpendDispatch) {
|
||||
defer b.wg.Done()
|
||||
|
||||
|
|
|
@ -366,7 +366,7 @@ out:
|
|||
// TODO(wilmer): add retry logic if rescan fails?
|
||||
b.wg.Add(1)
|
||||
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
go func(msg *chainntnfs.HistoricalConfDispatch) {
|
||||
defer b.wg.Done()
|
||||
|
||||
|
|
|
@ -439,7 +439,7 @@ func (n *NeutrinoNotifier) notificationDispatcher() {
|
|||
// potentially long rescans.
|
||||
n.wg.Add(1)
|
||||
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
go func(msg *chainntnfs.HistoricalConfDispatch) {
|
||||
defer n.wg.Done()
|
||||
|
||||
|
|
|
@ -222,7 +222,7 @@ type ChainControl struct {
|
|||
// the parts that can be purely constructed from the passed in global
|
||||
// configuration and doesn't need any wallet instance yet.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
func NewPartialChainControl(cfg *Config) (*PartialChainControl, func(), error) {
|
||||
cc := &PartialChainControl{
|
||||
Cfg: cfg,
|
||||
|
|
|
@ -249,7 +249,7 @@ func (r *RPCAcceptor) sendAcceptRequests(errChan chan error,
|
|||
acceptRequests := make(map[[32]byte]*chanAcceptInfo)
|
||||
|
||||
for {
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
select {
|
||||
// Consume requests passed to us from our Accept() function and
|
||||
// send them into our stream.
|
||||
|
|
|
@ -1691,7 +1691,7 @@ var (
|
|||
|
||||
// DeriveMusig2Shachain derives a shachain producer for the taproot channel
|
||||
// from normal shachain revocation root.
|
||||
func DeriveMusig2Shachain(revRoot shachain.Producer) (shachain.Producer, error) { //nolint:lll
|
||||
func DeriveMusig2Shachain(revRoot shachain.Producer) (shachain.Producer, error) { //nolint:ll
|
||||
// In order to obtain the revocation root hash to create the taproot
|
||||
// revocation, we'll encode the producer into a buffer, then use that
|
||||
// to derive the shachain root needed.
|
||||
|
|
|
@ -55,7 +55,7 @@ type FailCode uint16
|
|||
// The currently defined onion failure types within this current version of the
|
||||
// Lightning protocol.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
const (
|
||||
CodeNone FailCode = 0
|
||||
CodeInvalidRealm = FlagBadOnion | 1
|
||||
|
|
|
@ -118,7 +118,7 @@ var (
|
|||
},
|
||||
}
|
||||
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
resultNew1Hop1 = &mcHop{
|
||||
channelID: tlv.NewPrimitiveRecord[tlv.TlvType0, uint64](100),
|
||||
pubKeyBytes: tlv.NewRecordT[tlv.TlvType1](testPub),
|
||||
|
@ -128,14 +128,14 @@ var (
|
|||
),
|
||||
}
|
||||
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
resultNew1Hop2 = &mcHop{
|
||||
channelID: tlv.NewPrimitiveRecord[tlv.TlvType0, uint64](800),
|
||||
pubKeyBytes: tlv.NewRecordT[tlv.TlvType1](testPub),
|
||||
amtToFwd: tlv.NewPrimitiveRecord[tlv.TlvType2, lnwire.MilliSatoshi](4),
|
||||
}
|
||||
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
resultNew1Hop3 = &mcHop{
|
||||
channelID: tlv.NewPrimitiveRecord[tlv.TlvType0, uint64](800),
|
||||
pubKeyBytes: tlv.NewRecordT[tlv.TlvType1](testPub),
|
||||
|
@ -145,7 +145,7 @@ var (
|
|||
),
|
||||
}
|
||||
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
resultNew1Hop4 = &mcHop{
|
||||
channelID: tlv.NewPrimitiveRecord[tlv.TlvType0, uint64](800),
|
||||
pubKeyBytes: tlv.NewRecordT[tlv.TlvType1](testPub),
|
||||
|
@ -158,7 +158,7 @@ var (
|
|||
),
|
||||
}
|
||||
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
resultNew2Hop1 = &mcHop{
|
||||
channelID: tlv.NewPrimitiveRecord[tlv.TlvType0, uint64](800),
|
||||
pubKeyBytes: tlv.NewRecordT[tlv.TlvType1](testPub),
|
||||
|
@ -171,7 +171,7 @@ var (
|
|||
),
|
||||
}
|
||||
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
resultNew1 = paymentResultNew{
|
||||
id: 0,
|
||||
timeFwd: tlv.NewPrimitiveRecord[tlv.TlvType0](
|
||||
|
@ -200,7 +200,7 @@ var (
|
|||
}),
|
||||
}
|
||||
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
resultNew2 = paymentResultNew{
|
||||
id: 2,
|
||||
timeFwd: tlv.NewPrimitiveRecord[tlv.TlvType0, uint64](
|
||||
|
|
|
@ -380,7 +380,7 @@ func (p *PaymentControl) RegisterAttempt(paymentHash lntypes.Hash,
|
|||
if attempt.Route.FinalHop().TotalAmtMsat !=
|
||||
h.Route.FinalHop().TotalAmtMsat {
|
||||
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
return ErrBlindedPaymentTotalAmountMismatch
|
||||
}
|
||||
|
||||
|
|
|
@ -169,7 +169,7 @@ func estimateFeeRate(ctx *cli.Context) error {
|
|||
SatPerKw int64 `json:"sat_per_kw"`
|
||||
SatPerVByte int64 `json:"sat_per_vbyte"`
|
||||
MinRelayFeeSatPerKw int64 `json:"min_relay_fee_sat_per_kw"`
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
MinRelayFeeSatPerVByte int64 `json:"min_relay_fee_sat_per_vbyte"`
|
||||
}{
|
||||
SatPerKw: int64(rateKW),
|
||||
|
|
|
@ -290,7 +290,7 @@ var (
|
|||
// See LoadConfig for further details regarding the configuration
|
||||
// loading+parsing process.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
type Config struct {
|
||||
ShowVersion bool `short:"V" long:"version" description:"Display version information and exit"`
|
||||
|
||||
|
@ -523,7 +523,7 @@ type Config struct {
|
|||
// for more details. Any value of 0 means we use the gRPC internal default
|
||||
// values.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
type GRPCConfig struct {
|
||||
// ServerPingTime is a duration for the amount of time of no activity
|
||||
// after which the server pings the client to see if the transport is
|
||||
|
@ -549,7 +549,7 @@ type GRPCConfig struct {
|
|||
|
||||
// DefaultConfig returns all default values for the Config struct.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
func DefaultConfig() Config {
|
||||
return Config{
|
||||
LndDir: DefaultLndDir,
|
||||
|
|
|
@ -1372,7 +1372,7 @@ func newRetributionInfo(chanPoint *wire.OutPoint,
|
|||
|
||||
// For taproot outputs, we also need to hold onto the second
|
||||
// level tap tweak as well.
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
htlcOutput.secondLevelTapTweak = breachedHtlc.SecondLevelTapTweak
|
||||
|
||||
breachedOutputs = append(breachedOutputs, htlcOutput)
|
||||
|
@ -1729,7 +1729,7 @@ func taprootBriefcaseFromRetInfo(retInfo *retributionInfo) *taprootBriefcase {
|
|||
// For spending from our commitment output on the remote
|
||||
// commitment, we'll need to stash the control block.
|
||||
case input.TaprootRemoteCommitSpend:
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
tapCase.CtrlBlocks.Val.CommitSweepCtrlBlock = bo.signDesc.ControlBlock
|
||||
|
||||
bo.resolutionBlob.WhenSome(func(blob tlv.Blob) {
|
||||
|
@ -1743,7 +1743,7 @@ func taprootBriefcaseFromRetInfo(retInfo *retributionInfo) *taprootBriefcase {
|
|||
// To spend the revoked output again, we'll store the same
|
||||
// control block value as above, but in a different place.
|
||||
case input.TaprootCommitmentRevoke:
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
tapCase.CtrlBlocks.Val.RevokeSweepCtrlBlock = bo.signDesc.ControlBlock
|
||||
|
||||
bo.resolutionBlob.WhenSome(func(blob tlv.Blob) {
|
||||
|
@ -1765,10 +1765,10 @@ func taprootBriefcaseFromRetInfo(retInfo *retributionInfo) *taprootBriefcase {
|
|||
copy(firstLevelTweak[:], bo.signDesc.TapTweak)
|
||||
secondLevelTweak := bo.secondLevelTapTweak
|
||||
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
tapCase.TapTweaks.Val.BreachedHtlcTweaks[resID] = firstLevelTweak
|
||||
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
tapCase.TapTweaks.Val.BreachedSecondLevelHltcTweaks[resID] = secondLevelTweak
|
||||
}
|
||||
}
|
||||
|
@ -1788,7 +1788,7 @@ func applyTaprootRetInfo(tapCase *taprootBriefcase,
|
|||
// For spending from our commitment output on the remote
|
||||
// commitment, we'll apply the control block.
|
||||
case input.TaprootRemoteCommitSpend:
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
bo.signDesc.ControlBlock = tapCase.CtrlBlocks.Val.CommitSweepCtrlBlock
|
||||
|
||||
tapCase.SettledCommitBlob.WhenSomeV(
|
||||
|
@ -1800,7 +1800,7 @@ func applyTaprootRetInfo(tapCase *taprootBriefcase,
|
|||
// To spend the revoked output again, we'll apply the same
|
||||
// control block value as above, but to a different place.
|
||||
case input.TaprootCommitmentRevoke:
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
bo.signDesc.ControlBlock = tapCase.CtrlBlocks.Val.RevokeSweepCtrlBlock
|
||||
|
||||
tapCase.BreachedCommitBlob.WhenSomeV(
|
||||
|
@ -1816,7 +1816,7 @@ func applyTaprootRetInfo(tapCase *taprootBriefcase,
|
|||
case input.TaprootHtlcOfferedRevoke:
|
||||
resID := newResolverID(bo.OutPoint())
|
||||
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
tap1, ok := tapCase.TapTweaks.Val.BreachedHtlcTweaks[resID]
|
||||
if !ok {
|
||||
return fmt.Errorf("unable to find taproot "+
|
||||
|
@ -1824,7 +1824,7 @@ func applyTaprootRetInfo(tapCase *taprootBriefcase,
|
|||
}
|
||||
bo.signDesc.TapTweak = tap1[:]
|
||||
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
tap2, ok := tapCase.TapTweaks.Val.BreachedSecondLevelHltcTweaks[resID]
|
||||
if !ok {
|
||||
return fmt.Errorf("unable to find taproot "+
|
||||
|
|
|
@ -1561,7 +1561,7 @@ func encodeTaprootAuxData(w io.Writer, c *ContractResolutions) error {
|
|||
if c.CommitResolution != nil {
|
||||
commitResolution := c.CommitResolution
|
||||
commitSignDesc := commitResolution.SelfOutputSignDesc
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
tapCase.CtrlBlocks.Val.CommitSweepCtrlBlock = commitSignDesc.ControlBlock
|
||||
|
||||
c.CommitResolution.ResolutionBlob.WhenSome(func(b []byte) {
|
||||
|
@ -1587,21 +1587,21 @@ func encodeTaprootAuxData(w io.Writer, c *ContractResolutions) error {
|
|||
resID = newResolverID(
|
||||
htlc.SignedSuccessTx.TxIn[0].PreviousOutPoint,
|
||||
)
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
tapCase.CtrlBlocks.Val.SecondLevelCtrlBlocks[resID] = ctrlBlock
|
||||
|
||||
// For HTLCs we need to go to the second level for, we
|
||||
// also need to store the control block needed to
|
||||
// publish the second level transaction.
|
||||
if htlc.SignDetails != nil {
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
bridgeCtrlBlock := htlc.SignDetails.SignDesc.ControlBlock
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
tapCase.CtrlBlocks.Val.IncomingHtlcCtrlBlocks[resID] = bridgeCtrlBlock
|
||||
}
|
||||
} else {
|
||||
resID = newResolverID(htlc.ClaimOutpoint)
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
tapCase.CtrlBlocks.Val.IncomingHtlcCtrlBlocks[resID] = ctrlBlock
|
||||
}
|
||||
|
||||
|
@ -1624,23 +1624,23 @@ func encodeTaprootAuxData(w io.Writer, c *ContractResolutions) error {
|
|||
resID = newResolverID(
|
||||
htlc.SignedTimeoutTx.TxIn[0].PreviousOutPoint,
|
||||
)
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
tapCase.CtrlBlocks.Val.SecondLevelCtrlBlocks[resID] = ctrlBlock
|
||||
|
||||
// For HTLCs we need to go to the second level for, we
|
||||
// also need to store the control block needed to
|
||||
// publish the second level transaction.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
if htlc.SignDetails != nil {
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
bridgeCtrlBlock := htlc.SignDetails.SignDesc.ControlBlock
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
tapCase.CtrlBlocks.Val.OutgoingHtlcCtrlBlocks[resID] = bridgeCtrlBlock
|
||||
}
|
||||
} else {
|
||||
resID = newResolverID(htlc.ClaimOutpoint)
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
tapCase.CtrlBlocks.Val.OutgoingHtlcCtrlBlocks[resID] = ctrlBlock
|
||||
}
|
||||
|
||||
|
@ -1689,11 +1689,11 @@ func decodeTapRootAuxData(r io.Reader, c *ContractResolutions) error {
|
|||
htlc.SignedSuccessTx.TxIn[0].PreviousOutPoint,
|
||||
)
|
||||
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
ctrlBlock := tapCase.CtrlBlocks.Val.SecondLevelCtrlBlocks[resID]
|
||||
htlc.SweepSignDesc.ControlBlock = ctrlBlock
|
||||
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
if htlc.SignDetails != nil {
|
||||
bridgeCtrlBlock := tapCase.CtrlBlocks.Val.IncomingHtlcCtrlBlocks[resID]
|
||||
htlc.SignDetails.SignDesc.ControlBlock = bridgeCtrlBlock
|
||||
|
@ -1701,7 +1701,7 @@ func decodeTapRootAuxData(r io.Reader, c *ContractResolutions) error {
|
|||
} else {
|
||||
resID = newResolverID(htlc.ClaimOutpoint)
|
||||
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
ctrlBlock := tapCase.CtrlBlocks.Val.IncomingHtlcCtrlBlocks[resID]
|
||||
htlc.SweepSignDesc.ControlBlock = ctrlBlock
|
||||
}
|
||||
|
@ -1722,11 +1722,11 @@ func decodeTapRootAuxData(r io.Reader, c *ContractResolutions) error {
|
|||
htlc.SignedTimeoutTx.TxIn[0].PreviousOutPoint,
|
||||
)
|
||||
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
ctrlBlock := tapCase.CtrlBlocks.Val.SecondLevelCtrlBlocks[resID]
|
||||
htlc.SweepSignDesc.ControlBlock = ctrlBlock
|
||||
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
if htlc.SignDetails != nil {
|
||||
bridgeCtrlBlock := tapCase.CtrlBlocks.Val.OutgoingHtlcCtrlBlocks[resID]
|
||||
htlc.SignDetails.SignDesc.ControlBlock = bridgeCtrlBlock
|
||||
|
@ -1734,7 +1734,7 @@ func decodeTapRootAuxData(r io.Reader, c *ContractResolutions) error {
|
|||
} else {
|
||||
resID = newResolverID(htlc.ClaimOutpoint)
|
||||
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
ctrlBlock := tapCase.CtrlBlocks.Val.OutgoingHtlcCtrlBlocks[resID]
|
||||
htlc.SweepSignDesc.ControlBlock = ctrlBlock
|
||||
}
|
||||
|
|
|
@ -639,7 +639,7 @@ func (c *ChainArbitrator) Start() error {
|
|||
// corresponding more restricted resolver, as we don't have to watch
|
||||
// the chain any longer, only resolve the contracts on the confirmed
|
||||
// commitment.
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
for _, closeChanInfo := range closingChannels {
|
||||
// We can leave off the CloseContract and ForceCloseChan
|
||||
// methods as the channel is already closed at this point.
|
||||
|
|
|
@ -431,7 +431,7 @@ func (c *chainWatcher) handleUnknownLocalState(
|
|||
|
||||
auxResult, err := fn.MapOptionZ(
|
||||
c.cfg.auxLeafStore,
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
func(s lnwallet.AuxLeafStore) fn.Result[lnwallet.CommitDiffAuxResult] {
|
||||
return s.FetchLeavesFromCommit(
|
||||
lnwallet.NewAuxChanState(c.cfg.chanState),
|
||||
|
|
|
@ -593,11 +593,11 @@ func maybeAugmentTaprootResolvers(chanType channeldb.ChannelType,
|
|||
switch r := resolver.(type) {
|
||||
case *commitSweepResolver:
|
||||
if contractResolutions.CommitResolution != nil {
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
r.commitResolution = *contractResolutions.CommitResolution
|
||||
}
|
||||
case *htlcOutgoingContestResolver:
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
htlcResolutions := contractResolutions.HtlcResolutions.OutgoingHTLCs
|
||||
for _, htlcRes := range htlcResolutions {
|
||||
htlcRes := htlcRes
|
||||
|
@ -610,7 +610,7 @@ func maybeAugmentTaprootResolvers(chanType channeldb.ChannelType,
|
|||
}
|
||||
|
||||
case *htlcTimeoutResolver:
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
htlcResolutions := contractResolutions.HtlcResolutions.OutgoingHTLCs
|
||||
for _, htlcRes := range htlcResolutions {
|
||||
htlcRes := htlcRes
|
||||
|
@ -623,7 +623,7 @@ func maybeAugmentTaprootResolvers(chanType channeldb.ChannelType,
|
|||
}
|
||||
|
||||
case *htlcIncomingContestResolver:
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
htlcResolutions := contractResolutions.HtlcResolutions.IncomingHTLCs
|
||||
for _, htlcRes := range htlcResolutions {
|
||||
htlcRes := htlcRes
|
||||
|
@ -635,7 +635,7 @@ func maybeAugmentTaprootResolvers(chanType channeldb.ChannelType,
|
|||
}
|
||||
}
|
||||
case *htlcSuccessResolver:
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
htlcResolutions := contractResolutions.HtlcResolutions.IncomingHTLCs
|
||||
for _, htlcRes := range htlcResolutions {
|
||||
htlcRes := htlcRes
|
||||
|
|
|
@ -694,7 +694,7 @@ func TestChannelArbitratorLocalForceClose(t *testing.T) {
|
|||
|
||||
// Now notify about the local force close getting confirmed.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
chanArb.cfg.ChainEvents.LocalUnilateralClosure <- &LocalUnilateralCloseInfo{
|
||||
SpendDetail: &chainntnfs.SpendDetail{},
|
||||
LocalForceCloseSummary: &lnwallet.LocalForceCloseSummary{
|
||||
|
@ -991,7 +991,7 @@ func TestChannelArbitratorLocalForceClosePendingHtlc(t *testing.T) {
|
|||
},
|
||||
}
|
||||
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
chanArb.cfg.ChainEvents.LocalUnilateralClosure <- &LocalUnilateralCloseInfo{
|
||||
SpendDetail: &chainntnfs.SpendDetail{},
|
||||
LocalForceCloseSummary: &lnwallet.LocalForceCloseSummary{
|
||||
|
@ -1620,7 +1620,7 @@ func TestChannelArbitratorCommitFailure(t *testing.T) {
|
|||
},
|
||||
{
|
||||
closeType: channeldb.LocalForceClose,
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
sendEvent: func(chanArb *ChannelArbitrator) {
|
||||
chanArb.cfg.ChainEvents.LocalUnilateralClosure <- &LocalUnilateralCloseInfo{
|
||||
SpendDetail: &chainntnfs.SpendDetail{},
|
||||
|
@ -1957,7 +1957,7 @@ func TestChannelArbitratorDanglingCommitForceClose(t *testing.T) {
|
|||
// resolutions sent since we have none on our
|
||||
// commitment transaction.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
uniCloseInfo := &LocalUnilateralCloseInfo{
|
||||
SpendDetail: &chainntnfs.SpendDetail{},
|
||||
LocalForceCloseSummary: &lnwallet.LocalForceCloseSummary{
|
||||
|
@ -2884,7 +2884,7 @@ func TestChannelArbitratorAnchors(t *testing.T) {
|
|||
},
|
||||
}
|
||||
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
chanArb.cfg.ChainEvents.LocalUnilateralClosure <- &LocalUnilateralCloseInfo{
|
||||
SpendDetail: &chainntnfs.SpendDetail{},
|
||||
LocalForceCloseSummary: &lnwallet.LocalForceCloseSummary{
|
||||
|
|
|
@ -28,7 +28,7 @@ const (
|
|||
// BudgetConfig is a struct that holds the configuration when offering outputs
|
||||
// to the sweeper.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
type BudgetConfig struct {
|
||||
ToLocal btcutil.Amount `long:"tolocal" description:"The amount in satoshis to allocate as the budget to pay fees when sweeping the to_local output. If set, the budget calculated using the ratio (if set) will be capped at this value."`
|
||||
ToLocalRatio float64 `long:"tolocalratio" description:"The ratio of the value in to_local output to allocate as the budget to pay fees when sweeping it."`
|
||||
|
|
|
@ -220,7 +220,7 @@ func (h *htlcIncomingContestResolver) Resolve(
|
|||
//
|
||||
// So we'll insert it at the 3rd index of the witness.
|
||||
case isTaproot:
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
h.htlcResolution.SignedSuccessTx.TxIn[0].Witness[2] = preimage[:]
|
||||
|
||||
// Within the witness for the success transaction, the
|
||||
|
|
|
@ -242,7 +242,7 @@ func (h *htlcSuccessResolver) broadcastReSignedSuccessTx(immediate bool) (
|
|||
if !h.outputIncubating {
|
||||
var secondLevelInput input.HtlcSecondLevelAnchorInput
|
||||
if isTaproot {
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
secondLevelInput = input.MakeHtlcSecondLevelSuccessTaprootInput(
|
||||
h.htlcResolution.SignedSuccessTx,
|
||||
h.htlcResolution.SignDetails, h.htlcResolution.Preimage,
|
||||
|
@ -252,7 +252,7 @@ func (h *htlcSuccessResolver) broadcastReSignedSuccessTx(immediate bool) (
|
|||
),
|
||||
)
|
||||
} else {
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
secondLevelInput = input.MakeHtlcSecondLevelSuccessAnchorInput(
|
||||
h.htlcResolution.SignedSuccessTx,
|
||||
h.htlcResolution.SignDetails, h.htlcResolution.Preimage,
|
||||
|
|
|
@ -178,7 +178,7 @@ func (h *htlcTimeoutResolver) claimCleanUp(
|
|||
// - <sender sig> <receiver sig> <preimage> <success_script>
|
||||
// <control_block>
|
||||
case h.isTaproot() && h.htlcResolution.SignedTimeoutTx == nil:
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
preimageBytes = spendingInput.Witness[taprootRemotePreimageIndex]
|
||||
|
||||
// The witness stack when the remote party sweeps the output on a
|
||||
|
@ -269,7 +269,7 @@ func (h *htlcTimeoutResolver) chainDetailsToWatch() (*wire.OutPoint, []byte, err
|
|||
// witness script (the last element of the witness stack) to
|
||||
// re-construct the pkScript we need to watch.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
outPointToWatch := h.htlcResolution.SignedTimeoutTx.TxIn[0].PreviousOutPoint
|
||||
witness := h.htlcResolution.SignedTimeoutTx.TxIn[0].Witness
|
||||
|
||||
|
@ -825,7 +825,7 @@ func (h *htlcTimeoutResolver) handleCommitSpend(
|
|||
|
||||
var csvWitnessType input.StandardWitnessType
|
||||
if h.isTaproot() {
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
csvWitnessType = input.TaprootHtlcOfferedTimeoutSecondLevel
|
||||
} else {
|
||||
csvWitnessType = input.HtlcOfferedTimeoutSecondLevel
|
||||
|
|
|
@ -290,7 +290,7 @@ func testHtlcTimeoutResolver(t *testing.T, testCase htlcTimeoutTestCase) {
|
|||
resolutionChan := make(chan ResolutionMsg, 1)
|
||||
reportChan := make(chan *channeldb.ResolverReport)
|
||||
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
chainCfg := ChannelArbitratorConfig{
|
||||
ChainArbitratorConfig: ChainArbitratorConfig{
|
||||
Notifier: notifier,
|
||||
|
@ -371,10 +371,10 @@ func testHtlcTimeoutResolver(t *testing.T, testCase htlcTimeoutTestCase) {
|
|||
if testCase.timeout {
|
||||
timeoutTxID := timeoutTx.TxHash()
|
||||
report := &channeldb.ResolverReport{
|
||||
OutPoint: timeoutTx.TxIn[0].PreviousOutPoint, //nolint:lll
|
||||
OutPoint: timeoutTx.TxIn[0].PreviousOutPoint, //nolint:ll
|
||||
Amount: testHtlcAmt.ToSatoshis(),
|
||||
ResolverType: channeldb.ResolverTypeOutgoingHtlc, //nolint:lll
|
||||
ResolverOutcome: channeldb.ResolverOutcomeFirstStage, //nolint:lll
|
||||
ResolverType: channeldb.ResolverTypeOutgoingHtlc, //nolint:ll
|
||||
ResolverOutcome: channeldb.ResolverOutcomeFirstStage, //nolint:ll
|
||||
SpendTxID: &timeoutTxID,
|
||||
}
|
||||
|
||||
|
|
|
@ -555,7 +555,7 @@ func (u *UtxoNursery) NurseryReport(
|
|||
// confirmation of the commitment transaction.
|
||||
switch kid.WitnessType() {
|
||||
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
case input.TaprootHtlcAcceptedSuccessSecondLevel:
|
||||
fallthrough
|
||||
case input.HtlcAcceptedSuccessSecondLevel:
|
||||
|
@ -590,7 +590,7 @@ func (u *UtxoNursery) NurseryReport(
|
|||
// it.
|
||||
report.AddLimboDirectHtlc(&kid)
|
||||
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
case input.TaprootHtlcAcceptedSuccessSecondLevel:
|
||||
fallthrough
|
||||
case input.TaprootHtlcOfferedTimeoutSecondLevel:
|
||||
|
@ -611,7 +611,7 @@ func (u *UtxoNursery) NurseryReport(
|
|||
// balance.
|
||||
switch kid.WitnessType() {
|
||||
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
case input.TaprootHtlcAcceptedSuccessSecondLevel:
|
||||
fallthrough
|
||||
case input.TaprootHtlcOfferedTimeoutSecondLevel:
|
||||
|
|
|
@ -1461,7 +1461,7 @@ func TestSignatureAnnouncementRetryAtStartup(t *testing.T) {
|
|||
return lnwire.ShortChannelID{}, fmt.Errorf("no peer alias")
|
||||
}
|
||||
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
gossiper := New(Config{
|
||||
Notifier: ctx.gossiper.cfg.Notifier,
|
||||
Broadcast: ctx.gossiper.cfg.Broadcast,
|
||||
|
|
|
@ -230,7 +230,7 @@ func (b *Batcher) BatchFund(ctx context.Context,
|
|||
err)
|
||||
}
|
||||
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
fundingReq, err := b.cfg.RequestParser(&lnrpc.OpenChannelRequest{
|
||||
SatPerVbyte: uint64(req.SatPerVbyte),
|
||||
TargetConf: req.TargetConf,
|
||||
|
|
|
@ -39,7 +39,7 @@ func TestCommitmentTypeNegotiation(t *testing.T) {
|
|||
lnwire.StaticRemoteKeyOptional,
|
||||
lnwire.AnchorsZeroFeeHtlcTxOptional,
|
||||
),
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
expectsCommitType: lnwallet.CommitmentTypeAnchorsZeroFeeHtlcTx,
|
||||
expectsChanType: nil,
|
||||
expectsErr: nil,
|
||||
|
|
|
@ -4028,7 +4028,7 @@ func (f *Manager) handleChannelReady(peer lnpeer.Peer, //nolint:funlen
|
|||
channelReadyMsg.AliasScid = &alias
|
||||
|
||||
if firstVerNonce != nil {
|
||||
channelReadyMsg.NextLocalNonce = lnwire.SomeMusig2Nonce( //nolint:lll
|
||||
channelReadyMsg.NextLocalNonce = lnwire.SomeMusig2Nonce( //nolint:ll
|
||||
firstVerNonce.PubNonce,
|
||||
)
|
||||
}
|
||||
|
|
|
@ -428,7 +428,7 @@ func (b *Builder) syncGraphWithChain() error {
|
|||
// pruning the channel graph with each new block that hasn't yet been
|
||||
// consumed by the channel graph.
|
||||
var spentOutputs []*wire.OutPoint
|
||||
for nextHeight := pruneHeight + 1; nextHeight <= uint32(bestHeight); nextHeight++ { //nolint:lll
|
||||
for nextHeight := pruneHeight + 1; nextHeight <= uint32(bestHeight); nextHeight++ { //nolint:ll
|
||||
// Break out of the rescan early if a shutdown has been
|
||||
// requested, otherwise long rescans will block the daemon from
|
||||
// shutting down promptly.
|
||||
|
@ -1236,7 +1236,7 @@ func (b *Builder) processUpdate(msg interface{},
|
|||
b.cfg.Chain, &channelID, b.quit,
|
||||
)
|
||||
if err != nil {
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
//
|
||||
// In order to ensure we don't erroneously mark a
|
||||
// channel as a zombie due to an RPC failure, we'll
|
||||
|
|
|
@ -1658,7 +1658,7 @@ func (c *ChannelGraph) DisconnectBlockAtHeight(height uint32) (
|
|||
var keys [][]byte
|
||||
cursor := edgeIndex.ReadWriteCursor()
|
||||
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
for k, v := cursor.Seek(chanIDStart[:]); k != nil &&
|
||||
bytes.Compare(k, chanIDEnd[:]) < 0; k, v = cursor.Next() {
|
||||
edgeInfoReader := bytes.NewReader(v)
|
||||
|
@ -1705,7 +1705,7 @@ func (c *ChannelGraph) DisconnectBlockAtHeight(height uint32) (
|
|||
// the keys in a second loop.
|
||||
var pruneKeys [][]byte
|
||||
pruneCursor := pruneBucket.ReadWriteCursor()
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
for k, _ := pruneCursor.Seek(pruneKeyStart[:]); k != nil &&
|
||||
bytes.Compare(k, pruneKeyEnd[:]) <= 0; k, _ = pruneCursor.Next() {
|
||||
pruneKeys = append(pruneKeys, k)
|
||||
|
@ -2004,7 +2004,7 @@ func (c *ChannelGraph) ChanUpdatesInHorizon(startTime,
|
|||
// the index collecting the info and policy of each update of
|
||||
// each channel that has a last update within the time range.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
for indexKey, _ := updateCursor.Seek(startTimeBytes[:]); indexKey != nil &&
|
||||
bytes.Compare(indexKey, endTimeBytes[:]) <= 0; indexKey, _ = updateCursor.Next() {
|
||||
|
||||
|
@ -2139,7 +2139,7 @@ func (c *ChannelGraph) NodeUpdatesInHorizon(startTime,
|
|||
// the index collecting info for each node within the time
|
||||
// range.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
for indexKey, _ := updateCursor.Seek(startTimeBytes[:]); indexKey != nil &&
|
||||
bytes.Compare(indexKey, endTimeBytes[:]) <= 0; indexKey, _ = updateCursor.Next() {
|
||||
|
||||
|
@ -2377,7 +2377,7 @@ func (c *ChannelGraph) FilterChannelRange(startHeight,
|
|||
// We'll now iterate through the database, and find each
|
||||
// channel ID that resides within the specified range.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
for k, v := cursor.Seek(chanIDStart[:]); k != nil &&
|
||||
bytes.Compare(k, chanIDEnd[:]) <= 0; k, v = cursor.Next() {
|
||||
// Don't send alias SCIDs during gossip sync.
|
||||
|
@ -3163,7 +3163,7 @@ func nodeTraversal(tx kvdb.RTx, nodePub []byte, db kvdb.Backend,
|
|||
// as its prefix. This indicates that we've stepped over into
|
||||
// another node's edges, so we can terminate our scan.
|
||||
edgeCursor := edges.ReadCursor()
|
||||
for nodeEdge, _ := edgeCursor.Seek(nodeStart[:]); bytes.HasPrefix(nodeEdge, nodePub); nodeEdge, _ = edgeCursor.Next() { //nolint:lll
|
||||
for nodeEdge, _ := edgeCursor.Seek(nodeStart[:]); bytes.HasPrefix(nodeEdge, nodePub); nodeEdge, _ = edgeCursor.Next() { //nolint:ll
|
||||
// If the prefix still matches, the channel id is
|
||||
// returned in nodeEdge. Channel id is used to lookup
|
||||
// the node at the other end of the channel and both
|
||||
|
|
|
@ -1124,7 +1124,7 @@ func TestGraphTraversalCacheable(t *testing.T) {
|
|||
tx, func(tx kvdb.RTx,
|
||||
info *models.ChannelEdgeInfo,
|
||||
policy *models.ChannelEdgePolicy,
|
||||
policy2 *models.ChannelEdgePolicy) error { //nolint:lll
|
||||
policy2 *models.ChannelEdgePolicy) error { //nolint:ll
|
||||
|
||||
delete(chanIndex, info.ChannelID)
|
||||
return nil
|
||||
|
@ -2584,7 +2584,7 @@ func TestFilterChannelRange(t *testing.T) {
|
|||
)
|
||||
require.NoError(t, err)
|
||||
|
||||
expRes := channelRanges[test.expStartIndex:test.expEndIndex] //nolint:lll
|
||||
expRes := channelRanges[test.expStartIndex:test.expEndIndex] //nolint:ll
|
||||
|
||||
if len(expRes) == 0 {
|
||||
require.Nil(t, resp)
|
||||
|
@ -2598,7 +2598,7 @@ func TestFilterChannelRange(t *testing.T) {
|
|||
)
|
||||
require.NoError(t, err)
|
||||
|
||||
expRes = channelRangesWithTimestamps[test.expStartIndex:test.expEndIndex] //nolint:lll
|
||||
expRes = channelRangesWithTimestamps[test.expStartIndex:test.expEndIndex] //nolint:ll
|
||||
|
||||
if len(expRes) == 0 {
|
||||
require.Nil(t, resp)
|
||||
|
@ -3898,7 +3898,7 @@ func BenchmarkForEachChannel(b *testing.B) {
|
|||
cb := func(tx kvdb.RTx,
|
||||
info *models.ChannelEdgeInfo,
|
||||
policy *models.ChannelEdgePolicy,
|
||||
policy2 *models.ChannelEdgePolicy) error { //nolint:lll
|
||||
policy2 *models.ChannelEdgePolicy) error { //nolint:ll
|
||||
|
||||
// We need to do something with
|
||||
// the data here, otherwise the
|
||||
|
|
|
@ -377,7 +377,7 @@ func peelBlindedPathDummyHop(r *sphinxHopIterator, cltvExpiryDelta uint32,
|
|||
r.router, onionPkt, sphinxPacket, BlindingKit{
|
||||
Processor: r.router,
|
||||
UpdateAddBlinding: tlv.SomeRecordT(
|
||||
tlv.NewPrimitiveRecord[lnwire.BlindingPointTlvType]( //nolint:lll
|
||||
tlv.NewPrimitiveRecord[lnwire.BlindingPointTlvType]( //nolint:ll
|
||||
nextEph.Val,
|
||||
),
|
||||
),
|
||||
|
@ -606,7 +606,7 @@ func (b *BlindingKit) getBlindingPoint(payloadBlinding *btcec.PublicKey) (
|
|||
//
|
||||
// ceil(a/b) = (a + b - 1)/(b).
|
||||
//
|
||||
//nolint:lll,dupword
|
||||
//nolint:ll,dupword
|
||||
func calculateForwardingAmount(incomingAmount, baseFee lnwire.MilliSatoshi,
|
||||
proportionalFee uint32) (lnwire.MilliSatoshi, error) {
|
||||
|
||||
|
|
|
@ -281,7 +281,7 @@ func TestParseAndValidateRecipientData(t *testing.T) {
|
|||
|
||||
if testCase.updateAddBlinding != nil {
|
||||
kit.UpdateAddBlinding = tlv.SomeRecordT(
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
tlv.NewPrimitiveRecord[lnwire.BlindingPointTlvType](testCase.updateAddBlinding),
|
||||
)
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ import (
|
|||
)
|
||||
|
||||
var (
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
testPrivKeyBytes, _ = hex.DecodeString("e126f68f7eafcc8b74f54d269fe206be715000f94dac067d1c04a8ca3b2db734")
|
||||
_, testPubKey = btcec.PrivKeyFromBytes(testPrivKeyBytes)
|
||||
)
|
||||
|
|
|
@ -942,7 +942,7 @@ func (l *channelLink) syncChanStates() error {
|
|||
// very same nonce that we sent above, as they should
|
||||
// take the latest verification nonce we send.
|
||||
if chanState.ChanType.IsTaproot() {
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
channelReadyMsg.NextLocalNonce = localChanSyncMsg.LocalNonce
|
||||
}
|
||||
|
||||
|
@ -3724,7 +3724,7 @@ func (l *channelLink) processRemoteAdds(fwdPkg *channeldb.FwdPkg) {
|
|||
// parse the payload we have no way of knowing whether
|
||||
// we were the introduction node or not.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
obfuscator, failCode := chanIterator.ExtractErrorEncrypter(
|
||||
l.cfg.ExtractErrorEncrypter,
|
||||
// We need our route role here because we
|
||||
|
@ -3885,7 +3885,7 @@ func (l *channelLink) processRemoteAdds(fwdPkg *channeldb.FwdPkg) {
|
|||
|
||||
inboundFee := l.cfg.FwrdingPolicy.InboundFee
|
||||
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
updatePacket := &htlcPacket{
|
||||
incomingChanID: l.ShortChanID(),
|
||||
incomingHTLCID: add.ID,
|
||||
|
@ -3936,7 +3936,7 @@ func (l *channelLink) processRemoteAdds(fwdPkg *channeldb.FwdPkg) {
|
|||
l.log.Errorf("unable to encode the "+
|
||||
"remaining route %v", err)
|
||||
|
||||
cb := func(upd *lnwire.ChannelUpdate1) lnwire.FailureMessage { //nolint:lll
|
||||
cb := func(upd *lnwire.ChannelUpdate1) lnwire.FailureMessage { //nolint:ll
|
||||
return lnwire.NewTemporaryChannelFailure(upd)
|
||||
}
|
||||
|
||||
|
@ -3962,7 +3962,7 @@ func (l *channelLink) processRemoteAdds(fwdPkg *channeldb.FwdPkg) {
|
|||
if fwdPkg.State == channeldb.FwdStateLockedIn {
|
||||
inboundFee := l.cfg.FwrdingPolicy.InboundFee
|
||||
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
updatePacket := &htlcPacket{
|
||||
incomingChanID: l.ShortChanID(),
|
||||
incomingHTLCID: add.ID,
|
||||
|
|
|
@ -4889,7 +4889,7 @@ func (h *persistentLinkHarness) restartLink(
|
|||
// the firing via force feeding.
|
||||
bticker := ticker.NewForce(time.Hour)
|
||||
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
aliceCfg := ChannelLinkConfig{
|
||||
FwrdingPolicy: globalPolicy,
|
||||
Peer: alicePeer,
|
||||
|
|
|
@ -1137,7 +1137,7 @@ func (h *hopNetwork) createChannelLink(server, peer *mockServer,
|
|||
return server.htlcSwitch.ForwardPackets(linkQuit, packets...)
|
||||
}
|
||||
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
link := NewChannelLink(
|
||||
ChannelLinkConfig{
|
||||
BestHeight: server.htlcSwitch.BestHeight,
|
||||
|
|
|
@ -699,14 +699,14 @@ const (
|
|||
// - number_of_witness_elements: 1 byte
|
||||
// - sig_len: 1 byte
|
||||
// - sweep_sig: 65 bytes (worst case w/o sighash default)
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
TaprootSecondLevelRevokeWitnessSize = TaprootKeyPathCustomSighashWitnessSize
|
||||
|
||||
// TaprootAcceptedRevokeWitnessSize:
|
||||
// - number_of_witness_elements: 1 byte
|
||||
// - sig_len: 1 byte
|
||||
// - sweep_sig: 65 bytes (worst case w/o sighash default)
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
TaprootAcceptedRevokeWitnessSize = TaprootKeyPathCustomSighashWitnessSize
|
||||
|
||||
// TaprootOfferedRevokeWitnessSize:
|
||||
|
|
|
@ -861,11 +861,11 @@ var witnessSizeTests = []witnessSizeTest{
|
|||
KeyDesc: keychain.KeyDescriptor{
|
||||
PubKey: testKey.PubKey(),
|
||||
},
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
WitnessScript: commitScriptTree.SettleLeaf.Script,
|
||||
HashType: txscript.SigHashAll,
|
||||
InputIndex: 0,
|
||||
SignMethod: input.TaprootScriptSpendSignMethod, //nolint:lll
|
||||
SignMethod: input.TaprootScriptSpendSignMethod, //nolint:ll
|
||||
}
|
||||
|
||||
witness, err := input.TaprootCommitSpendSuccess(
|
||||
|
@ -895,11 +895,11 @@ var witnessSizeTests = []witnessSizeTest{
|
|||
KeyDesc: keychain.KeyDescriptor{
|
||||
PubKey: testKey.PubKey(),
|
||||
},
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
WitnessScript: commitScriptTree.RevocationLeaf.Script,
|
||||
HashType: txscript.SigHashAll,
|
||||
InputIndex: 0,
|
||||
SignMethod: input.TaprootScriptSpendSignMethod, //nolint:lll
|
||||
SignMethod: input.TaprootScriptSpendSignMethod, //nolint:ll
|
||||
}
|
||||
|
||||
witness, err := input.TaprootCommitSpendRevoke(
|
||||
|
@ -919,7 +919,7 @@ var witnessSizeTests = []witnessSizeTest{
|
|||
require.NoError(t, err)
|
||||
|
||||
signer := &dummySigner{}
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
commitScriptTree, err := input.NewRemoteCommitScriptTree(
|
||||
testKey.PubKey(), input.NoneTapLeaf(),
|
||||
)
|
||||
|
@ -929,11 +929,11 @@ var witnessSizeTests = []witnessSizeTest{
|
|||
KeyDesc: keychain.KeyDescriptor{
|
||||
PubKey: testKey.PubKey(),
|
||||
},
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
WitnessScript: commitScriptTree.SettleLeaf.Script,
|
||||
HashType: txscript.SigHashAll,
|
||||
InputIndex: 0,
|
||||
SignMethod: input.TaprootScriptSpendSignMethod, //nolint:lll
|
||||
SignMethod: input.TaprootScriptSpendSignMethod, //nolint:ll
|
||||
}
|
||||
|
||||
witness, err := input.TaprootCommitRemoteSpend(
|
||||
|
@ -1174,7 +1174,7 @@ var witnessSizeTests = []witnessSizeTest{
|
|||
WitnessScript: timeoutLeaf.Script,
|
||||
HashType: txscript.SigHashAll,
|
||||
InputIndex: 0,
|
||||
SignMethod: input.TaprootScriptSpendSignMethod, //nolint:lll
|
||||
SignMethod: input.TaprootScriptSpendSignMethod, //nolint:ll
|
||||
}
|
||||
|
||||
witness, err := input.ReceiverHTLCScriptTaprootTimeout(
|
||||
|
@ -1222,7 +1222,7 @@ var witnessSizeTests = []witnessSizeTest{
|
|||
WitnessScript: timeoutLeaf.Script,
|
||||
HashType: txscript.SigHashAll,
|
||||
InputIndex: 0,
|
||||
SignMethod: input.TaprootScriptSpendSignMethod, //nolint:lll
|
||||
SignMethod: input.TaprootScriptSpendSignMethod, //nolint:ll
|
||||
}
|
||||
receiverSig, err := signer.SignOutputRaw(
|
||||
testTx, receiverDesc,
|
||||
|
@ -1236,7 +1236,7 @@ var witnessSizeTests = []witnessSizeTest{
|
|||
WitnessScript: timeoutLeaf.Script,
|
||||
HashType: txscript.SigHashAll,
|
||||
InputIndex: 0,
|
||||
SignMethod: input.TaprootScriptSpendSignMethod, //nolint:lll
|
||||
SignMethod: input.TaprootScriptSpendSignMethod, //nolint:ll
|
||||
}
|
||||
|
||||
witness, err := input.SenderHTLCScriptTaprootTimeout(
|
||||
|
@ -1283,7 +1283,7 @@ var witnessSizeTests = []witnessSizeTest{
|
|||
WitnessScript: successLeaf.Script,
|
||||
HashType: txscript.SigHashAll,
|
||||
InputIndex: 0,
|
||||
SignMethod: input.TaprootScriptSpendSignMethod, //nolint:lll
|
||||
SignMethod: input.TaprootScriptSpendSignMethod, //nolint:ll
|
||||
}
|
||||
|
||||
witness, err := input.SenderHTLCScriptTaprootRedeem(
|
||||
|
@ -1329,7 +1329,7 @@ var witnessSizeTests = []witnessSizeTest{
|
|||
WitnessScript: successsLeaf.Script,
|
||||
HashType: txscript.SigHashAll,
|
||||
InputIndex: 0,
|
||||
SignMethod: input.TaprootScriptSpendSignMethod, //nolint:lll
|
||||
SignMethod: input.TaprootScriptSpendSignMethod, //nolint:ll
|
||||
}
|
||||
senderSig, err := signer.SignOutputRaw(
|
||||
testTx, senderDesc,
|
||||
|
@ -1343,7 +1343,7 @@ var witnessSizeTests = []witnessSizeTest{
|
|||
WitnessScript: successsLeaf.Script,
|
||||
HashType: txscript.SigHashAll,
|
||||
InputIndex: 0,
|
||||
SignMethod: input.TaprootScriptSpendSignMethod, //nolint:lll
|
||||
SignMethod: input.TaprootScriptSpendSignMethod, //nolint:ll
|
||||
}
|
||||
|
||||
witness, err := input.ReceiverHTLCScriptTaprootRedeem(
|
||||
|
|
|
@ -1841,7 +1841,7 @@ func (i *InvoiceRegistry) HodlUnsubscribeAll(subscriber chan<- interface{}) {
|
|||
|
||||
// copySingleClients copies i.SingleInvoiceSubscription inside a lock. This is
|
||||
// useful when we need to iterate the map to send notifications.
|
||||
func (i *InvoiceRegistry) copySingleClients() map[uint32]*SingleInvoiceSubscription { //nolint:lll
|
||||
func (i *InvoiceRegistry) copySingleClients() map[uint32]*SingleInvoiceSubscription { //nolint:ll
|
||||
i.notificationClientMux.RLock()
|
||||
defer i.notificationClientMux.RUnlock()
|
||||
|
||||
|
|
|
@ -1054,7 +1054,7 @@ func (s *sqlInvoiceUpdater) AddHtlc(circuitKey models.CircuitKey,
|
|||
)
|
||||
if err != nil {
|
||||
mappedSQLErr := sqldb.MapSQLError(err)
|
||||
var uniqueConstraintErr *sqldb.ErrSQLUniqueConstraintViolation //nolint:lll
|
||||
var uniqueConstraintErr *sqldb.ErrSQLUniqueConstraintViolation //nolint:ll
|
||||
if errors.As(mappedSQLErr, &uniqueConstraintErr) {
|
||||
return ErrDuplicateSetID{
|
||||
SetID: setID,
|
||||
|
|
|
@ -382,7 +382,7 @@ func testChannelBackupRestoreBasic(ht *lntest.HarnessTest) {
|
|||
// create a new nodeRestorer that will restore
|
||||
// using the on-disk channel.backup.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
backup := &lnrpc.RestoreChanBackupRequest_MultiChanBackup{
|
||||
MultiChanBackup: multi,
|
||||
}
|
||||
|
|
|
@ -609,7 +609,7 @@ func channelForceClosureTest(ht *lntest.HarnessTest,
|
|||
|
||||
// We expect alice to have a timeout tx resolution with
|
||||
// an amount equal to the payment amount.
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
aliceReports[outpoint.String()] = &lnrpc.Resolution{
|
||||
ResolutionType: lnrpc.ResolutionType_OUTGOING_HTLC,
|
||||
Outcome: lnrpc.ResolutionOutcome_FIRST_STAGE,
|
||||
|
@ -622,7 +622,7 @@ func channelForceClosureTest(ht *lntest.HarnessTest,
|
|||
// incoming htlc timeout which reflects the full amount
|
||||
// of the htlc. It has no spend tx, because carol stops
|
||||
// monitoring the htlc once it has timed out.
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
carolReports[outpoint.String()] = &lnrpc.Resolution{
|
||||
ResolutionType: lnrpc.ResolutionType_INCOMING_HTLC,
|
||||
Outcome: lnrpc.ResolutionOutcome_TIMEOUT,
|
||||
|
|
|
@ -19,7 +19,7 @@ var (
|
|||
probeAmt = int64(probeAmount) * 1_000
|
||||
|
||||
failureReasonNone = lnrpc.PaymentFailureReason_FAILURE_REASON_NONE
|
||||
failureReasonNoRoute = lnrpc.PaymentFailureReason_FAILURE_REASON_NO_ROUTE //nolint:lll
|
||||
failureReasonNoRoute = lnrpc.PaymentFailureReason_FAILURE_REASON_NO_ROUTE //nolint:ll
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
@ -144,7 +144,7 @@ func testBasicChannelFunding(ht *lntest.HarnessTest) {
|
|||
chansCommitType == lnrpc.CommitmentType_ANCHORS:
|
||||
|
||||
case expType == lnrpc.CommitmentType_STATIC_REMOTE_KEY &&
|
||||
chansCommitType == lnrpc.CommitmentType_STATIC_REMOTE_KEY: //nolint:lll
|
||||
chansCommitType == lnrpc.CommitmentType_STATIC_REMOTE_KEY: //nolint:ll
|
||||
|
||||
case expType == lnrpc.CommitmentType_LEGACY &&
|
||||
chansCommitType == lnrpc.CommitmentType_LEGACY:
|
||||
|
|
|
@ -21,7 +21,7 @@ func testHoldInvoicePersistence(ht *lntest.HarnessTest) {
|
|||
const (
|
||||
chanAmt = btcutil.Amount(1000000)
|
||||
numPayments = 10
|
||||
reason = lnrpc.PaymentFailureReason_FAILURE_REASON_INCORRECT_PAYMENT_DETAILS //nolint:lll
|
||||
reason = lnrpc.PaymentFailureReason_FAILURE_REASON_INCORRECT_PAYMENT_DETAILS //nolint:ll
|
||||
)
|
||||
|
||||
// Create carol, and clean up when the test finishes.
|
||||
|
|
|
@ -114,7 +114,7 @@ func (h *holdSubscription) cancel(ht *lntest.HarnessTest) {
|
|||
)
|
||||
require.Equal(ht, lnrpc.Payment_FAILED, payUpdate.Status,
|
||||
"expected payment failed")
|
||||
require.Equal(ht, lnrpc.PaymentFailureReason_FAILURE_REASON_INCORRECT_PAYMENT_DETAILS, //nolint:lll
|
||||
require.Equal(ht, lnrpc.PaymentFailureReason_FAILURE_REASON_INCORRECT_PAYMENT_DETAILS, //nolint:ll
|
||||
payUpdate.FailureReason, "expected unknown details")
|
||||
}
|
||||
|
||||
|
|
|
@ -138,7 +138,7 @@ func testHtlcErrorPropagation(ht *lntest.HarnessTest) {
|
|||
}
|
||||
ht.SendPaymentAssertFail(
|
||||
alice, sendReq,
|
||||
lnrpc.PaymentFailureReason_FAILURE_REASON_INCORRECT_PAYMENT_DETAILS, //nolint:lll
|
||||
lnrpc.PaymentFailureReason_FAILURE_REASON_INCORRECT_PAYMENT_DETAILS, //nolint:ll
|
||||
)
|
||||
ht.AssertLastHTLCError(
|
||||
alice, lnrpc.Failure_INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS,
|
||||
|
@ -207,7 +207,7 @@ func testHtlcErrorPropagation(ht *lntest.HarnessTest) {
|
|||
}
|
||||
ht.SendPaymentAssertFail(
|
||||
alice, sendReq,
|
||||
lnrpc.PaymentFailureReason_FAILURE_REASON_INCORRECT_PAYMENT_DETAILS, //nolint:lll
|
||||
lnrpc.PaymentFailureReason_FAILURE_REASON_INCORRECT_PAYMENT_DETAILS, //nolint:ll
|
||||
)
|
||||
ht.AssertLastHTLCError(
|
||||
alice, lnrpc.Failure_INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS,
|
||||
|
|
|
@ -1137,7 +1137,7 @@ func testSweepHTLCs(ht *lntest.HarnessTest) {
|
|||
return incoming, outgoing
|
||||
}
|
||||
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
// For neutrino backend, we need to give it more time to sync the
|
||||
// blocks. There's a potential bug we need to fix:
|
||||
// 2024-04-18 23:36:07.046 [ERR] NTFN: unable to get missed blocks: starting height 487 is greater than ending height 486
|
||||
|
|
|
@ -4,7 +4,7 @@ import "fmt"
|
|||
|
||||
// Config holds etcd configuration alongside with configuration related to our higher level interface.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
type Config struct {
|
||||
Embedded bool `long:"embedded" description:"Use embedded etcd instance instead of the external one. Note: use for testing only."`
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ import "time"
|
|||
|
||||
// Config holds postgres configuration data.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
type Config struct {
|
||||
Dsn string `long:"dsn" description:"Database connection string."`
|
||||
Timeout time.Duration `long:"timeout" description:"Database connection timeout. Set to zero to disable."`
|
||||
|
|
|
@ -4,7 +4,7 @@ import "time"
|
|||
|
||||
// Config holds sqlite configuration data.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
type Config struct {
|
||||
Timeout time.Duration `long:"timeout" description:"The time after which a database query should be timed out."`
|
||||
BusyTimeout time.Duration `long:"busytimeout" description:"The maximum amount of time to wait for a database connection to become available for a query."`
|
||||
|
|
|
@ -2,7 +2,7 @@ package lncfg
|
|||
|
||||
// AutoPilot holds the configuration options for the daemon's autopilot.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
type AutoPilot struct {
|
||||
Active bool `long:"active" description:"If the autopilot agent should be active or not."`
|
||||
Heuristic map[string]float64 `long:"heuristic" description:"Heuristic to activate, and the weight to give it during scoring."`
|
||||
|
|
|
@ -11,7 +11,7 @@ const (
|
|||
// Bitcoind holds the configuration options for the daemon's connection to
|
||||
// bitcoind.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
type Bitcoind struct {
|
||||
Dir string `long:"dir" description:"The base directory that contains the node's data, logs, configuration file, etc."`
|
||||
ConfigPath string `long:"config" description:"Configuration filepath. If not set, will default to the default filename under 'dir'."`
|
||||
|
|
|
@ -2,7 +2,7 @@ package lncfg
|
|||
|
||||
// Btcd holds the configuration options for the daemon's connection to btcd.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
type Btcd struct {
|
||||
Dir string `long:"dir" description:"The base directory that contains the node's data, logs, configuration file, etc."`
|
||||
RPCHost string `long:"rpchost" description:"The daemon's rpc listening address. If a port is omitted, then the default port for the selected chain parameters will be used."`
|
||||
|
|
|
@ -21,7 +21,7 @@ const (
|
|||
|
||||
// Caches holds the configuration for various caches within lnd.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
type Caches struct {
|
||||
// RejectCacheSize is the maximum number of entries stored in lnd's
|
||||
// reject cache, which is used for efficiently rejecting gossip updates.
|
||||
|
|
|
@ -8,7 +8,7 @@ import (
|
|||
|
||||
// Chain holds the configuration options for the daemon's chain settings.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
type Chain struct {
|
||||
Active bool `long:"active" description:"DEPRECATED: If the chain should be active or not. This field is now ignored since only the Bitcoin chain is supported" hidden:"true"`
|
||||
ChainDir string `long:"chaindir" description:"The directory to store the chain's data within."`
|
||||
|
|
|
@ -71,7 +71,7 @@ const (
|
|||
|
||||
// DB holds database configuration for LND.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
type DB struct {
|
||||
Backend string `long:"backend" description:"The selected database backend."`
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ func IsDevBuild() bool {
|
|||
// DevConfig specifies configs used for integration tests. These configs can
|
||||
// only be used in tests and must NOT be exported for production usage.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
type DevConfig struct {
|
||||
ProcessChannelReadyWait time.Duration `long:"processchannelreadywait" description:"Time to sleep before processing remote node's channel_ready message."`
|
||||
ReservationTimeout time.Duration `long:"reservationtimeout" description:"The maximum time we keep a pending channel open flow in memory."`
|
||||
|
|
|
@ -12,7 +12,7 @@ const DefaultMaxUpdateTimeout = 20 * time.Minute
|
|||
|
||||
// Fee holds the configuration options for fee estimation.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
type Fee struct {
|
||||
URL string `long:"url" description:"Optional URL for external fee estimation. If no URL is specified, the method for fee estimation will depend on the chosen backend and network. Must be set for neutrino on mainnet."`
|
||||
MinUpdateTimeout time.Duration `long:"min-update-timeout" description:"The minimum interval in which fees will be updated from the specified fee URL."`
|
||||
|
|
|
@ -7,7 +7,7 @@ import (
|
|||
"github.com/lightningnetwork/lnd/routing/route"
|
||||
)
|
||||
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
type Gossip struct {
|
||||
PinnedSyncersRaw []string `long:"pinned-syncers" description:"A set of peers that should always remain in an active sync state, which can be used to closely synchronize the routing tables of two nodes. The value should be a hex-encoded pubkey, the flag can be specified multiple times to add multiple peers. Connected peers matching this pubkey will remain active for the duration of the connection and not count towards the NumActiveSyncer count."`
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ var (
|
|||
// HealthCheckConfig contains the configuration for the different health checks
|
||||
// the lnd runs.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
type HealthCheckConfig struct {
|
||||
ChainCheck *CheckConfig `group:"chainbackend" namespace:"chainbackend"`
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ var (
|
|||
MaxMailboxDeliveryTimeout = 2 * time.Minute
|
||||
)
|
||||
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
type Htlcswitch struct {
|
||||
MailboxDeliveryTimeout time.Duration `long:"mailboxdeliverytimeout" description:"The timeout value when delivering HTLCs to a channel link. Setting this value too small will result in local payment failures if large number of payments are sent over a short period."`
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ const (
|
|||
|
||||
// Invoices holds the configuration options for invoices.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
type Invoices struct {
|
||||
HoldExpiryDelta uint32 `long:"holdexpirydelta" description:"The number of blocks before a hold invoice's htlc expires that the invoice should be canceled to prevent a force close. Force closes will not be prevented if this value is not greater than DefaultIncomingBroadcastDelta."`
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ package lncfg
|
|||
// Prometheus is the set of configuration data that specifies the listening
|
||||
// address of the Prometheus exporter.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
type Prometheus struct {
|
||||
// Listen is the listening address that we should use to allow the main
|
||||
// Prometheus server to scrape our metrics.
|
||||
|
|
|
@ -5,7 +5,7 @@ import "time"
|
|||
// Neutrino holds the configuration options for the daemon's connection to
|
||||
// neutrino.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
type Neutrino struct {
|
||||
AddPeers []string `short:"a" long:"addpeer" description:"Add a peer to connect with at startup"`
|
||||
ConnectPeers []string `long:"connect" description:"Connect only to the specified peers at startup"`
|
||||
|
|
|
@ -7,7 +7,7 @@ import (
|
|||
|
||||
// Pprof holds the configuration options for LND's built-in pprof server.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
type Pprof struct {
|
||||
CPUProfile string `long:"cpuprofile" description:"Write CPU profile to the specified file"`
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ import (
|
|||
// compatibility of protocol additions, while defaulting to the latest within
|
||||
// lnd, or to enable experimental protocol changes.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
type ProtocolOptions struct {
|
||||
// LegacyProtocol is a sub-config that houses all the legacy protocol
|
||||
// options. These are mostly used for integration tests as most modern
|
||||
|
|
|
@ -13,7 +13,7 @@ import (
|
|||
//
|
||||
// TODO(yy): delete this build flag to unify with `lncfg/protocol.go`.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
type ProtocolOptions struct {
|
||||
// LegacyProtocol is a sub-config that houses all the legacy protocol
|
||||
// options. These are mostly used for integration tests as most modern
|
||||
|
|
|
@ -7,7 +7,7 @@ package lncfg
|
|||
// are mostly used for integration tests as most modern nodes should always run
|
||||
// with them on by default.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
type LegacyProtocol struct {
|
||||
// LegacyOnionFormat if set to true, then we won't signal
|
||||
// TLVOnionPayloadOptional. As a result, nodes that include us in the
|
||||
|
|
|
@ -13,7 +13,7 @@ const (
|
|||
|
||||
// RemoteSigner holds the configuration options for a remote RPC signer.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
type RemoteSigner struct {
|
||||
Enable bool `long:"enable" description:"Use a remote signer for signing any on-chain related transactions or messages. Only recommended if local wallet is initialized as watch-only. Remote signer must use the same seed/root key as the local watch-only wallet but must have private keys."`
|
||||
RPCHost string `long:"rpchost" description:"The remote signer's RPC host:port"`
|
||||
|
|
|
@ -4,7 +4,7 @@ import "fmt"
|
|||
|
||||
// Routing holds the configuration options for routing.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
type Routing struct {
|
||||
AssumeChannelValid bool `long:"assumechanvalid" description:"DEPRECATED: Skip checking channel spentness during graph validation. This speedup comes at the risk of using an unvalidated view of the network for routing. (default: false)" hidden:"true"`
|
||||
|
||||
|
@ -15,7 +15,7 @@ type Routing struct {
|
|||
|
||||
// BlindedPaths holds the configuration options for blinded path construction.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
type BlindedPaths struct {
|
||||
MinNumRealHops uint8 `long:"min-num-real-hops" description:"The minimum number of real hops to include in a blinded path. This doesn't include our node, so if the minimum is 1, then the path will contain at minimum our node along with an introduction node hop. If it is zero then the shortest path will use our node as an introduction node."`
|
||||
NumHops uint8 `long:"num-hops" description:"The number of hops to include in a blinded path. This doesn't include our node, so if it is 1, then the path will contain our node along with an introduction node or dummy node hop. If paths shorter than NumHops is found, then they will be padded using dummy hops."`
|
||||
|
|
|
@ -16,7 +16,7 @@ const (
|
|||
|
||||
// RPCMiddleware holds the configuration for RPC interception middleware.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
type RPCMiddleware struct {
|
||||
Enable bool `long:"enable" description:"Enable the RPC middleware interceptor functionality."`
|
||||
InterceptTimeout time.Duration `long:"intercepttimeout" description:"Time after which a RPC middleware intercept request will time out and return an error if it hasn't yet received a response."`
|
||||
|
|
|
@ -19,7 +19,7 @@ const (
|
|||
MaxAllowedFeeRate = 10_000
|
||||
)
|
||||
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
type Sweeper struct {
|
||||
BatchWindowDuration time.Duration `long:"batchwindowduration" description:"Duration of the sweep batch window. The sweep is held back during the batch window to allow more inputs to be added and thereby lower the fee per input." hidden:"true"`
|
||||
MaxFeeRate chainfee.SatPerVByte `long:"maxfeerate" description:"Maximum fee rate in sat/vb that the sweeper is allowed to use when sweeping funds, the fee rate derived from budgets are capped at this value. Setting this value too low can result in transactions not being confirmed in time, causing HTLCs to expire hence potentially losing funds."`
|
||||
|
|
|
@ -2,7 +2,7 @@ package lncfg
|
|||
|
||||
// Tor holds the configuration options for the daemon's connection to tor.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
type Tor struct {
|
||||
Active bool `long:"active" description:"Allow outbound and inbound connections to be routed through Tor"`
|
||||
SOCKS string `long:"socks" description:"The host:port that Tor's exposed SOCKS5 proxy is listening on"`
|
||||
|
|
|
@ -5,7 +5,7 @@ import "github.com/lightningnetwork/lnd/watchtower"
|
|||
// Watchtower holds the daemon specific configuration parameters for running a
|
||||
// watchtower that shares resources with the daemon.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
type Watchtower struct {
|
||||
Active bool `long:"active" description:"If the watchtower should be active or not"`
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ const (
|
|||
// Workers exposes CLI configuration for turning resources consumed by worker
|
||||
// pools.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
type Workers struct {
|
||||
// Read is the maximum number of concurrent read pool workers.
|
||||
Read int `long:"read" description:"Maximum number of concurrent read pool workers. This number should be proportional to the number of peers."`
|
||||
|
|
|
@ -9,7 +9,7 @@ import (
|
|||
|
||||
// WtClient holds the configuration options for the daemon's watchtower client.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
type WtClient struct {
|
||||
// Active determines whether a watchtower client should be created to
|
||||
// back up channel states with registered watchtowers.
|
||||
|
|
|
@ -298,7 +298,7 @@ func (s *Server) ImportGraph(ctx context.Context,
|
|||
rpcEdge.ChanPoint, err)
|
||||
}
|
||||
|
||||
makePolicy := func(rpcPolicy *lnrpc.RoutingPolicy) *models.ChannelEdgePolicy { //nolint:lll
|
||||
makePolicy := func(rpcPolicy *lnrpc.RoutingPolicy) *models.ChannelEdgePolicy { //nolint:ll
|
||||
policy := &models.ChannelEdgePolicy{
|
||||
ChannelID: rpcEdge.ChannelId,
|
||||
LastUpdate: time.Unix(
|
||||
|
|
|
@ -519,7 +519,7 @@ func AddInvoice(ctx context.Context, cfg *AddInvoiceConfig,
|
|||
finalCLTVDelta := uint32(cltvExpiryDelta)
|
||||
finalCLTVDelta += uint32(routing.BlockPadding)
|
||||
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
paths, err := blindedpath.BuildBlindedPaymentPaths(
|
||||
&blindedpath.BuildBlindedPathCfg{
|
||||
FindRoutes: cfg.QueryBlindedRoutes,
|
||||
|
@ -534,7 +534,7 @@ func AddInvoice(ctx context.Context, cfg *AddInvoiceConfig,
|
|||
p *blindedpath.BlindedHopPolicy) (
|
||||
*blindedpath.BlindedHopPolicy, error) {
|
||||
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
return blindedpath.AddPolicyBuffer(
|
||||
p, blindCfg.RoutePolicyIncrMultiplier,
|
||||
blindCfg.RoutePolicyDecrMultiplier,
|
||||
|
|
|
@ -12,7 +12,7 @@ import (
|
|||
// options, while if able to be populated, the latter fields MUST also be
|
||||
// specified.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
type Config struct {
|
||||
RoutingConfig
|
||||
|
||||
|
|
|
@ -154,7 +154,7 @@ func (r *forwardInterceptor) resolveFromClient(
|
|||
outWireCustomRecords = fn.Some[lnwire.CustomRecords](cr)
|
||||
}
|
||||
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
return r.htlcSwitch.Resolve(&htlcswitch.FwdResolution{
|
||||
Key: circuitKey,
|
||||
Action: htlcswitch.FwdActionResumeModified,
|
||||
|
|
|
@ -600,7 +600,7 @@ func (s *Server) probePaymentRequest(ctx context.Context, paymentRequest string,
|
|||
|
||||
// If the payment probe failed we only return the failure reason and
|
||||
// leave the probe result params unaltered.
|
||||
if resp.FailureReason != lnrpc.PaymentFailureReason_FAILURE_REASON_NONE { //nolint:lll
|
||||
if resp.FailureReason != lnrpc.PaymentFailureReason_FAILURE_REASON_NONE { //nolint:ll
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
|
@ -786,7 +786,7 @@ func (s *Server) sendProbePayment(ctx context.Context,
|
|||
case lnrpc.Payment_FAILED:
|
||||
// Incorrect payment details point to a
|
||||
// successful probe.
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
if payment.FailureReason == lnrpc.PaymentFailureReason_FAILURE_REASON_INCORRECT_PAYMENT_DETAILS {
|
||||
return paymentDetails(payment)
|
||||
}
|
||||
|
@ -1031,7 +1031,7 @@ func (s *Server) SetMissionControlConfig(ctx context.Context,
|
|||
req.Config.HopProbability,
|
||||
),
|
||||
AprioriWeight: float64(req.Config.Weight),
|
||||
CapacityFraction: routing.DefaultCapacityFraction, //nolint:lll
|
||||
CapacityFraction: routing.DefaultCapacityFraction, //nolint:ll
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -276,7 +276,7 @@ func TestIsLsp(t *testing.T) {
|
|||
bobExpensiveCopy.FeeProportionalMillionths = 1_000_000
|
||||
bobExpensiveCopy.CLTVExpiryDelta = bobHopHint.CLTVExpiryDelta - 1
|
||||
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
lspTestCases := []struct {
|
||||
name string
|
||||
routeHints [][]zpay32.HopHint
|
||||
|
|
|
@ -8,7 +8,7 @@ import (
|
|||
|
||||
// RoutingConfig contains the configurable parameters that control routing.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
type RoutingConfig struct {
|
||||
// ProbabilityEstimatorType sets the estimator to use.
|
||||
ProbabilityEstimatorType string `long:"estimator" choice:"apriori" choice:"bimodal" description:"Probability estimator used for pathfinding." `
|
||||
|
@ -48,7 +48,7 @@ type RoutingConfig struct {
|
|||
|
||||
// AprioriConfig defines parameters for the apriori probability.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
type AprioriConfig struct {
|
||||
// HopProbability is the assumed success probability of a hop in a route
|
||||
// when no other information is available.
|
||||
|
@ -73,7 +73,7 @@ type AprioriConfig struct {
|
|||
|
||||
// BimodalConfig defines parameters for the bimodal probability.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
type BimodalConfig struct {
|
||||
// Scale describes the scale over which channels still have some
|
||||
// liquidity left on both channel ends. A value of 0 means that we
|
||||
|
|
|
@ -199,7 +199,7 @@ var (
|
|||
// and the native enum cannot be renumbered because it is stored in the
|
||||
// watchtower and BreachArbitrator databases.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
allWitnessTypes = map[input.WitnessType]WitnessType{
|
||||
input.CommitmentTimeLock: WitnessType_COMMITMENT_TIME_LOCK,
|
||||
input.CommitmentNoDelay: WitnessType_COMMITMENT_NO_DELAY,
|
||||
|
|
|
@ -705,7 +705,7 @@ func (h *HarnessRPC) GetChanInfo(
|
|||
// LookupHtlcResolution makes a RPC call to the node's LookupHtlcResolution and
|
||||
// returns the response.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
func (h *HarnessRPC) LookupHtlcResolution(
|
||||
req *lnrpc.LookupHtlcResolutionRequest) *lnrpc.LookupHtlcResolutionResponse {
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ import (
|
|||
// UpdateChanStatus makes a UpdateChanStatus RPC call to node's RouterClient
|
||||
// and asserts.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
func (h *HarnessRPC) UpdateChanStatus(
|
||||
req *routerrpc.UpdateChanStatusRequest) *routerrpc.UpdateChanStatusResponse {
|
||||
|
||||
|
@ -76,7 +76,7 @@ func (h *HarnessRPC) SubscribeHtlcEvents() HtlcEventsClient {
|
|||
// GetMissionControlConfig makes a RPC call to the node's
|
||||
// GetMissionControlConfig and asserts.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
func (h *HarnessRPC) GetMissionControlConfig() *routerrpc.GetMissionControlConfigResponse {
|
||||
ctxt, cancel := context.WithTimeout(h.runCtx, DefaultTimeout)
|
||||
defer cancel()
|
||||
|
@ -142,7 +142,7 @@ func (h *HarnessRPC) SendToRouteV2(
|
|||
// QueryProbability makes a RPC call to the node's QueryProbability and
|
||||
// asserts.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
func (h *HarnessRPC) QueryProbability(
|
||||
req *routerrpc.QueryProbabilityRequest) *routerrpc.QueryProbabilityResponse {
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ func (h *HarnessRPC) MuSig2CreateSessionErr(
|
|||
|
||||
// MuSig2CombineKeys makes a RPC call to the node's SignerClient and asserts.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
func (h *HarnessRPC) MuSig2CombineKeys(
|
||||
req *signrpc.MuSig2CombineKeysRequest) *signrpc.MuSig2CombineKeysResponse {
|
||||
|
||||
|
@ -117,7 +117,7 @@ func (h *HarnessRPC) MuSig2CombineKeysErr(
|
|||
|
||||
// MuSig2RegisterNonces makes a RPC call to the node's SignerClient and asserts.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
func (h *HarnessRPC) MuSig2RegisterNonces(
|
||||
req *signrpc.MuSig2RegisterNoncesRequest) *signrpc.MuSig2RegisterNoncesResponse {
|
||||
|
||||
|
|
|
@ -228,7 +228,7 @@ func (h *HarnessRPC) GetTransaction(
|
|||
// RemoveTransaction makes an RPC call to the node's WalletKitClient and
|
||||
// asserts.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
func (h *HarnessRPC) RemoveTransaction(
|
||||
req *walletrpc.GetTransactionRequest) *walletrpc.RemoveTransactionResponse {
|
||||
|
||||
|
@ -256,7 +256,7 @@ func (h *HarnessRPC) BumpFee(
|
|||
|
||||
// BumpForceCloseFee makes a RPC call to the node's WalletKitClient and asserts.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
func (h *HarnessRPC) BumpForceCloseFee(
|
||||
req *walletrpc.BumpForceCloseFeeRequest) *walletrpc.BumpForceCloseFeeResponse {
|
||||
|
||||
|
@ -311,7 +311,7 @@ func (h *HarnessRPC) ImportAccountAssertErr(
|
|||
|
||||
// ImportPublicKey makes a RPC call to the node's WalletKitClient and asserts.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
func (h *HarnessRPC) ImportPublicKey(
|
||||
req *walletrpc.ImportPublicKeyRequest) *walletrpc.ImportPublicKeyResponse {
|
||||
|
||||
|
@ -352,7 +352,7 @@ func (h *HarnessRPC) SignPsbtErr(req *walletrpc.SignPsbtRequest) error {
|
|||
|
||||
// ImportTapscript makes a RPC call to the node's WalletKitClient and asserts.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
func (h *HarnessRPC) ImportTapscript(
|
||||
req *walletrpc.ImportTapscriptRequest) *walletrpc.ImportTapscriptResponse {
|
||||
|
||||
|
@ -367,7 +367,7 @@ func (h *HarnessRPC) ImportTapscript(
|
|||
|
||||
// RequiredReserve makes a RPC call to the node's WalletKitClient and asserts.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
func (h *HarnessRPC) RequiredReserve(
|
||||
req *walletrpc.RequiredReserveRequest) *walletrpc.RequiredReserveResponse {
|
||||
|
||||
|
|
|
@ -181,7 +181,7 @@ func NodeArgsForCommitType(commitType lnrpc.CommitmentType) []string {
|
|||
// function provides a simple way to allow test balance assertions to take fee
|
||||
// calculations into account.
|
||||
func CalcStaticFee(c lnrpc.CommitmentType, numHTLCs int) btcutil.Amount {
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
const (
|
||||
htlcWeight = input.HTLCWeight
|
||||
anchorSize = 330 * 2
|
||||
|
@ -238,7 +238,7 @@ func CalculateMaxHtlc(chanCap btcutil.Amount) uint64 {
|
|||
// CalcStaticFeeBuffer calculates appropriate fee buffer which must be taken
|
||||
// into account when sending htlcs.
|
||||
func CalcStaticFeeBuffer(c lnrpc.CommitmentType, numHTLCs int) btcutil.Amount {
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
const (
|
||||
htlcWeight = input.HTLCWeight
|
||||
defaultSatPerVByte = lnwallet.DefaultAnchorsCommitMaxFeeRateSatPerVByte
|
||||
|
|
|
@ -1279,7 +1279,7 @@ func (b *BtcWallet) PublishTransaction(tx *wire.MsgTx, label string) error {
|
|||
// btcwallet error.
|
||||
err = b.chain.MapRPCErr(errors.New(result.RejectReason))
|
||||
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
// These two errors are ignored inside `PublishTransaction`:
|
||||
// https://github.com/btcsuite/btcwallet/blob/master/wallet/wallet.go#L3763
|
||||
// To keep our current behavior, we need to ignore the same errors
|
||||
|
@ -1680,7 +1680,7 @@ out:
|
|||
|
||||
// Launch a goroutine to re-package and send
|
||||
// notifications for any newly confirmed transactions.
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
go func(txNtfn *base.TransactionNotifications) {
|
||||
for _, block := range txNtfn.AttachedBlocks {
|
||||
details, err := minedTransactionsToDetails(
|
||||
|
|
|
@ -432,7 +432,7 @@ func TestEstimateInputWeight(t *testing.T) {
|
|||
{},
|
||||
},
|
||||
},
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
expectedWitnessWeight: input.TaprootKeyPathCustomSighashWitnessSize,
|
||||
}, {
|
||||
name: "p2tr script spend",
|
||||
|
|
|
@ -917,7 +917,7 @@ func (c *ChanCloser) ReceiveClosingSigned( //nolint:funlen
|
|||
)
|
||||
matchingSig := c.priorFeeOffers[remoteProposedFee]
|
||||
if c.cfg.Channel.ChanType().IsTaproot() {
|
||||
localWireSig, err := matchingSig.PartialSig.UnwrapOrErrV( //nolint:lll
|
||||
localWireSig, err := matchingSig.PartialSig.UnwrapOrErrV( //nolint:ll
|
||||
fmt.Errorf("none local sig"),
|
||||
)
|
||||
if err != nil {
|
||||
|
@ -931,7 +931,7 @@ func (c *ChanCloser) ReceiveClosingSigned( //nolint:funlen
|
|||
}
|
||||
|
||||
muSession := c.cfg.MusigSession
|
||||
localSig, remoteSig, closeOpts, err = muSession.CombineClosingOpts( //nolint:lll
|
||||
localSig, remoteSig, closeOpts, err = muSession.CombineClosingOpts( //nolint:ll
|
||||
localWireSig, remoteWireSig,
|
||||
)
|
||||
if err != nil {
|
||||
|
@ -981,7 +981,7 @@ func (c *ChanCloser) ReceiveClosingSigned( //nolint:funlen
|
|||
err = fn.MapOptionZ(
|
||||
c.cfg.AuxCloser, func(aux AuxChanCloser) error {
|
||||
channel := c.cfg.Channel
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
req := AuxShutdownReq{
|
||||
ChanPoint: c.chanPoint,
|
||||
ShortChanID: c.cfg.Channel.ShortChanID(),
|
||||
|
|
|
@ -2181,7 +2181,7 @@ func NewBreachRetribution(chanState *channeldb.OpenChannel, stateNum uint64,
|
|||
// spend (as our output on their revoked tx still needs the
|
||||
// delay), and set the control block.
|
||||
if scriptTree, ok := ourScript.(input.TapscriptDescriptor); ok {
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
br.LocalOutputSignDesc.SignMethod = input.TaprootScriptSpendSignMethod
|
||||
|
||||
ctrlBlock, err := scriptTree.CtrlBlockForPath(
|
||||
|
@ -2191,7 +2191,7 @@ func NewBreachRetribution(chanState *channeldb.OpenChannel, stateNum uint64,
|
|||
return nil, err
|
||||
}
|
||||
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
br.LocalOutputSignDesc.ControlBlock, err = ctrlBlock.ToBytes()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@ -2262,7 +2262,7 @@ func NewBreachRetribution(chanState *channeldb.OpenChannel, stateNum uint64,
|
|||
// parties need to sweep anchors is revealed on chain.
|
||||
scriptTree, ok := theirScript.(input.TapscriptDescriptor)
|
||||
if ok {
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
br.RemoteOutputSignDesc.SignMethod = input.TaprootScriptSpendSignMethod
|
||||
|
||||
ctrlBlock, err := scriptTree.CtrlBlockForPath(
|
||||
|
@ -2271,7 +2271,7 @@ func NewBreachRetribution(chanState *channeldb.OpenChannel, stateNum uint64,
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
br.RemoteOutputSignDesc.ControlBlock, err = ctrlBlock.ToBytes()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@ -3238,7 +3238,7 @@ func genRemoteHtlcSigJobs(keyRing *CommitmentKeyRing,
|
|||
// If this is a taproot channel, then we'll need to set the
|
||||
// method type to ensure we generate a valid signature.
|
||||
if chanType.IsTaproot() {
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
sigJob.SignDesc.SignMethod = input.TaprootScriptSpendSignMethod
|
||||
}
|
||||
|
||||
|
@ -3320,7 +3320,7 @@ func genRemoteHtlcSigJobs(keyRing *CommitmentKeyRing,
|
|||
// If this is a taproot channel, then we'll need to set the
|
||||
// method type to ensure we generate a valid signature.
|
||||
if chanType.IsTaproot() {
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
sigJob.SignDesc.SignMethod = input.TaprootScriptSpendSignMethod
|
||||
}
|
||||
|
||||
|
@ -4786,7 +4786,7 @@ func genHtlcSigValidationJobs(chanState *channeldb.OpenChannel,
|
|||
// If this output index is found within the incoming HTLC
|
||||
// index, then this means that we need to generate an HTLC
|
||||
// success transaction in order to validate the signature.
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
case localCommitmentView.incomingHTLCIndex[outputIndex] != nil:
|
||||
htlc = localCommitmentView.incomingHTLCIndex[outputIndex]
|
||||
|
||||
|
@ -4825,7 +4825,7 @@ func genHtlcSigValidationJobs(chanState *channeldb.OpenChannel,
|
|||
if chanType.IsTaproot() {
|
||||
// TODO(roasbeef): add abstraction in
|
||||
// front
|
||||
prevFetcher := txscript.NewCannedPrevOutputFetcher( //nolint:lll
|
||||
prevFetcher := txscript.NewCannedPrevOutputFetcher( //nolint:ll
|
||||
htlc.ourPkScript, htlcAmt,
|
||||
)
|
||||
hashCache := txscript.NewTxSigHashes(
|
||||
|
@ -4835,7 +4835,7 @@ func genHtlcSigValidationJobs(chanState *channeldb.OpenChannel,
|
|||
htlc.ourWitnessScript,
|
||||
)
|
||||
|
||||
return txscript.CalcTapscriptSignaturehash( //nolint:lll
|
||||
return txscript.CalcTapscriptSignaturehash( //nolint:ll
|
||||
hashCache, sigHashType,
|
||||
successTx, 0, prevFetcher,
|
||||
tapLeaf,
|
||||
|
@ -4880,7 +4880,7 @@ func genHtlcSigValidationJobs(chanState *channeldb.OpenChannel,
|
|||
// Otherwise, if this is an outgoing HTLC, then we'll need to
|
||||
// generate a timeout transaction so we can verify the
|
||||
// signature presented.
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
case localCommitmentView.outgoingHTLCIndex[outputIndex] != nil:
|
||||
htlc = localCommitmentView.outgoingHTLCIndex[outputIndex]
|
||||
|
||||
|
@ -4919,7 +4919,7 @@ func genHtlcSigValidationJobs(chanState *channeldb.OpenChannel,
|
|||
if chanType.IsTaproot() {
|
||||
// TODO(roasbeef): add abstraction in
|
||||
// front
|
||||
prevFetcher := txscript.NewCannedPrevOutputFetcher( //nolint:lll
|
||||
prevFetcher := txscript.NewCannedPrevOutputFetcher( //nolint:ll
|
||||
htlc.ourPkScript, htlcAmt,
|
||||
)
|
||||
hashCache := txscript.NewTxSigHashes(
|
||||
|
@ -4929,7 +4929,7 @@ func genHtlcSigValidationJobs(chanState *channeldb.OpenChannel,
|
|||
htlc.ourWitnessScript,
|
||||
)
|
||||
|
||||
return txscript.CalcTapscriptSignaturehash( //nolint:lll
|
||||
return txscript.CalcTapscriptSignaturehash( //nolint:ll
|
||||
hashCache, sigHashType,
|
||||
timeoutTx, 0, prevFetcher,
|
||||
tapLeaf,
|
||||
|
@ -5246,7 +5246,7 @@ func (lc *LightningChannel) ReceiveNewCommitment(commitSigs *CommitSigs) error {
|
|||
_ = localCommitTx.Serialize(&txBytes)
|
||||
return &InvalidPartialCommitSigError{
|
||||
invalidPartialSigError: &sigErr,
|
||||
InvalidCommitSigError: InvalidCommitSigError{ //nolint:lll
|
||||
InvalidCommitSigError: InvalidCommitSigError{ //nolint:ll
|
||||
commitHeight: nextHeight,
|
||||
commitTx: txBytes.Bytes(),
|
||||
},
|
||||
|
@ -5302,7 +5302,7 @@ func (lc *LightningChannel) ReceiveNewCommitment(commitSigs *CommitSigs) error {
|
|||
|
||||
return &InvalidCommitSigError{
|
||||
commitHeight: nextHeight,
|
||||
commitSig: commitSigs.CommitSig.ToSignatureBytes(), //nolint:lll
|
||||
commitSig: commitSigs.CommitSig.ToSignatureBytes(), //nolint:ll
|
||||
sigHash: sigHash,
|
||||
commitTx: txBytes.Bytes(),
|
||||
}
|
||||
|
@ -5377,7 +5377,7 @@ func (lc *LightningChannel) ReceiveNewCommitment(commitSigs *CommitSigs) error {
|
|||
|
||||
localCommitmentView.sig = sigBytes[:]
|
||||
} else {
|
||||
localCommitmentView.sig = commitSigs.CommitSig.ToSignatureBytes() //nolint:lll
|
||||
localCommitmentView.sig = commitSigs.CommitSig.ToSignatureBytes() //nolint:ll
|
||||
}
|
||||
|
||||
lc.commitChains.Local.addCommitment(localCommitmentView)
|
||||
|
@ -6824,7 +6824,7 @@ func NewUnilateralCloseSummary(chanState *channeldb.OpenChannel, //nolint:funlen
|
|||
// For taproot channels, we'll need to set some additional
|
||||
// fields to ensure the output can be swept.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
if scriptTree, ok := selfScript.(input.TapscriptDescriptor); ok {
|
||||
commitResolution.SelfOutputSignDesc.SignMethod =
|
||||
input.TaprootScriptSpendSignMethod
|
||||
|
@ -6835,7 +6835,7 @@ func NewUnilateralCloseSummary(chanState *channeldb.OpenChannel, //nolint:funlen
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
commitResolution.SelfOutputSignDesc.ControlBlock, err = ctrlBlock.ToBytes()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@ -7269,7 +7269,7 @@ func newOutgoingHtlcResolution(signer input.Signer,
|
|||
return nil, err
|
||||
}
|
||||
} else {
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
secondLevelScriptTree, err := input.TaprootSecondLevelScriptTree(
|
||||
keyRing.RevocationKey, keyRing.ToLocalKey, csvDelay,
|
||||
secondLevelAuxLeaf,
|
||||
|
@ -7336,9 +7336,9 @@ func newOutgoingHtlcResolution(signer input.Signer,
|
|||
ChanType: chanType,
|
||||
ShortChanID: chanState.ShortChanID(),
|
||||
Initiator: chanState.IsInitiator,
|
||||
CommitBlob: chanState.LocalCommitment.CustomBlob, //nolint:lll
|
||||
CommitBlob: chanState.LocalCommitment.CustomBlob, //nolint:ll
|
||||
FundingBlob: chanState.CustomBlob,
|
||||
Type: input.TaprootHtlcLocalOfferedTimeout, //nolint:lll
|
||||
Type: input.TaprootHtlcLocalOfferedTimeout, //nolint:ll
|
||||
CloseType: LocalForceClose,
|
||||
CommitTx: commitTx,
|
||||
ContractPoint: op,
|
||||
|
@ -7348,14 +7348,14 @@ func newOutgoingHtlcResolution(signer input.Signer,
|
|||
HtlcAmt: btcutil.Amount(txOut.Value),
|
||||
CommitCsvDelay: csvDelay,
|
||||
CltvDelay: fn.Some(htlc.RefundTimeout),
|
||||
CommitFee: chanState.LocalCommitment.CommitFee, //nolint:lll
|
||||
CommitFee: chanState.LocalCommitment.CommitFee, //nolint:ll
|
||||
HtlcID: fn.Some(htlc.HtlcIndex),
|
||||
PayHash: fn.Some(htlc.RHash),
|
||||
AuxSigDesc: fn.Some(AuxSigDesc{
|
||||
SignDetails: *txSignDetails,
|
||||
AuxSig: func() []byte {
|
||||
tlvType := htlcCustomSigType.TypeVal() //nolint:lll
|
||||
return htlc.CustomRecords[uint64(tlvType)] //nolint:lll
|
||||
tlvType := htlcCustomSigType.TypeVal() //nolint:ll
|
||||
return htlc.CustomRecords[uint64(tlvType)] //nolint:ll
|
||||
}(),
|
||||
}),
|
||||
}
|
||||
|
@ -7451,7 +7451,7 @@ func newIncomingHtlcResolution(signer input.Signer,
|
|||
PrevOutputFetcher: prevFetcher,
|
||||
}
|
||||
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
if scriptTree, ok := scriptInfo.(input.TapscriptDescriptor); ok {
|
||||
signDesc.SignMethod = input.TaprootScriptSpendSignMethod
|
||||
ctrlBlock, err := scriptTree.CtrlBlockForPath(
|
||||
|
@ -7612,7 +7612,7 @@ func newIncomingHtlcResolution(signer input.Signer,
|
|||
return nil, err
|
||||
}
|
||||
} else {
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
secondLevelScriptTree, err := input.TaprootSecondLevelScriptTree(
|
||||
keyRing.RevocationKey, keyRing.ToLocalKey, csvDelay,
|
||||
secondLevelAuxLeaf,
|
||||
|
@ -7676,8 +7676,8 @@ func newIncomingHtlcResolution(signer input.Signer,
|
|||
ChanType: chanType,
|
||||
ShortChanID: chanState.ShortChanID(),
|
||||
Initiator: chanState.IsInitiator,
|
||||
CommitBlob: chanState.LocalCommitment.CustomBlob, //nolint:lll
|
||||
Type: input.TaprootHtlcAcceptedLocalSuccess, //nolint:lll
|
||||
CommitBlob: chanState.LocalCommitment.CustomBlob, //nolint:ll
|
||||
Type: input.TaprootHtlcAcceptedLocalSuccess, //nolint:ll
|
||||
FundingBlob: chanState.CustomBlob,
|
||||
CloseType: LocalForceClose,
|
||||
CommitTx: commitTx,
|
||||
|
@ -7686,13 +7686,13 @@ func newIncomingHtlcResolution(signer input.Signer,
|
|||
KeyRing: keyRing,
|
||||
HtlcID: fn.Some(htlc.HtlcIndex),
|
||||
CsvDelay: htlcCsvDelay,
|
||||
CommitFee: chanState.LocalCommitment.CommitFee, //nolint:lll
|
||||
CommitFee: chanState.LocalCommitment.CommitFee, //nolint:ll
|
||||
PayHash: fn.Some(htlc.RHash),
|
||||
AuxSigDesc: fn.Some(AuxSigDesc{
|
||||
SignDetails: *txSignDetails,
|
||||
AuxSig: func() []byte {
|
||||
tlvType := htlcCustomSigType.TypeVal() //nolint:lll
|
||||
return htlc.CustomRecords[uint64(tlvType)] //nolint:lll
|
||||
tlvType := htlcCustomSigType.TypeVal() //nolint:ll
|
||||
return htlc.CustomRecords[uint64(tlvType)] //nolint:ll
|
||||
}(),
|
||||
}),
|
||||
CommitCsvDelay: csvDelay,
|
||||
|
@ -8091,7 +8091,7 @@ func NewLocalForceCloseSummary(chanState *channeldb.OpenChannel,
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
commitResolution.SelfOutputSignDesc.ControlBlock, err = ctrlBlock.ToBytes()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@ -8103,9 +8103,9 @@ func NewLocalForceCloseSummary(chanState *channeldb.OpenChannel,
|
|||
resolveBlob := fn.MapOptionZ(
|
||||
auxResolver,
|
||||
func(a AuxContractResolver) fn.Result[tlv.Blob] {
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
return a.ResolveContract(ResolutionReq{
|
||||
ChanPoint: chanState.FundingOutpoint, //nolint:lll
|
||||
ChanPoint: chanState.FundingOutpoint, //nolint:ll
|
||||
ChanType: chanState.ChanType,
|
||||
ShortChanID: chanState.ShortChanID(),
|
||||
Initiator: chanState.IsInitiator,
|
||||
|
@ -8630,7 +8630,7 @@ func NewAnchorResolution(chanState *channeldb.OpenChannel,
|
|||
if scriptTree, ok := localAnchor.(input.TapscriptDescriptor); ok {
|
||||
signDesc.SignMethod = input.TaprootKeySpendSignMethod
|
||||
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
signDesc.PrevOutputFetcher = txscript.NewCannedPrevOutputFetcher(
|
||||
localAnchor.PkScript(), int64(AnchorSize),
|
||||
)
|
||||
|
@ -8652,7 +8652,7 @@ func NewAnchorResolution(chanState *channeldb.OpenChannel,
|
|||
// commitment, as this is a "tweakless" channel type,
|
||||
// we don't need a tweak value at all.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
signDesc.KeyDesc = chanState.LocalChanCfg.PaymentBasePoint
|
||||
}
|
||||
|
||||
|
@ -9072,7 +9072,7 @@ func (lc *LightningChannel) generateRevocation(height uint64) (*lnwire.RevokeAnd
|
|||
// If this is a taproot channel, then we also need to generate the
|
||||
// verification nonce for this target state.
|
||||
if lc.channelState.ChanType.IsTaproot() {
|
||||
nextVerificationNonce, err := channeldb.NewMusigVerificationNonce( //nolint:lll
|
||||
nextVerificationNonce, err := channeldb.NewMusigVerificationNonce( //nolint:ll
|
||||
lc.channelState.LocalChanCfg.MultiSigKey.PubKey,
|
||||
revHeight, lc.taprootNonceProducer,
|
||||
)
|
||||
|
|
|
@ -9829,7 +9829,7 @@ func TestCreateBreachRetribution(t *testing.T) {
|
|||
{
|
||||
name: "fail due to our index too big",
|
||||
revocationLog: &channeldb.RevocationLog{
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
OurOutputIndex: tlv.NewPrimitiveRecord[tlv.TlvType0](
|
||||
uint16(htlcIndex + 1),
|
||||
),
|
||||
|
@ -9839,7 +9839,7 @@ func TestCreateBreachRetribution(t *testing.T) {
|
|||
{
|
||||
name: "fail due to their index too big",
|
||||
revocationLog: &channeldb.RevocationLog{
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
TheirOutputIndex: tlv.NewPrimitiveRecord[tlv.TlvType1](
|
||||
uint16(htlcIndex + 1),
|
||||
),
|
||||
|
@ -10352,7 +10352,7 @@ func TestApplyCommitmentFee(t *testing.T) {
|
|||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
balance, bufferAmt, commitFee, err := tc.channel.applyCommitFee(
|
||||
tc.balance, commitWeight, feePerKw, tc.buffer,
|
||||
)
|
||||
|
@ -10832,7 +10832,7 @@ func TestBlindingPointPersistence(t *testing.T) {
|
|||
// Send a HTLC from Alice to Bob that has a blinding point populated.
|
||||
htlc, _ := createHTLC(0, 100_000_000)
|
||||
blinding, err := pubkeyFromHex(
|
||||
"0228f2af0abe322403480fb3ee172f7f1601e67d1da6cad40b54c4468d48236c39", //nolint:lll
|
||||
"0228f2af0abe322403480fb3ee172f7f1601e67d1da6cad40b54c4468d48236c39", //nolint:ll
|
||||
)
|
||||
require.NoError(t, err)
|
||||
htlc.BlindingPoint = tlv.SomeRecordT(
|
||||
|
|
|
@ -1258,7 +1258,7 @@ func addHTLC(commitTx *wire.MsgTx, whoseCommit lntypes.ChannelParty,
|
|||
} else {
|
||||
paymentDesc.theirPkScript = pkScript
|
||||
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
paymentDesc.theirWitnessScript = scriptInfo.WitnessScriptToSign()
|
||||
}
|
||||
|
||||
|
|
|
@ -895,7 +895,7 @@ func (r *ChannelReservation) ChanState() *channeldb.OpenChannel {
|
|||
// CommitmentKeyRings returns the local+remote key ring used for the very first
|
||||
// commitment transaction both parties.
|
||||
//
|
||||
//nolint:lll
|
||||
//nolint:ll
|
||||
func (r *ChannelReservation) CommitmentKeyRings() lntypes.Dual[CommitmentKeyRing] {
|
||||
r.RLock()
|
||||
defer r.RUnlock()
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue