-
Notifications
You must be signed in to change notification settings - Fork 111
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
feat:dot/network: open block announce stream and send handshake on connect #1467
Conversation
Codecov Report
@@ Coverage Diff @@
## development #1467 +/- ##
===============================================
+ Coverage 58.01% 58.15% +0.13%
===============================================
Files 152 152
Lines 15307 15327 +20
===============================================
+ Hits 8881 8914 +33
+ Misses 4874 4862 -12
+ Partials 1552 1551 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
dot/network/service.go
Outdated
s.notificationsMu.Lock() | ||
defer s.notificationsMu.Unlock() | ||
|
||
if _, has := s.notificationsProtocols[BlockAnnounceMsgType]; !has { |
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.
Avoid refetching BlockAnnounceMsgType
from map.
info, has := s.notificationsProtocols[BlockAnnounceMsgType]
if !has {
....
}
peer := conn.RemotePeer() | ||
if hsData, has := info.handshakeData[peer]; !has || !hsData.received { | ||
info.handshakeData[peer] = &handshakeData{ | ||
validated: false, |
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.
Should we set also set received
to true
or reuse the hsData
?
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.
no, at this point it hasn't sent or received any handshakes
noot: feat:dot/network: open block announce stream and send handshake on connect (#1467)
Changes
Tests
Issues