Skip to content

Commit

Permalink
Fix yet another flaky test (#1886)
Browse files Browse the repository at this point in the history
If we want C to go to the closed state, we must ensure it's really his claim
transaction that's in the mempool before generating blocks.
  • Loading branch information
t-bast authored Jul 16, 2021
1 parent c22596b commit adf36de
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -733,9 +733,10 @@ class AnchorOutputChannelIntegrationSpec extends ChannelIntegrationSpec {

// bury the unilateral close in a block, C should claim its main output
generateBlocks(2)
val mainOutputC = OutPoint(commitTx, commitTx.txOut.indexWhere(_.publicKeyScript == toRemoteOutC.publicKeyScript))
awaitCond({
bitcoinClient.getMempool().pipeTo(sender.ref)
sender.expectMsgType[Seq[Transaction]].exists(_.txIn.head.outPoint.txid === commitTx.txid)
sender.expectMsgType[Seq[Transaction]].exists(_.txIn.head.outPoint === mainOutputC)
}, max = 20 seconds, interval = 1 second)

// get the claim-remote-output confirmed, then the channel can go to the CLOSED state
Expand Down

0 comments on commit adf36de

Please sign in to comment.