Skip to content

Commit 16b8b52

Browse files
committed
fixed mixed up comments
Discovered this while working on #1838. In the following scenario, at reconnection: - `localCommit.index = 7` - `nextRemoteRevocationNumber = 6` So when `localCommit.index == nextRemoteRevocationNumber + 1` we must retransmit the revocation. ``` local remote | | | (no pending sig) | commit = 6 | | next rev = 6 |<----- sig 7 ------| commit = 7 | | |-- rev 6 --> ? | | | | (disconnection) | | | ```
1 parent 786897c commit 16b8b52

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

eclair-core/src/main/scala/fr/acinq/eclair/channel/Helpers.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,10 +322,10 @@ object Helpers {
322322
*/
323323
def checkLocalCommit(d: HasCommitments, nextRemoteRevocationNumber: Long): Boolean = {
324324
if (d.commitments.localCommit.index == nextRemoteRevocationNumber) {
325-
// they just sent a new commit_sig, we have received it but they didn't receive our revocation
325+
// we are in sync
326326
true
327327
} else if (d.commitments.localCommit.index == nextRemoteRevocationNumber + 1) {
328-
// we are in sync
328+
// they just sent a new commit_sig, we have received it but they didn't receive our revocation
329329
true
330330
} else if (d.commitments.localCommit.index > nextRemoteRevocationNumber + 1) {
331331
// remote is behind: we return true because things are fine on our side

0 commit comments

Comments
 (0)