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”.
jonasschnelli
commented at 7:39 am on November 10, 2016:
contributor
utACK46625538d674a5aaf1bcfa7c8be8a49e5a23fa9e
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
luke-jr referenced this in commit
6fe3981ac8
on Dec 2, 2016
laanwj removed the label
Needs backport
on Sep 5, 2017
codablock referenced this in commit
afa99c41fc
on Jan 15, 2018
lateminer referenced this in commit
793b8f55b1
on Oct 16, 2018
andvgal referenced this in commit
b2dfdb006a
on Jan 6, 2019
CryptoCentric referenced this in commit
23e9aea302
on Feb 24, 2019
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: 2024-12-19 06:12 UTC
This site is hosted by @0xB10C More mirrored repositories can be found on mirror.b10c.me