-
Notifications
You must be signed in to change notification settings - Fork 3
Fix issue with 32bit architecture on big numbers' random generation #1494
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
* Fix issue with 32bit architecture on big numbers' random generation
p2p/strategy/priorityStrategy.go
Outdated
idx := 0 | ||
for _, peer := range unresolvedPeers { | ||
if idx == randomIdx { | ||
if uint64(idx) == randomIdx { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this casting should better be performed when we initiate idx := 0
right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok...
p2p/strategy/priorityStrategy.go
Outdated
idx := 0 | ||
for _, peer := range knownPeers { | ||
if idx == randomIdx { | ||
if uint64(idx) == randomIdx { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this casting should better be performed when we initiate idx := 0 right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok...
p2p/strategy/peerStrategyHelper.go
Outdated
idx := 0 | ||
for _, knownPeer := range peers { | ||
if idx == randomIdx { | ||
if uint64(idx) == randomIdx { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this casting should better be performed when we initiate idx := 0 right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok...
p2p/strategy/nativeStrategy.go
Outdated
idx := 0 | ||
for _, peer := range knownPeers { | ||
if idx == randomIdx { | ||
if uint64(idx) == randomIdx { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this casting should better be performed when we initiate idx := 0 right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok...
p2p/strategy/nativeStrategy.go
Outdated
idx := 0 | ||
for _, peer := range unresolvedPeers { | ||
if idx == randomIdx { | ||
if uint64(idx) == randomIdx { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this casting should better be performed when we initiate idx := 0 right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok..
p2p/strategy/nativeStrategy.go
Outdated
idx := 0 | ||
for _, peer := range resolvedPeers { | ||
if idx == randomIdx { | ||
if uint64(idx) == randomIdx { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this casting should better be performed when we initiate idx := 0 right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok...
* Fix issue with 32bit architecture on big numbers' random generation
Fix issue with 32bit architecture on big numbers' random generation