Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
contractcourt: fix off-by-one error in closeObserver #2766
In this PR, we fix an off-by-one error when handling force closes from the remote party. Before this commit, if the remote party broadcasts state 2, and we were on state 1, then we wouldn't act at all. This is due to an extraneous +1 in the comparison, causing us to only detect this DLP case if the remote party's state is two beyond what we know atm. A test that fails when run on master has been added to demonstrate the bug, and confirm that it has been fixed.
@Roasbeef following conversation in slack, I applied this fix to my node that had this issue (funds were not swept) and I confirm that now after restarting the funds were swept correctly.