mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-23 06:35:07 +01:00
Merge pull request #1862 from Roasbeef/chan-series-test-fixes
multi: fix panic bug in chan series, itest test flake, update neutrino to latest version
This commit is contained in:
commit
0121fe8465
5 changed files with 51 additions and 5 deletions
4
Gopkg.lock
generated
4
Gopkg.lock
generated
|
@ -265,7 +265,7 @@
|
|||
revision = "462a8a75388506b68f76661af8d649f0b88e5301"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:b87ab48ac3bdfcf8d90c51f9c1a4061660dcb2e1c3c12822ccfc131f5a898578"
|
||||
digest = "1:dba95a15051bdc8ff8373f9c76cf2b63945b896e4302b77e869ea9b9d0dfbee2"
|
||||
name = "github.com/lightninglabs/neutrino"
|
||||
packages = [
|
||||
".",
|
||||
|
@ -276,7 +276,7 @@
|
|||
"headerlist",
|
||||
]
|
||||
pruneopts = "UT"
|
||||
revision = "cccdda0fbb69281c17de496da88e956c300511e2"
|
||||
revision = "07e32eee63e2a6f16acbc8df85c6530972015a44"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:58ab6d6525898cbeb86dc29a68f8e9bfe95254b9032134eb9458779574872260"
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
|
||||
[[constraint]]
|
||||
name = "github.com/lightninglabs/neutrino"
|
||||
revision = "cccdda0fbb69281c17de496da88e956c300511e2"
|
||||
revision = "07e32eee63e2a6f16acbc8df85c6530972015a44"
|
||||
|
||||
[[constraint]]
|
||||
name = "github.com/lightningnetwork/lightning-onion"
|
||||
|
|
|
@ -297,7 +297,7 @@ func (c *chanSeries) FetchChanUpdates(chain chainhash.Hash,
|
|||
HtlcMinimumMsat: e2.MinHTLC,
|
||||
BaseFee: uint32(e2.FeeBaseMSat),
|
||||
FeeRate: uint32(e2.FeeProportionalMillionths),
|
||||
ExtraOpaqueData: e1.ExtraOpaqueData,
|
||||
ExtraOpaqueData: e2.ExtraOpaqueData,
|
||||
}
|
||||
chanUpdate.Signature, err = lnwire.NewSigFromRawSignature(e2.SigBytes)
|
||||
if err != nil {
|
||||
|
|
41
lnd_test.go
41
lnd_test.go
|
@ -5715,6 +5715,47 @@ func testGarbageCollectLinkNodes(net *lntest.NetworkHarness, t *harnessTest) {
|
|||
t.Fatalf("unable to generate blocks: %v", err)
|
||||
}
|
||||
|
||||
// Before we test reconnection, we'll ensure that the channel has been
|
||||
// fully cleaned up for both Carol and Alice.
|
||||
var predErr error
|
||||
pendingChansRequest := &lnrpc.PendingChannelsRequest{}
|
||||
err = lntest.WaitPredicate(func() bool {
|
||||
ctxt, _ = context.WithTimeout(ctxb, timeout)
|
||||
pendingChanResp, err := net.Alice.PendingChannels(
|
||||
ctxt, pendingChansRequest,
|
||||
)
|
||||
if err != nil {
|
||||
predErr = fmt.Errorf("unable to query for pending "+
|
||||
"channels: %v", err)
|
||||
return false
|
||||
}
|
||||
|
||||
predErr = checkNumForceClosedChannels(pendingChanResp, 0)
|
||||
if predErr != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
ctxt, _ = context.WithTimeout(ctxb, timeout)
|
||||
pendingChanResp, err = carol.PendingChannels(
|
||||
ctxt, pendingChansRequest,
|
||||
)
|
||||
if err != nil {
|
||||
predErr = fmt.Errorf("unable to query for pending "+
|
||||
"channels: %v", err)
|
||||
return false
|
||||
}
|
||||
|
||||
predErr = checkNumForceClosedChannels(pendingChanResp, 0)
|
||||
if predErr != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}, time.Second*15)
|
||||
if err != nil {
|
||||
t.Fatalf("channels not marked as fully resolved: %v", predErr)
|
||||
}
|
||||
|
||||
testReconnection(carol)
|
||||
|
||||
// Finally, we'll ensure that Bob and Carol no longer show in Alice's
|
||||
|
|
|
@ -24,6 +24,7 @@ import (
|
|||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
||||
"github.com/btcsuite/btcd/rpcclient"
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
"github.com/btcsuite/btcutil"
|
||||
"github.com/go-errors/errors"
|
||||
"github.com/lightningnetwork/lnd/lnrpc"
|
||||
"github.com/lightningnetwork/lnd/macaroons"
|
||||
|
@ -901,6 +902,7 @@ func (hn *HarnessNode) WaitForBalance(expectedBalance int64, confirmed bool) err
|
|||
ctx := context.Background()
|
||||
req := &lnrpc.WalletBalanceRequest{}
|
||||
|
||||
var lastBalance btcutil.Amount
|
||||
doesBalanceMatch := func() bool {
|
||||
balance, err := hn.WalletBalance(ctx, req)
|
||||
if err != nil {
|
||||
|
@ -908,15 +910,18 @@ func (hn *HarnessNode) WaitForBalance(expectedBalance int64, confirmed bool) err
|
|||
}
|
||||
|
||||
if confirmed {
|
||||
lastBalance = btcutil.Amount(balance.ConfirmedBalance)
|
||||
return balance.ConfirmedBalance == expectedBalance
|
||||
}
|
||||
|
||||
lastBalance = btcutil.Amount(balance.UnconfirmedBalance)
|
||||
return balance.UnconfirmedBalance == expectedBalance
|
||||
}
|
||||
|
||||
err := WaitPredicate(doesBalanceMatch, 30*time.Second)
|
||||
if err != nil {
|
||||
return errors.New("balances not synced after deadline")
|
||||
return fmt.Errorf("balances not synced after deadline: "+
|
||||
"expected %v, only have %v", expectedBalance, lastBalance)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
Loading…
Add table
Reference in a new issue