@@ -183,12 +183,15 @@ abstract class ChannelIntegrationSpec extends IntegrationSpec {
183
183
paymentSender.expectMsgType[PaymentSent ](max = 60 seconds)
184
184
// we then generate enough blocks so that nodes get their main delayed output
185
185
generateBlocks(25 , Some (minerAddress))
186
- // F should have 2 recv transactions: the redeemed htlc and its main output
187
- // C should have 1 recv transaction: its main output
186
+ val expectedTxCountC = 1 // C should have 1 recv transaction: its main output
187
+ val expectedTxCountF = commitmentFormat match {
188
+ case _ : AnchorOutputsCommitmentFormat => 2 // F should have 2 recv transactions: the redeemed htlc and its main output
189
+ case Transactions .DefaultCommitmentFormat => 1 // F's main output uses static_remotekey
190
+ }
188
191
awaitCond({
189
192
val receivedByC = listReceivedByAddress(finalAddressC, sender)
190
193
val receivedByF = listReceivedByAddress(finalAddressF)
191
- (receivedByF diff previouslyReceivedByF).size == 2 && (receivedByC diff previouslyReceivedByC).size == 1
194
+ (receivedByF diff previouslyReceivedByF).size == expectedTxCountF && (receivedByC diff previouslyReceivedByC).size == expectedTxCountC
192
195
}, max = 30 seconds, interval = 1 second)
193
196
// we generate blocks to make txs confirm
194
197
generateBlocks(2 , Some (minerAddress))
@@ -221,12 +224,15 @@ abstract class ChannelIntegrationSpec extends IntegrationSpec {
221
224
paymentSender.expectMsgType[PaymentSent ](max = 60 seconds)
222
225
// we then generate enough blocks so that F gets its htlc-success delayed output
223
226
generateBlocks(25 , Some (minerAddress))
224
- // F should have 2 recv transactions: the redeemed htlc and its main output
225
- // C should have 1 recv transaction: its main output
227
+ val expectedTxCountC = commitmentFormat match {
228
+ case _ : AnchorOutputsCommitmentFormat => 1 // C should have 1 recv transaction: its main output
229
+ case Transactions .DefaultCommitmentFormat => 0 // C's main output uses static_remotekey
230
+ }
231
+ val expectedTxCountF = 2 // F should have 2 recv transactions: the redeemed htlc and its main output
226
232
awaitCond({
227
233
val receivedByC = listReceivedByAddress(finalAddressC, sender)
228
234
val receivedByF = listReceivedByAddress(finalAddressF, sender)
229
- (receivedByF diff previouslyReceivedByF).size == 2 && (receivedByC diff previouslyReceivedByC).size == 1
235
+ (receivedByF diff previouslyReceivedByF).size == expectedTxCountF && (receivedByC diff previouslyReceivedByC).size == expectedTxCountC
230
236
}, max = 30 seconds, interval = 1 second)
231
237
// we generate blocks to make txs confirm
232
238
generateBlocks(2 , Some (minerAddress))
@@ -271,12 +277,15 @@ abstract class ChannelIntegrationSpec extends IntegrationSpec {
271
277
assert(failed.failures.head.asInstanceOf [RemoteFailure ].e == DecryptedFailurePacket (nodes(" C" ).nodeParams.nodeId, PermanentChannelFailure ()))
272
278
// we then generate enough blocks to confirm all delayed transactions
273
279
generateBlocks(25 , Some (minerAddress))
274
- // C should have 2 recv transactions: its main output and the htlc timeout
275
- // F should have 1 recv transaction: its main output
280
+ val expectedTxCountC = 2 // C should have 2 recv transactions: its main output and the htlc timeout
281
+ val expectedTxCountF = commitmentFormat match {
282
+ case _ : AnchorOutputsCommitmentFormat => 1 // F should have 1 recv transaction: its main output
283
+ case Transactions .DefaultCommitmentFormat => 0 // F's main output uses static_remotekey
284
+ }
276
285
awaitCond({
277
286
val receivedByC = listReceivedByAddress(finalAddressC, sender)
278
287
val receivedByF = listReceivedByAddress(finalAddressF, sender)
279
- (receivedByF diff previouslyReceivedByF).size == 1 && (receivedByC diff previouslyReceivedByC).size == 2
288
+ (receivedByF diff previouslyReceivedByF).size == expectedTxCountF && (receivedByC diff previouslyReceivedByC).size == expectedTxCountC
280
289
}, max = 30 seconds, interval = 1 second)
281
290
// we generate blocks to make txs confirm
282
291
generateBlocks(2 , Some (minerAddress))
@@ -324,12 +333,15 @@ abstract class ChannelIntegrationSpec extends IntegrationSpec {
324
333
assert(failed.failures.head.asInstanceOf [RemoteFailure ].e == DecryptedFailurePacket (nodes(" C" ).nodeParams.nodeId, PermanentChannelFailure ()))
325
334
// we then generate enough blocks to confirm all delayed transactions
326
335
generateBlocks(25 , Some (minerAddress))
327
- // C should have 2 recv transactions: its main output and the htlc timeout
328
- // F should have 1 recv transaction: its main output
336
+ val expectedTxCountC = commitmentFormat match {
337
+ case _ : AnchorOutputsCommitmentFormat => 2 // C should have 2 recv transactions: its main output and the htlc timeout
338
+ case Transactions .DefaultCommitmentFormat => 1 // C's main output uses static_remotekey
339
+ }
340
+ val expectedTxCountF = 1 // F should have 1 recv transaction: its main output
329
341
awaitCond({
330
342
val receivedByC = listReceivedByAddress(finalAddressC, sender)
331
343
val receivedByF = listReceivedByAddress(finalAddressF, sender)
332
- (receivedByF diff previouslyReceivedByF).size == 1 && (receivedByC diff previouslyReceivedByC).size == 2
344
+ (receivedByF diff previouslyReceivedByF).size == expectedTxCountF && (receivedByC diff previouslyReceivedByC).size == expectedTxCountC
333
345
}, max = 30 seconds, interval = 1 second)
334
346
// we generate blocks to make tx confirm
335
347
generateBlocks(2 , Some (minerAddress))
@@ -455,9 +467,9 @@ abstract class ChannelIntegrationSpec extends IntegrationSpec {
455
467
class StandardChannelIntegrationSpec extends ChannelIntegrationSpec {
456
468
457
469
test(" start eclair nodes" ) {
458
- instantiateEclairNode(" A" , ConfigFactory .parseMap(Map (" eclair.node-alias" -> " A" , " eclair.channel.expiry-delta-blocks" -> 40 , " eclair.channel.fulfill-safety-before-timeout-blocks" -> 12 , " eclair.server.port" -> (if (useEclairSigner) 29840 else 29740 ), " eclair.api.port" -> (if (useEclairSigner) 28190 else 28090 )).asJava).withFallback(withDefaultCommitment ).withFallback(commonConfig))
470
+ instantiateEclairNode(" A" , ConfigFactory .parseMap(Map (" eclair.node-alias" -> " A" , " eclair.channel.expiry-delta-blocks" -> 40 , " eclair.channel.fulfill-safety-before-timeout-blocks" -> 12 , " eclair.server.port" -> (if (useEclairSigner) 29840 else 29740 ), " eclair.api.port" -> (if (useEclairSigner) 28190 else 28090 )).asJava).withFallback(withStaticRemoteKey ).withFallback(commonConfig))
459
471
instantiateEclairNode(" C" , ConfigFactory .parseMap(Map (" eclair.node-alias" -> " C" , " eclair.channel.expiry-delta-blocks" -> 40 , " eclair.channel.fulfill-safety-before-timeout-blocks" -> 12 , " eclair.server.port" -> (if (useEclairSigner) 29841 else 29741 ), " eclair.api.port" -> (if (useEclairSigner) 28191 else 28091 )).asJava).withFallback(withAnchorOutputs).withFallback(commonConfig))
460
- instantiateEclairNode(" F" , ConfigFactory .parseMap(Map (" eclair.node-alias" -> " F" , " eclair.channel.expiry-delta-blocks" -> 40 , " eclair.channel.fulfill-safety-before-timeout-blocks" -> 12 , " eclair.server.port" -> (if (useEclairSigner) 29842 else 29742 ), " eclair.api.port" -> (if (useEclairSigner) 28192 else 28092 )).asJava).withFallback(withDefaultCommitment ).withFallback(commonConfig))
472
+ instantiateEclairNode(" F" , ConfigFactory .parseMap(Map (" eclair.node-alias" -> " F" , " eclair.channel.expiry-delta-blocks" -> 40 , " eclair.channel.fulfill-safety-before-timeout-blocks" -> 12 , " eclair.server.port" -> (if (useEclairSigner) 29842 else 29742 ), " eclair.api.port" -> (if (useEclairSigner) 28192 else 28092 )).asJava).withFallback(withStaticRemoteKey ).withFallback(commonConfig))
461
473
}
462
474
463
475
test(" connect nodes" ) {
@@ -614,10 +626,11 @@ class StandardChannelIntegrationSpec extends ChannelIntegrationSpec {
614
626
sender.expectMsg(htlcSuccess.head.txid)
615
627
bitcoinClient.publishTransaction(htlcTimeout.head).pipeTo(sender.ref)
616
628
sender.expectMsg(htlcTimeout.head.txid)
617
- // at this point C should have 6 recv transactions: its previous main output, F's main output and all htlc outputs (taken as punishment)
629
+ // at this point C should have 5 recv transactions: F's main output and all htlc outputs (taken as punishment)
630
+ // C's main output uses static_remotekey, so C doesn't need to claim it
618
631
awaitCond({
619
632
val receivedByC = listReceivedByAddress(finalAddressC, sender)
620
- (receivedByC diff previouslyReceivedByC).size == 6
633
+ (receivedByC diff previouslyReceivedByC).size == 5
621
634
}, max = 30 seconds, interval = 1 second)
622
635
// we generate blocks to make txs confirm
623
636
generateBlocks(2 )
0 commit comments