@@ -194,14 +194,11 @@ abstract class ChannelIntegrationSpec extends IntegrationSpec {
194194 val receivedByF = listReceivedByAddress(finalAddressF)
195195 (receivedByF diff previouslyReceivedByF).size == expectedTxCountF && (receivedByC diff previouslyReceivedByC).size == expectedTxCountC
196196 }, max = 30 seconds, interval = 1 second)
197- // we generate blocks to make txs confirm
198- generateBlocks(2 , Some (minerAddress))
197+ // we generate enough blocks for the channel to be deeply confirmed
198+ generateBlocks(12 , Some (minerAddress))
199199 // and we wait for the channel to close
200200 awaitCond(stateListenerC.expectMsgType[ChannelStateChanged ](max = 60 seconds).currentState == CLOSED , max = 60 seconds)
201201 awaitCond(stateListenerF.expectMsgType[ChannelStateChanged ](max = 60 seconds).currentState == CLOSED , max = 60 seconds)
202-
203- // generate enough blocks so the router will know the channel has been closed and not spliced
204- generateBlocks(12 )
205202 awaitAnnouncements(1 )
206203 }
207204
@@ -238,14 +235,11 @@ abstract class ChannelIntegrationSpec extends IntegrationSpec {
238235 val receivedByF = listReceivedByAddress(finalAddressF, sender)
239236 (receivedByF diff previouslyReceivedByF).size == expectedTxCountF && (receivedByC diff previouslyReceivedByC).size == expectedTxCountC
240237 }, max = 30 seconds, interval = 1 second)
241- // we generate blocks to make txs confirm
242- generateBlocks(2 , Some (minerAddress))
238+ // we generate enough blocks for the channel to be deeply confirmed
239+ generateBlocks(12 , Some (minerAddress))
243240 // and we wait for the channel to close
244241 awaitCond(stateListenerC.expectMsgType[ChannelStateChanged ](max = 60 seconds).currentState == CLOSED , max = 60 seconds)
245242 awaitCond(stateListenerF.expectMsgType[ChannelStateChanged ](max = 60 seconds).currentState == CLOSED , max = 60 seconds)
246-
247- // generate enough blocks so the router will know the channel has been closed and not spliced
248- generateBlocks(12 )
249243 awaitAnnouncements(1 )
250244 }
251245
@@ -294,14 +288,11 @@ abstract class ChannelIntegrationSpec extends IntegrationSpec {
294288 val receivedByF = listReceivedByAddress(finalAddressF, sender)
295289 (receivedByF diff previouslyReceivedByF).size == expectedTxCountF && (receivedByC diff previouslyReceivedByC).size == expectedTxCountC
296290 }, max = 30 seconds, interval = 1 second)
297- // we generate blocks to make txs confirm
298- generateBlocks(2 , Some (minerAddress))
291+ // we generate enough blocks for the channel to be deeply confirmed
292+ generateBlocks(12 , Some (minerAddress))
299293 // and we wait for the channel to close
300294 awaitCond(stateListenerC.expectMsgType[ChannelStateChanged ](max = 60 seconds).currentState == CLOSED , max = 60 seconds)
301295 awaitCond(stateListenerF.expectMsgType[ChannelStateChanged ](max = 60 seconds).currentState == CLOSED , max = 60 seconds)
302-
303- // generate enough blocks so the router will know the channel has been closed and not spliced
304- generateBlocks(12 )
305296 awaitAnnouncements(1 )
306297 }
307298
@@ -353,14 +344,11 @@ abstract class ChannelIntegrationSpec extends IntegrationSpec {
353344 val receivedByF = listReceivedByAddress(finalAddressF, sender)
354345 (receivedByF diff previouslyReceivedByF).size == expectedTxCountF && (receivedByC diff previouslyReceivedByC).size == expectedTxCountC
355346 }, max = 30 seconds, interval = 1 second)
356- // we generate blocks to make tx confirm
357- generateBlocks(2 , Some (minerAddress))
347+ // we generate enough blocks for the channel to be deeply confirmed
348+ generateBlocks(12 , Some (minerAddress))
358349 // and we wait for the channel to close
359350 awaitCond(stateListenerC.expectMsgType[ChannelStateChanged ](max = 60 seconds).currentState == CLOSED , max = 60 seconds)
360351 awaitCond(stateListenerF.expectMsgType[ChannelStateChanged ](max = 60 seconds).currentState == CLOSED , max = 60 seconds)
361-
362- // generate enough blocks so the router will know the channel has been closed and not spliced
363- generateBlocks(12 )
364352 awaitAnnouncements(1 )
365353 }
366354
@@ -599,15 +587,13 @@ class StandardChannelIntegrationSpec extends ChannelIntegrationSpec {
599587 bitcoinClient.getMempool().pipeTo(sender.ref)
600588 sender.expectMsgType[Seq [Transaction ]].exists(_.txIn.head.outPoint.txid == fundingOutpoint.txid)
601589 }, max = 20 seconds, interval = 1 second)
602- generateBlocks(3 )
590+ // we generate enough blocks for the channel to be deeply confirmed
591+ generateBlocks(12 )
603592 awaitCond(stateListener.expectMsgType[ChannelStateChanged ](max = 60 seconds).currentState == CLOSED , max = 60 seconds)
604593
605- bitcoinClient.lookForSpendingTx(None , fundingOutpoint.txid, fundingOutpoint.index.toInt, limit = 10 ).pipeTo(sender.ref)
594+ bitcoinClient.lookForSpendingTx(None , fundingOutpoint.txid, fundingOutpoint.index.toInt, limit = 12 ).pipeTo(sender.ref)
606595 val closingTx = sender.expectMsgType[Transaction ]
607596 assert(closingTx.txOut.map(_.publicKeyScript).toSet == Set (finalPubKeyScriptC, finalPubKeyScriptF))
608-
609- // generate enough blocks so the router will know the channel has been closed and not spliced
610- generateBlocks(12 )
611597 awaitAnnouncements(1 )
612598 }
613599
0 commit comments