rpcserver+itest: skip err from FlapCount
We need to make sure the `ListPeers` to be robust against errors from the `FlapCount` so this RPC won't fail due to no flap count info. Also updated the itest to check this field.
This commit is contained in:
2 files changed
+16
-1
No files matched your search
@@ -257,6 +257,17 @@ func testListChannels(ht *lntest.HarnessTest) {
|
||||
assertChannelConstraintsEqual(
|
||||
ht, aliceChannel.RemoteConstraints, bobChannel.LocalConstraints,
|
||||
)
|
||||
|
||||
// Finally we assert that the flap count is updated as expected.
|
||||
resp := alice.RPC.ListPeers()
|
||||
|
||||
// Assert Alice only have one peer.
|
||||
require.Len(ht, resp.Peers, 1)
|
||||
for _, p := range resp.Peers {
|
||||
// The channel open event resulted in an online event, so we
|
||||
// expect the flap count to be 1.
|
||||
require.EqualValues(ht, 1, p.FlapCount)
|
||||
}
|
||||
}
|
||||
|
||||
// testMaxPendingChannels checks that error is returned from remote peer if
|
||||
|
||||
Reference in new issue
Block a user