Closed scravy closed 5 years ago
Can we see these warnings in normally running nodes? If not I suggest convert them in assertions.
Can we see these warnings in normally running nodes? If not I suggest convert them in assertions.
Yes.
Yes.
Then, if it's a "normal" scenario, why is it a warning? As a user I will worry to see warnings.
Then, if it's a "normal" scenario, why is it a warning? As a user I will worry to see warnings.
Okay: https://github.com/dtr-org/unit-e/pull/897/commits/2a2db3f46a950556d1249f1807814b26dbc1bbcd
Putting these exceptions (assert would have the same effect) breaks like a third of the tests.
GetTip()
is used in a number of places where it is being invoked while we're still in IBD, mostly in validation/finalization logic. These places obviously expect to get a nullptr
returned as they guard against that. Anyways, putting an assertion or throwing in this case breaks the code. So I've limited that and documented which function expects what.
@frolosofsky please re-review.
During debugging I ran into some corner cases which these changes should help to identify.
Signed-off-by: Julian Fleischer julian@thirdhash.com