Skip to content

Commit

Permalink
Fix PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
t-bast committed Sep 22, 2023
1 parent 49a6b11 commit 4f2e481
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@ case class ShortIds(real: RealScidStatus, localAlias: Alias, remoteAlias_opt: Op

sealed trait LocalFundingStatus {
def signedTx_opt: Option[Transaction]
/** We store local signatures for the purpose of retransmitting if the funding/splicing flow is interrupted. */
def localSigs_opt: Option[TxSignatures]
}
object LocalFundingStatus {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1135,7 +1135,7 @@ case class Commitments(params: ChannelParams,
/** This function should be used to ignore a commit_sig that we've already received. */
def ignoreRetransmittedCommitSig(commitSig: CommitSig): Boolean = {
val latestRemoteSig = latest.localCommit.commitTxAndRemoteSig.remoteSig
commitSig.batchSize == 1 && latestRemoteSig == commitSig.signature
params.channelFeatures.hasFeature(Features.DualFunding) && commitSig.batchSize == 1 && latestRemoteSig == commitSig.signature
}

def localFundingSigs(fundingTxId: ByteVector32): Option[TxSignatures] = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ class Channel(val nodeParams: NodeParams, val wallet: OnChainChannelFunder with
stay() using d1 storing() sending signingSession1.localSigs calling endQuiescence(d1)
}
}
case _ if d.commitments.params.channelFeatures.hasFeature(Features.DualFunding) && d.commitments.ignoreRetransmittedCommitSig(commit) =>
case _ if d.commitments.ignoreRetransmittedCommitSig(commit) =>
// We haven't received our peer's tx_signatures for the latest funding transaction and asked them to resend it on reconnection.
// They also resend their corresponding commit_sig, but we have already received it so we should ignore it.
// Note that the funding transaction may have confirmed while we were reconnecting.
Expand Down Expand Up @@ -1926,8 +1926,7 @@ class Channel(val nodeParams: NodeParams, val wallet: OnChainChannelFunder with
sendQueue = sendQueue :+ fundingTx.localSigs
}
case fundingStatus =>
// They have not received our tx_signatures, but they must have received our commit_sig, otherwise
// we would be in the case above.
// They have not received our tx_signatures, but they must have received our commit_sig, otherwise we would be in the case above.
log.info("re-sending tx_signatures for fundingTxIndex={} fundingTxId={} (already published or confirmed)", d.commitments.latest.fundingTxIndex, d.commitments.latest.fundingTxId)
sendQueue = sendQueue ++ fundingStatus.localSigs_opt.toSeq
}
Expand Down

0 comments on commit 4f2e481

Please sign in to comment.