Fix bug where peer might not have version info#317
Fix bug where peer might not have version info#317dangershony wants to merge 1 commit intomasterfrom
Conversation
MithrilMan
left a comment
There was a problem hiding this comment.
did this PR has a linked issue?
I think this is a bad change.
Assuming that the problem is in not having a version info, this should never happen here because you won't have to process any message before you handshake with a peer.
PeerVersion is the version payload that you received from the remote peer, so it will never be null if you handshaked with it
And you shouldn't process anything if you aren't handshaked, so the fix has to be put in another place
Moreover your change would skip the DoS prevention if PeerVersion is null (another reason why I don't like this change)
Anyway try to fix the issue from the right point: you shouldn't process anything except verack and version message before the peer is handshaked.
|
yeah I agree I will move the check further up the stack, but I don't have a solid way to reproduce this |
sondreb
left a comment
There was a problem hiding this comment.
I agree with @MithrilMan that this likely should be handled or fixed elsewhere, but it's also possible that it happens during shutdown/dispose that have partially deleted some of the objects? Anyway I think as long as this fixed exceptions/crashes, it's ok to merge.
not in this case it was a running node.
I will make another change first that is higher up the call chain. |



No description provided.