mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-31 17:51:33 +02:00
itest: fix make lint
This commit fixes the issues reported by the linter.
This commit is contained in:
@@ -2,8 +2,6 @@ package itest
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/btcsuite/btcd/btcec/v2"
|
||||
@@ -1183,39 +1181,6 @@ func deriveInternalKey(ht *lntest.HarnessTest,
|
||||
return keyDesc, parsedPubKey, fullDerivationPath
|
||||
}
|
||||
|
||||
// receiveChanUpdate waits until a message is received on the stream or the
|
||||
// context is canceled. The context must have a timeout or must be canceled
|
||||
// in case no message is received, otherwise this function will block forever.
|
||||
func receiveChanUpdate(ctx context.Context,
|
||||
stream lnrpc.Lightning_OpenChannelClient) (*lnrpc.OpenStatusUpdate,
|
||||
error) {
|
||||
|
||||
chanMsg := make(chan *lnrpc.OpenStatusUpdate)
|
||||
errChan := make(chan error)
|
||||
go func() {
|
||||
// Consume one message. This will block until the message is
|
||||
// received.
|
||||
resp, err := stream.Recv()
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
chanMsg <- resp
|
||||
}()
|
||||
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return nil, fmt.Errorf("timeout reached before chan pending " +
|
||||
"update sent")
|
||||
|
||||
case err := <-errChan:
|
||||
return nil, err
|
||||
|
||||
case updateMsg := <-chanMsg:
|
||||
return updateMsg, nil
|
||||
}
|
||||
}
|
||||
|
||||
// sendAllCoinsToAddrType sweeps all coins from the wallet and sends them to a
|
||||
// new address of the given type.
|
||||
func sendAllCoinsToAddrType(ht *lntest.HarnessTest,
|
||||
|
Reference in New Issue
Block a user