This is a quick fix, I'll PR a small cleanup of the disconnect logic so that these cases don't continue to crop up.
Edit: Forgot to mention, this currently asserts due to #8708, which was intended to point out issues like this one. So this should be considered a crash-fix.
net: don't send feefilter messages before the version handshake is complete46625538d6
MarcoFalke
commented at 6:21 PM on November 9, 2016:
member
utACK46625538d674a5aaf1bcfa7c8be8a49e5a23fa9e
MarcoFalke added the label P2P on Nov 9, 2016
sipa
commented at 7:19 PM on November 9, 2016:
member
What does !pto->fDisconnect have to do with the version handshake?
theuni
commented at 7:41 PM on November 9, 2016:
member
@sipa in this case, the handshake started, but stopped halfway-through and set fDisconnected because the node didn't have the services expected. I suppose I should've ignored that and just called this "don't send feefilter messages if fDisconnect has been set".
rebroad
commented at 6:29 AM on November 11, 2016:
contributor
I still don't understand why we don't simply put the fDisconnect check along with the check for nVersion != 0 then all of these little issues would not exist. The only messages we need to send once fDisconnect is set are messages directly relating to the disconnection, e.g. the "bye" message @laanwj proposed a while back.
theuni
commented at 6:37 AM on November 11, 2016:
member
@rebroad#9128 contains the complete fix to this, similar to what you're suggesting.
I'll leave this open for now in case the quick fix is desired to avoid the crash while the bigger PR is in review.
rebroad
commented at 6:51 AM on November 11, 2016:
contributor
@theuni oh! you got there before me! Well, #9129 contains just the fix we're talking about, so might need less review...
theuni
commented at 6:55 AM on November 11, 2016:
member
@rebroad That only stops processing if fDisconnect is already set when SendMessages is called. But with your changes, if it's set part-way through SendMessages (as it is a few times), messages further down will now be allowed out!
laanwj merged this on Nov 21, 2016
laanwj closed this on Nov 21, 2016
laanwj referenced this in commit c3906403c8 on Nov 21, 2016
theuni added the label Needs backport on Nov 23, 2016
This is a metadata mirror of the GitHub repository
bitcoin/bitcoin.
This site is not affiliated with GitHub.
Content is generated from a GitHub metadata backup.
generated: 2026-05-19 06:55 UTC