mit-dci / lit

Lightning Network node software
MIT License
551 stars 119 forks source link

Handle Reorgs correctly #415

Open Varunram opened 6 years ago

Varunram commented 6 years ago

The code that handles reorgs has always been buggy, this somewhat improves the situation. One known bug that I find is when we have small reorgs and the node doesn't give us a whole lot of headers in order for us to trace back history. I'm thinking we should have a timeout and then go with the longest chain, but I'm happy for inputs on this.

delbonis commented 6 years ago

We should add some tests for this, probably using invalidateblock.

Varunram commented 6 years ago

Yeah, I shall solve the headers problem and write a few tests for this. I think there's already a unit test for this, so if its there, I shall edit that.

Varunram commented 6 years ago

most cases should be covered now, tests still left. Please merge #416 before this though, since this contains some commits of that. Alternatively, you could merge this right away by pressing the "Merge commit" button to gran ownership to the commit authors.