Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions lnwallet/interface_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1177,17 +1177,29 @@ func testReorgWalletBalance(r *rpctest.Harness, w *lnwallet.LightningWallet,
// one block on the passed miner and two on the created miner,
// connecting them, and waiting for them to sync.
for i := 0; i < 5; i++ {
peers, err := r2.Node.GetPeerInfo()
if err != nil {
t.Fatalf("unable to get peer info: %v", err)
}
numPeers := len(peers)
err = r2.Node.AddNode(r.P2PAddress(), rpcclient.ANRemove)
if err != nil {
t.Fatalf("unable to disconnect mining nodes: %v", err)
}
// Wait for disconnection
timeout := time.After(30 * time.Second)
for true {
peers, err := r2.Node.GetPeerInfo()
// Allow for timeout
select {
case <-timeout:
t.Fatalf("timeout waiting for miner disconnect")
default:
}
peers, err = r2.Node.GetPeerInfo()
if err != nil {
t.Fatalf("unable to get peer info: %v", err)
}
if len(peers) == 0 {
if len(peers) < numPeers {
break
}
time.Sleep(100 * time.Millisecond)
Expand Down Expand Up @@ -1379,7 +1391,7 @@ func TestLightningWallet(t *testing.T) {
walletType := walletDriver.WalletType
switch walletType {
case "btcwallet":
aliceChainRpc, err := chain.NewRPCClient(netParams,
aliceChainRPC, err := chain.NewRPCClient(netParams,
rpcConfig.Host, rpcConfig.User, rpcConfig.Pass,
rpcConfig.Certificates, false, 20)
if err != nil {
Expand All @@ -1390,7 +1402,7 @@ func TestLightningWallet(t *testing.T) {
HdSeed: aliceHDSeed[:],
DataDir: tempTestDirAlice,
NetParams: netParams,
ChainSource: aliceChainRpc,
ChainSource: aliceChainRPC,
FeeEstimator: lnwallet.StaticFeeEstimator{FeeRate: 250},
}
aliceWalletController, err = walletDriver.New(aliceWalletConfig)
Expand All @@ -1399,7 +1411,7 @@ func TestLightningWallet(t *testing.T) {
}
aliceSigner = aliceWalletController.(*btcwallet.BtcWallet)

bobChainRpc, err := chain.NewRPCClient(netParams,
bobChainRPC, err := chain.NewRPCClient(netParams,
rpcConfig.Host, rpcConfig.User, rpcConfig.Pass,
rpcConfig.Certificates, false, 20)
if err != nil {
Expand All @@ -1410,7 +1422,7 @@ func TestLightningWallet(t *testing.T) {
HdSeed: bobHDSeed[:],
DataDir: tempTestDirBob,
NetParams: netParams,
ChainSource: bobChainRpc,
ChainSource: bobChainRPC,
FeeEstimator: lnwallet.StaticFeeEstimator{FeeRate: 250},
}
bobWalletController, err = walletDriver.New(bobWalletConfig)
Expand Down