@@ -634,7 +634,7 @@ class Channel(val nodeParams: NodeParams, val wallet: OnChainChannelFunder, val
634
634
val channelUpdate1 = if (d.channelUpdate.shortChannelId != scidForChannelUpdate) {
635
635
log.info(s " using new scid in channel_update: old= ${d.channelUpdate.shortChannelId} new= $scidForChannelUpdate" )
636
636
// we re-announce the channelUpdate for the same reason
637
- Announcements .makeChannelUpdate(nodeParams.chainHash, nodeParams.privateKey, remoteNodeId, scidForChannelUpdate, d.channelUpdate.cltvExpiryDelta, d.channelUpdate.htlcMinimumMsat, d.channelUpdate.feeBaseMsat, d.channelUpdate.feeProportionalMillionths, d.commitments.capacity.toMilliSatoshi, enable = Helpers .aboveReserve(d.commitments))
637
+ Announcements .makeChannelUpdate(nodeParams.chainHash, nodeParams.privateKey, remoteNodeId, scidForChannelUpdate, d.channelUpdate.cltvExpiryDelta, d.channelUpdate.htlcMinimumMsat, d.channelUpdate.feeBaseMsat, d.channelUpdate.feeProportionalMillionths, d.commitments.capacity.toMilliSatoshi, isPrivate = ! d.commitments.announceChannel, enable = Helpers .aboveReserve(d.commitments))
638
638
} else {
639
639
d.channelUpdate
640
640
}
@@ -667,7 +667,7 @@ class Channel(val nodeParams: NodeParams, val wallet: OnChainChannelFunder, val
667
667
} else {
668
668
// we generate a new channel_update because the scid used may change if we were previously using an alias
669
669
val scidForChannelUpdate = Helpers .scidForChannelUpdate(Some (channelAnn), d.shortIds.localAlias)
670
- val channelUpdate = Announcements .makeChannelUpdate(nodeParams.chainHash, nodeParams.privateKey, remoteNodeId, scidForChannelUpdate, d.channelUpdate.cltvExpiryDelta, d.channelUpdate.htlcMinimumMsat, d.channelUpdate.feeBaseMsat, d.channelUpdate.feeProportionalMillionths, d.commitments.capacity.toMilliSatoshi, enable = Helpers .aboveReserve(d.commitments))
670
+ val channelUpdate = Announcements .makeChannelUpdate(nodeParams.chainHash, nodeParams.privateKey, remoteNodeId, scidForChannelUpdate, d.channelUpdate.cltvExpiryDelta, d.channelUpdate.htlcMinimumMsat, d.channelUpdate.feeBaseMsat, d.channelUpdate.feeProportionalMillionths, d.commitments.capacity.toMilliSatoshi, isPrivate = false , enable = Helpers .aboveReserve(d.commitments))
671
671
// we use goto() instead of stay() because we want to fire transitions
672
672
goto(NORMAL ) using d.copy(channelAnnouncement = Some (channelAnn), channelUpdate = channelUpdate) storing()
673
673
}
@@ -689,7 +689,7 @@ class Channel(val nodeParams: NodeParams, val wallet: OnChainChannelFunder, val
689
689
}
690
690
691
691
case Event (c : CMD_UPDATE_RELAY_FEE , d : DATA_NORMAL ) =>
692
- val channelUpdate1 = Announcements .makeChannelUpdate(nodeParams.chainHash, nodeParams.privateKey, remoteNodeId, scidForChannelUpdate(d), c.cltvExpiryDelta_opt.getOrElse(d.channelUpdate.cltvExpiryDelta), d.channelUpdate.htlcMinimumMsat, c.feeBase, c.feeProportionalMillionths, d.commitments.capacity.toMilliSatoshi, enable = Helpers .aboveReserve(d.commitments))
692
+ val channelUpdate1 = Announcements .makeChannelUpdate(nodeParams.chainHash, nodeParams.privateKey, remoteNodeId, scidForChannelUpdate(d), c.cltvExpiryDelta_opt.getOrElse(d.channelUpdate.cltvExpiryDelta), d.channelUpdate.htlcMinimumMsat, c.feeBase, c.feeProportionalMillionths, d.commitments.capacity.toMilliSatoshi, isPrivate = ! d.commitments.announceChannel, enable = Helpers .aboveReserve(d.commitments))
693
693
log.info(s " updating relay fees: prev={} next={} " , d.channelUpdate.toStringShort, channelUpdate1.toStringShort)
694
694
val replyTo = if (c.replyTo == ActorRef .noSender) sender() else c.replyTo
695
695
replyTo ! RES_SUCCESS (c, d.channelId)
@@ -698,7 +698,7 @@ class Channel(val nodeParams: NodeParams, val wallet: OnChainChannelFunder, val
698
698
699
699
case Event (BroadcastChannelUpdate (reason), d : DATA_NORMAL ) =>
700
700
val age = TimestampSecond .now() - d.channelUpdate.timestamp
701
- val channelUpdate1 = Announcements .makeChannelUpdate(nodeParams.chainHash, nodeParams.privateKey, remoteNodeId, scidForChannelUpdate(d), d.channelUpdate.cltvExpiryDelta, d.channelUpdate.htlcMinimumMsat, d.channelUpdate.feeBaseMsat, d.channelUpdate.feeProportionalMillionths, d.commitments.capacity.toMilliSatoshi, enable = Helpers .aboveReserve(d.commitments))
701
+ val channelUpdate1 = Announcements .makeChannelUpdate(nodeParams.chainHash, nodeParams.privateKey, remoteNodeId, scidForChannelUpdate(d), d.channelUpdate.cltvExpiryDelta, d.channelUpdate.htlcMinimumMsat, d.channelUpdate.feeBaseMsat, d.channelUpdate.feeProportionalMillionths, d.commitments.capacity.toMilliSatoshi, isPrivate = ! d.commitments.announceChannel, enable = Helpers .aboveReserve(d.commitments))
702
702
reason match {
703
703
case Reconnected if d.commitments.announceChannel && Announcements .areSame(channelUpdate1, d.channelUpdate) && age < REFRESH_CHANNEL_UPDATE_INTERVAL =>
704
704
// we already sent an identical channel_update not long ago (flapping protection in case we keep being disconnected/reconnected)
@@ -722,7 +722,7 @@ class Channel(val nodeParams: NodeParams, val wallet: OnChainChannelFunder, val
722
722
// if we have pending unsigned htlcs, then we cancel them and generate an update with the disabled flag set, that will be returned to the sender in a temporary channel failure
723
723
if (d.commitments.localChanges.proposed.collectFirst { case add : UpdateAddHtlc => add }.isDefined) {
724
724
log.debug(" updating channel_update announcement (reason=disabled)" )
725
- val channelUpdate1 = Announcements .makeChannelUpdate(nodeParams.chainHash, nodeParams.privateKey, remoteNodeId, scidForChannelUpdate(d), d.channelUpdate.cltvExpiryDelta, d.channelUpdate.htlcMinimumMsat, d.channelUpdate.feeBaseMsat, d.channelUpdate.feeProportionalMillionths, d.commitments.capacity.toMilliSatoshi, enable = false )
725
+ val channelUpdate1 = Announcements .makeChannelUpdate(nodeParams.chainHash, nodeParams.privateKey, remoteNodeId, scidForChannelUpdate(d), d.channelUpdate.cltvExpiryDelta, d.channelUpdate.htlcMinimumMsat, d.channelUpdate.feeBaseMsat, d.channelUpdate.feeProportionalMillionths, d.commitments.capacity.toMilliSatoshi, isPrivate = ! d.commitments.announceChannel, enable = false )
726
726
// NB: the htlcs stay() in the commitments.localChange, they will be cleaned up after reconnection
727
727
d.commitments.localChanges.proposed.collect {
728
728
case add : UpdateAddHtlc => relayer ! RES_ADD_SETTLED (d.commitments.originChannels(add.id), add, HtlcResult .DisconnectedBeforeSigned (channelUpdate1))
@@ -1864,7 +1864,7 @@ class Channel(val nodeParams: NodeParams, val wallet: OnChainChannelFunder, val
1864
1864
if (d.channelUpdate.channelFlags.isEnabled) {
1865
1865
// if the channel isn't disabled we generate a new channel_update
1866
1866
log.info(" updating channel_update announcement (reason=disabled)" )
1867
- val channelUpdate1 = Announcements .makeChannelUpdate(nodeParams.chainHash, nodeParams.privateKey, remoteNodeId, scidForChannelUpdate(d), d.channelUpdate.cltvExpiryDelta, d.channelUpdate.htlcMinimumMsat, d.channelUpdate.feeBaseMsat, d.channelUpdate.feeProportionalMillionths, d.commitments.capacity.toMilliSatoshi, enable = false )
1867
+ val channelUpdate1 = Announcements .makeChannelUpdate(nodeParams.chainHash, nodeParams.privateKey, remoteNodeId, scidForChannelUpdate(d), d.channelUpdate.cltvExpiryDelta, d.channelUpdate.htlcMinimumMsat, d.channelUpdate.feeBaseMsat, d.channelUpdate.feeProportionalMillionths, d.commitments.capacity.toMilliSatoshi, isPrivate = ! d.commitments.announceChannel, enable = false )
1868
1868
// then we update the state and replay the request
1869
1869
self forward c
1870
1870
// we use goto() to fire transitions
@@ -1877,7 +1877,7 @@ class Channel(val nodeParams: NodeParams, val wallet: OnChainChannelFunder, val
1877
1877
}
1878
1878
1879
1879
private def handleUpdateRelayFeeDisconnected (c : CMD_UPDATE_RELAY_FEE , d : DATA_NORMAL ) = {
1880
- val channelUpdate1 = Announcements .makeChannelUpdate(nodeParams.chainHash, nodeParams.privateKey, remoteNodeId, scidForChannelUpdate(d), c.cltvExpiryDelta_opt.getOrElse(d.channelUpdate.cltvExpiryDelta), d.channelUpdate.htlcMinimumMsat, c.feeBase, c.feeProportionalMillionths, d.commitments.capacity.toMilliSatoshi, enable = false )
1880
+ val channelUpdate1 = Announcements .makeChannelUpdate(nodeParams.chainHash, nodeParams.privateKey, remoteNodeId, scidForChannelUpdate(d), c.cltvExpiryDelta_opt.getOrElse(d.channelUpdate.cltvExpiryDelta), d.channelUpdate.htlcMinimumMsat, c.feeBase, c.feeProportionalMillionths, d.commitments.capacity.toMilliSatoshi, isPrivate = ! d.commitments.announceChannel, enable = false )
1881
1881
log.info(s " updating relay fees: prev={} next={} " , d.channelUpdate.toStringShort, channelUpdate1.toStringShort)
1882
1882
val replyTo = if (c.replyTo == ActorRef .noSender) sender() else c.replyTo
1883
1883
replyTo ! RES_SUCCESS (c, d.channelId)
0 commit comments