mirror of
https://github.com/lightningnetwork/lnd.git
synced 2024-11-19 01:43:16 +01:00
multi: fix complaints from IDE and linter
Fixed unused param and nilness cond.
This commit is contained in:
parent
a832371d61
commit
78cc1619d7
@ -958,7 +958,7 @@ func initBreachedState(t *testing.T) (*BreachArbitrator,
|
||||
// Create a pair of channels using a notifier that allows us to signal
|
||||
// a spend of the funding transaction. Alice's channel will be the on
|
||||
// observing a breach.
|
||||
alice, bob, err := createInitChannels(t, 1)
|
||||
alice, bob, err := createInitChannels(t)
|
||||
require.NoError(t, err, "unable to create test channels")
|
||||
|
||||
// Instantiate a breach arbiter to handle the breach of alice's channel.
|
||||
@ -2150,7 +2150,7 @@ func createTestArbiter(t *testing.T, contractBreaches chan *ContractBreachEvent,
|
||||
// createInitChannels creates two initialized test channels funded with 10 BTC,
|
||||
// with 5 BTC allocated to each side. Within the channel, Alice is the
|
||||
// initiator.
|
||||
func createInitChannels(t *testing.T, revocationWindow int) (
|
||||
func createInitChannels(t *testing.T) (
|
||||
*lnwallet.LightningChannel, *lnwallet.LightningChannel, error) {
|
||||
|
||||
aliceKeyPriv, aliceKeyPub := btcec.PrivKeyFromBytes(
|
||||
@ -2395,7 +2395,7 @@ func createInitChannels(t *testing.T, revocationWindow int) (
|
||||
|
||||
// Now that the channel are open, simulate the start of a session by
|
||||
// having Alice and Bob extend their revocation windows to each other.
|
||||
err = initRevocationWindows(channelAlice, channelBob, revocationWindow)
|
||||
err = initRevocationWindows(channelAlice, channelBob)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
@ -2408,7 +2408,7 @@ func createInitChannels(t *testing.T, revocationWindow int) (
|
||||
// commitment state machines.
|
||||
//
|
||||
// TODO(conner) remove code duplication
|
||||
func initRevocationWindows(chanA, chanB *lnwallet.LightningChannel, windowSize int) error {
|
||||
func initRevocationWindows(chanA, chanB *lnwallet.LightningChannel) error {
|
||||
aliceNextRevoke, err := chanA.NextRevocationKey()
|
||||
if err != nil {
|
||||
return err
|
||||
|
@ -1188,7 +1188,7 @@ func (f *Manager) stateStep(channel *channeldb.OpenChannel,
|
||||
// If this is a zero-conf channel, then we will wait
|
||||
// for it to be confirmed before announcing it to the
|
||||
// greater network.
|
||||
err := f.waitForZeroConfChannel(channel, pendingChanID)
|
||||
err := f.waitForZeroConfChannel(channel)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed waiting for zero "+
|
||||
"channel: %v", err)
|
||||
@ -3605,9 +3605,7 @@ func (f *Manager) annAfterSixConfs(completeChan *channeldb.OpenChannel,
|
||||
// waitForZeroConfChannel is called when the state is addedToRouterGraph with
|
||||
// a zero-conf channel. This will wait for the real confirmation, add the
|
||||
// confirmed SCID to the router graph, and then announce after six confs.
|
||||
func (f *Manager) waitForZeroConfChannel(c *channeldb.OpenChannel,
|
||||
pendingID [32]byte) error {
|
||||
|
||||
func (f *Manager) waitForZeroConfChannel(c *channeldb.OpenChannel) error {
|
||||
// First we'll check whether the channel is confirmed on-chain. If it
|
||||
// is already confirmed, the chainntnfs subsystem will return with the
|
||||
// confirmed tx. Otherwise, we'll wait here until confirmation occurs.
|
||||
|
@ -1089,7 +1089,7 @@ func (p *Brontide) loadActiveChannels(chans []*channeldb.OpenChannel) (
|
||||
return
|
||||
}
|
||||
|
||||
shutdownMsg = fn.Some[lnwire.Shutdown](*shutdown)
|
||||
shutdownMsg = fn.Some(*shutdown)
|
||||
})
|
||||
if shutdownInfoErr != nil {
|
||||
return nil, shutdownInfoErr
|
||||
@ -2938,7 +2938,7 @@ func (p *Brontide) restartCoopClose(lnChan *lnwallet.LightningChannel) (
|
||||
})
|
||||
|
||||
// An error other than ErrNoShutdownInfo was returned
|
||||
case err != nil && !errors.Is(err, channeldb.ErrNoShutdownInfo):
|
||||
case !errors.Is(err, channeldb.ErrNoShutdownInfo):
|
||||
return nil, err
|
||||
|
||||
case errors.Is(err, channeldb.ErrNoShutdownInfo):
|
||||
|
@ -5677,7 +5677,7 @@ sendLoop:
|
||||
func (r *rpcServer) SendPaymentSync(ctx context.Context,
|
||||
nextPayment *lnrpc.SendRequest) (*lnrpc.SendResponse, error) {
|
||||
|
||||
return r.sendPaymentSync(ctx, &rpcPaymentRequest{
|
||||
return r.sendPaymentSync(&rpcPaymentRequest{
|
||||
SendRequest: nextPayment,
|
||||
})
|
||||
}
|
||||
@ -5698,12 +5698,12 @@ func (r *rpcServer) SendToRouteSync(ctx context.Context,
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return r.sendPaymentSync(ctx, paymentRequest)
|
||||
return r.sendPaymentSync(paymentRequest)
|
||||
}
|
||||
|
||||
// sendPaymentSync is the synchronous variant of sendPayment. It will block and
|
||||
// wait until the payment has been fully completed.
|
||||
func (r *rpcServer) sendPaymentSync(ctx context.Context,
|
||||
func (r *rpcServer) sendPaymentSync(
|
||||
nextPayment *rpcPaymentRequest) (*lnrpc.SendResponse, error) {
|
||||
|
||||
// We don't allow payments to be sent while the daemon itself is still
|
||||
|
Loading…
Reference in New Issue
Block a user