peer: restore the htlcManager's logCommitTimer to a persistent ticker

This commit patches a whole in our optimistic channel synchronization
logic by making the logCommitTimer a persistent ticker rather than one
that is activated after receiving a commitment, and disabled once we
send a new commitment ourself. In the setting of batched full-duplex
channel updates, the prior approach could at times result in a benign
state desync caused by one side being one commitment ahead of the other
because one of the nodes failed to, or was unable to provide the other
with a state update during the workflow.
This commit is contained in:
Olaoluwa Osuntokun committed 2017-04-11 22:02:44 -07:00
1 parent 3393f3a8db
commit 178f26b8d5
2 files changed
+12 -36

No files matched your search

+2 -1
View File
@@ -442,7 +442,8 @@ out:
payHash: payHash,
msg: &lnwire.UpdateFailHTLC{
Reason: []byte{uint8(lnwire.InsufficientCapacity)},
}, err: make(chan error, 1),
},
err: make(chan error, 1),
}
// Send the cancel message along the