lnd_test: add wait predicate to retribution balance check

This commit is contained in:
Conner Fromknecht 2018-01-27 22:11:18 -08:00
parent 1421a91767
commit 58324e0d38
No known key found for this signature in database
GPG Key ID: 39DE78FBE6ACB0EF

@ -3284,16 +3284,18 @@ func testRevokedCloseRetribution(net *lntest.NetworkHarness, t *harnessTest) {
var bobChan *lnrpc.ActiveChannel
var predErr error
err = lntest.WaitPredicate(func() bool {
bobChan, err = getBobChanInfo()
bChan, err := getBobChanInfo()
if err != nil {
t.Fatalf("unable to get bob's channel info: %v", err)
}
if bobChan.LocalBalance != 30000 {
if bChan.LocalBalance != 30000 {
predErr = fmt.Errorf("bob's balance is incorrect, "+
"got %v, expected %v", bobChan.LocalBalance,
"got %v, expected %v", bChan.LocalBalance,
30000)
return false
}
bobChan = bChan
return true
}, time.Second*15)
if err != nil {