@@ -452,8 +452,9 @@ class Channel(val nodeParams: NodeParams, val wallet: OnChainChannelFunder with
452
452
}
453
453
454
454
case Event (add : UpdateAddHtlc , d : DATA_NORMAL ) =>
455
+ val stfu = Stfu (d.channelId, initiator = true )
455
456
d.commitments.receiveAdd(add, nodeParams.currentFeerates, nodeParams.onChainFeeConf) match {
456
- case Right (commitments1) => stay() using d.copy(commitments = commitments1)
457
+ case Right (commitments1) => stay() using d.copy(commitments = commitments1) sending stfu
457
458
case Left (cause) => handleLocalError(cause, d, Some (add))
458
459
}
459
460
@@ -627,11 +628,11 @@ class Channel(val nodeParams: NodeParams, val wallet: OnChainChannelFunder with
627
628
(d.copy(commitments = commitments1, spliceStatus = SpliceStatus .InitiatorQuiescent (cmd)), Seq (revocation, stfu))
628
629
case _ : SpliceStatus .ReceivedStfu if commitments1.localIsQuiescent =>
629
630
// should be three pending but commited updates to the channel
630
- val ids = commitments1.active.head.localCommit.spec.htlcs.collect({ case htlc => htlc.add.id }).toSeq
631
631
val stfu = Stfu (d.channelId, initiator = false )
632
+ /*
633
+ val ids = commitments1.active.head.localCommit.spec.htlcs.collect({ case htlc => htlc.add.id }).toSeq
632
634
// UpdateFee
633
635
val Right((commitments2, fee)) = commitments1.sendFee(CMD_UPDATE_FEE(FeeratePerKw(1000 sat)), nodeParams.onChainFeeConf)
634
- /*
635
636
// UpdateFailHtlc
636
637
val Right((commitments3, fail)) = commitments2.sendFail(CMD_FAIL_HTLC(ids.head, Right(TemporaryNodeFailure())), nodeParams.privateKey)
637
638
// UpdateFailMalformedHtlc
@@ -643,7 +644,7 @@ class Channel(val nodeParams: NodeParams, val wallet: OnChainChannelFunder with
643
644
val cmdAdd = CMD_ADD_HTLC(ActorRef.noSender, 6666 msat, paymentHash, expiry, emptyOnionPacket, None, Origin.LocalHot(self, UUID.randomUUID()))
644
645
val Right((commitments5, add)) = commitments4.sendAdd(cmdAdd, nodeParams.currentBlockHeight, nodeParams.channelConf, nodeParams.currentFeerates, nodeParams.onChainFeeConf)
645
646
*/
646
- (d.copy(commitments = commitments2 , spliceStatus = SpliceStatus .NonInitiatorQuiescent ), Seq (revocation, stfu, fee ))
647
+ (d.copy(commitments = commitments1 , spliceStatus = SpliceStatus .NonInitiatorQuiescent ), Seq (revocation, stfu))
647
648
case _ =>
648
649
(d.copy(commitments = commitments1), Seq (revocation))
649
650
}
0 commit comments