net: correctly initialize nMinPingUsecTime #6636

Merged
merged 1 commit into from Sep 4, 2015

Conversation

Projects
None yet
4 participants
@laanwj
Member

laanwj commented Sep 4, 2015

nMinPingUsecTime was left uninitialized in CNode.
The correct initialization for a minimum-until-now is int64_t's max value, so initialize it to that.
Thanks @MarcoFalke for noticing.

@laanwj laanwj added the P2P label Sep 4, 2015

@paveljanik

This comment has been minimized.

Show comment
Hide comment
@paveljanik

paveljanik Sep 4, 2015

Contributor

tested ACK
It could be shocking for some people to see:

    "minping": 0.39083,
    "minping": 0.139336,
    "minping": 9223372036854.775,

;-)

Contributor

paveljanik commented Sep 4, 2015

tested ACK
It could be shocking for some people to see:

    "minping": 0.39083,
    "minping": 0.139336,
    "minping": 9223372036854.775,

;-)

@sipa

This comment has been minimized.

Show comment
Hide comment
@sipa

sipa Sep 4, 2015

Member

Untested ACK.

However, if you care for bikeshedding: how about returning null, or not even including the entry if there is no result?

Member

sipa commented Sep 4, 2015

Untested ACK.

However, if you care for bikeshedding: how about returning null, or not even including the entry if there is no result?

@laanwj

This comment has been minimized.

Show comment
Hide comment
@laanwj

laanwj Sep 4, 2015

Member

I think there's some confusion here: I'm fine with changing what is returned on RPC, but that's not the point of this pull. RPC code isn't even touched.
The idea is to fix the connection slot DoS exhaustion #6374, which uses this newly-introduced CNode field.

Member

laanwj commented Sep 4, 2015

I think there's some confusion here: I'm fine with changing what is returned on RPC, but that's not the point of this pull. RPC code isn't even touched.
The idea is to fix the connection slot DoS exhaustion #6374, which uses this newly-introduced CNode field.

net: correctly initialize nMinPingUsecTime
`nMinPingUsecTime` was left uninitialized in CNode.
The correct initialization for a minimum-until-now is int64_t's max value, so initialize it to that.
Thanks @MarcoFalke for noticing.
@sipa

This comment has been minimized.

Show comment
Hide comment
@sipa

sipa Sep 4, 2015

Member
Member

sipa commented Sep 4, 2015

@laanwj laanwj merged commit 93ff1b9 into bitcoin:master Sep 4, 2015

1 check was pending

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details

laanwj added a commit that referenced this pull request Sep 4, 2015

Merge pull request #6636
93ff1b9 net: correctly initialize nMinPingUsecTime (Wladimir J. van der Laan)
@MarcoFalke

This comment has been minimized.

Show comment
Hide comment
@MarcoFalke

MarcoFalke Sep 4, 2015

Member

tested ACK (3f99d70 which is about the same as the merged one)

Member

MarcoFalke commented Sep 4, 2015

tested ACK (3f99d70 which is about the same as the merged one)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment