mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-01-18 21:35:24 +01:00
multi: fix issues reported by whitespace linter
This commit is contained in:
parent
8d83778314
commit
13f187046b
@ -1463,7 +1463,6 @@ func (d *DB) InvoicesSettledSince(sinceSettleIndex uint64) ([]Invoice, error) {
|
||||
seqNo, indexValue := invoiceCursor.Next()
|
||||
|
||||
for ; seqNo != nil && bytes.Compare(seqNo, startIndex[:]) > 0; seqNo, indexValue = invoiceCursor.Next() {
|
||||
|
||||
// Depending on the length of the index value, this may
|
||||
// or may not be an AMP invoice, so we'll extract the
|
||||
// invoice value into two components: the invoice num,
|
||||
|
@ -81,8 +81,8 @@ func MigrateFwdPkgCleanup(tx kvdb.RwTx) error {
|
||||
|
||||
// Otherwise, wipe all the forwarding packages.
|
||||
if err := fwdPkgBkt.DeleteNestedBucket(
|
||||
sourceBytes[:]); err != nil {
|
||||
|
||||
sourceBytes[:],
|
||||
); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
@ -615,9 +615,8 @@ func TestFetchPaymentWithSequenceNumber(t *testing.T) {
|
||||
test := test
|
||||
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
err := kvdb.Update(db,
|
||||
func(tx walletdb.ReadWriteTx) error {
|
||||
|
||||
err := kvdb.Update(
|
||||
db, func(tx walletdb.ReadWriteTx) error {
|
||||
var seqNrBytes [8]byte
|
||||
byteOrder.PutUint64(
|
||||
seqNrBytes[:], test.sequenceNumber,
|
||||
@ -627,7 +626,8 @@ func TestFetchPaymentWithSequenceNumber(t *testing.T) {
|
||||
tx, test.paymentHash, seqNrBytes[:],
|
||||
)
|
||||
return err
|
||||
}, func() {})
|
||||
}, func() {},
|
||||
)
|
||||
require.Equal(t, test.expectedErr, err)
|
||||
})
|
||||
}
|
||||
|
@ -179,6 +179,7 @@ func newTestBoltArbLog(chainhash chainhash.Hash,
|
||||
testArbCfg := ChannelArbitratorConfig{
|
||||
PutResolverReport: func(_ kvdb.RwTx,
|
||||
_ *channeldb.ResolverReport) error {
|
||||
|
||||
return nil
|
||||
},
|
||||
}
|
||||
|
@ -383,6 +383,7 @@ func createTestChannelArbitrator(t *testing.T, log ArbitratorLog,
|
||||
},
|
||||
MarkChannelClosed: func(*channeldb.ChannelCloseSummary,
|
||||
...channeldb.ChannelStatus) error {
|
||||
|
||||
return nil
|
||||
},
|
||||
IsPendingClose: false,
|
||||
@ -1635,6 +1636,7 @@ func TestChannelArbitratorCommitFailure(t *testing.T) {
|
||||
chanArb.cfg.MarkChannelClosed = func(
|
||||
*channeldb.ChannelCloseSummary,
|
||||
...channeldb.ChannelStatus) error {
|
||||
|
||||
close(closed)
|
||||
return nil
|
||||
}
|
||||
@ -2169,6 +2171,7 @@ func TestRemoteCloseInitiator(t *testing.T) {
|
||||
// about setting of channel status.
|
||||
mockMarkClosed := func(_ *channeldb.ChannelCloseSummary,
|
||||
statuses ...channeldb.ChannelStatus) error {
|
||||
|
||||
for _, status := range statuses {
|
||||
err := alice.State().ApplyChanStatus(status)
|
||||
if err != nil {
|
||||
|
@ -62,6 +62,7 @@ func newHtlcResolverTestContext(t *testing.T,
|
||||
Sweeper: newMockSweeper(),
|
||||
IncubateOutputs: func(wire.OutPoint, *lnwallet.OutgoingHtlcResolution,
|
||||
*lnwallet.IncomingHtlcResolution, uint32) error {
|
||||
|
||||
return nil
|
||||
},
|
||||
DeliverResolutionMsg: func(msgs ...ResolutionMsg) error {
|
||||
@ -86,6 +87,7 @@ func newHtlcResolverTestContext(t *testing.T,
|
||||
// this so set nolint directive.
|
||||
checkpointFunc := func(c ContractResolver, // nolint
|
||||
r ...*channeldb.ResolverReport) error {
|
||||
|
||||
return testCtx.checkpoint(c, r...)
|
||||
}
|
||||
|
||||
@ -253,6 +255,7 @@ func TestHtlcSuccessSecondStageResolution(t *testing.T) {
|
||||
// to resolve our htlc.
|
||||
preCheckpoint: func(ctx *htlcResolverTestContext,
|
||||
_ bool) error {
|
||||
|
||||
ctx.notifier.SpendChan <- &chainntnfs.SpendDetail{
|
||||
SpendingTx: sweepTx,
|
||||
SpenderTxHash: &sweepHash,
|
||||
|
@ -861,6 +861,7 @@ func TestHtlcTimeoutSecondStageRemoteSpend(t *testing.T) {
|
||||
// success transcation.
|
||||
preCheckpoint: func(ctx *htlcResolverTestContext,
|
||||
_ bool) error {
|
||||
|
||||
ctx.notifier.SpendChan <- &chainntnfs.SpendDetail{
|
||||
SpendingTx: remoteSuccessTx,
|
||||
SpenderTxHash: &successTxid,
|
||||
|
@ -208,6 +208,7 @@ func newMailboxContext(t *testing.T, startTime time.Time,
|
||||
ctx.mailbox = newMemoryMailBox(&mailBoxConfig{
|
||||
fetchUpdate: func(sid lnwire.ShortChannelID) (
|
||||
*lnwire.ChannelUpdate, error) {
|
||||
|
||||
return &lnwire.ChannelUpdate{
|
||||
ShortChannelID: sid,
|
||||
}, nil
|
||||
@ -671,12 +672,14 @@ func TestMailOrchestrator(t *testing.T) {
|
||||
mo := newMailOrchestrator(&mailOrchConfig{
|
||||
fetchUpdate: func(sid lnwire.ShortChannelID) (
|
||||
*lnwire.ChannelUpdate, error) {
|
||||
|
||||
return &lnwire.ChannelUpdate{
|
||||
ShortChannelID: sid,
|
||||
}, nil
|
||||
},
|
||||
forwardPackets: func(_ chan struct{},
|
||||
pkts ...*htlcPacket) error {
|
||||
|
||||
return nil
|
||||
},
|
||||
clock: clock.NewTestClock(time.Now()),
|
||||
|
@ -70,7 +70,6 @@ func lockInputs(w lnwallet.WalletController, packet *psbt.Packet) (
|
||||
if err := w.ReleaseOutput(
|
||||
LndInternalLockID, op,
|
||||
); err != nil {
|
||||
|
||||
log.Errorf("could not release the "+
|
||||
"lock on %v: %v", op, err)
|
||||
}
|
||||
|
@ -297,6 +297,7 @@ func testUnconfirmedChannelFunding(net *lntest.NetworkHarness, t *harnessTest) {
|
||||
// response to a channel balance RPC.
|
||||
checkChannelBalance := func(node *lntest.HarnessNode,
|
||||
local, remote, pendingLocal, pendingRemote btcutil.Amount) {
|
||||
|
||||
expectedResponse := &lnrpc.ChannelBalanceResponse{
|
||||
LocalBalance: &lnrpc.Amount{
|
||||
Sat: uint64(local),
|
||||
|
@ -614,8 +614,8 @@ func createTestGraphFromChannels(useCache bool, testChannels []*testChannel,
|
||||
|
||||
for _, testChannel := range testChannels {
|
||||
for _, node := range []*testChannelEnd{
|
||||
testChannel.Node1, testChannel.Node2} {
|
||||
|
||||
testChannel.Node1, testChannel.Node2,
|
||||
} {
|
||||
_, exists := aliasMap[node.Alias]
|
||||
if !exists {
|
||||
var features *lnwire.FeatureVector
|
||||
|
@ -779,7 +779,6 @@ func (p *shardHandler) handleSendError(attempt *channeldb.HTLCAttemptInfo,
|
||||
if err := p.router.cfg.Control.Fail(
|
||||
p.identifier, *reason,
|
||||
); err != nil {
|
||||
|
||||
log.Errorf("unable to report failure to control "+
|
||||
"tower: %v", err)
|
||||
|
||||
|
@ -670,7 +670,6 @@ func TestSendPaymentErrorFeeInsufficientPrivateEdge(t *testing.T) {
|
||||
copy(preImage[:], bytes.Repeat([]byte{9}, 32))
|
||||
ctx.router.cfg.Payer.(*mockPaymentAttemptDispatcherOld).setPaymentResult(
|
||||
func(firstHop lnwire.ShortChannelID) ([32]byte, error) {
|
||||
|
||||
if firstHop != roasbeefSongoku || errorReturned {
|
||||
return preImage, nil
|
||||
}
|
||||
@ -685,7 +684,8 @@ func TestSendPaymentErrorFeeInsufficientPrivateEdge(t *testing.T) {
|
||||
Update: errChanUpdate,
|
||||
}, 1,
|
||||
)
|
||||
})
|
||||
},
|
||||
)
|
||||
|
||||
// Send off the payment request to the router, route through son
|
||||
// goku and then across the private channel to elst.
|
||||
@ -802,7 +802,6 @@ func TestSendPaymentPrivateEdgeUpdateFeeExceedsLimit(t *testing.T) {
|
||||
copy(preImage[:], bytes.Repeat([]byte{9}, 32))
|
||||
ctx.router.cfg.Payer.(*mockPaymentAttemptDispatcherOld).setPaymentResult(
|
||||
func(firstHop lnwire.ShortChannelID) ([32]byte, error) {
|
||||
|
||||
if firstHop != roasbeefSongoku || errorReturned {
|
||||
return preImage, nil
|
||||
}
|
||||
@ -817,7 +816,8 @@ func TestSendPaymentPrivateEdgeUpdateFeeExceedsLimit(t *testing.T) {
|
||||
Update: errChanUpdate,
|
||||
}, 1,
|
||||
)
|
||||
})
|
||||
},
|
||||
)
|
||||
|
||||
// Send off the payment request to the router, route through son
|
||||
// goku and then across the private channel to elst.
|
||||
@ -3071,7 +3071,6 @@ func TestSendToRouteMultiShardSend(t *testing.T) {
|
||||
|
||||
ctx.router.cfg.Payer.(*mockPaymentAttemptDispatcherOld).setPaymentResult(
|
||||
func(firstHop lnwire.ShortChannelID) ([32]byte, error) {
|
||||
|
||||
// Signal that the shard has been initiated and is
|
||||
// waiting for a result.
|
||||
waitForResultSignal <- struct{}{}
|
||||
@ -3082,7 +3081,8 @@ func TestSendToRouteMultiShardSend(t *testing.T) {
|
||||
return [32]byte{}, fmt.Errorf("failure")
|
||||
}
|
||||
return res, nil
|
||||
})
|
||||
},
|
||||
)
|
||||
|
||||
// Launch three shards by calling SendToRoute in three goroutines,
|
||||
// returning their final error on the channel.
|
||||
|
@ -1653,7 +1653,6 @@ func (r *rpcServer) ConnectPeer(ctx context.Context,
|
||||
if err := r.server.ConnectToPeer(
|
||||
peerAddr, in.Perm, timeout,
|
||||
); err != nil {
|
||||
|
||||
rpcsLog.Errorf(
|
||||
"[connectpeer]: error connecting to peer: %v", err,
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user