Skip to content

Conversation

theuni
Copy link
Member

@theuni theuni commented Nov 9, 2016

Caused by changes in #8708. Same fix as #8862.

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.

@maflcko
Copy link
Member

maflcko commented Nov 9, 2016

utACK 4662553

@maflcko maflcko added the P2P label Nov 9, 2016
@sipa
Copy link
Member

sipa commented Nov 9, 2016

What does !pto->fDisconnect have to do with the version handshake?

@theuni
Copy link
Member Author

theuni commented Nov 9, 2016

@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".

For a more correct/complete (but untested) change, see here: https://github.com/theuni/bitcoin/commits/feefilter-assert2 .

@jonasschnelli
Copy link
Contributor

utACK 4662553

@rebroad
Copy link
Contributor

rebroad commented Nov 11, 2016

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
Copy link
Member Author

theuni commented Nov 11, 2016

@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
Copy link
Contributor

rebroad commented Nov 11, 2016

@theuni oh! you got there before me! Well, #9129 contains just the fix we're talking about, so might need less review...

@theuni
Copy link
Member Author

theuni commented Nov 11, 2016

@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 laanwj merged commit 4662553 into bitcoin:master Nov 21, 2016
laanwj added a commit that referenced this pull request Nov 21, 2016
…ndshake is complete

4662553 net: don't send feefilter messages before the version handshake is complete (Cory Fields)
luke-jr pushed a commit to luke-jr/bitcoin that referenced this pull request Dec 2, 2016
codablock pushed a commit to codablock/dash that referenced this pull request Jan 15, 2018
…sion handshake is complete

4662553 net: don't send feefilter messages before the version handshake is complete (Cory Fields)
lateminer pushed a commit to lateminer/bitcoin that referenced this pull request Oct 16, 2018
andvgal pushed a commit to energicryptocurrency/gen2-energi that referenced this pull request Jan 6, 2019
…sion handshake is complete

4662553 net: don't send feefilter messages before the version handshake is complete (Cory Fields)
CryptoCentric pushed a commit to absolute-community/absolute that referenced this pull request Feb 24, 2019
…sion handshake is complete

4662553 net: don't send feefilter messages before the version handshake is complete (Cory Fields)
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants