Open Varunram opened 6 years ago
We should add some tests for this, probably using invalidateblock
.
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.
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.
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.