-
Notifications
You must be signed in to change notification settings - Fork 291
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
ONT-776 decoupling peer id with wallet public key #332
Conversation
Version: n.GetVersion(), | ||
Services: n.GetServices(), | ||
SyncPort: n.GetSyncPort(), | ||
ConsPort: n.GetConsPort(), | ||
Nonce: n.GetID(), | ||
IsConsensus: isCons, | ||
HttpInfoPort: n.GetHttpInfoPort(), | ||
StartHeight: uint64(height), | ||
UserAgent: 0x00, | ||
TimeStamp: uint32(time.Now().UTC().UnixNano()), |
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.
UnixNano
? 1 second = 10^9 Nanosecond. so cast it to uint32 will get a value more like a random number.
p2pserver/peer/peer.go
Outdated
//parseIPAddr return ip address | ||
func parseIPAddr(s string) (string, error) { | ||
//ParseIPAddr return ip address | ||
func (this *Peer) ParseIPAddr(s string) (string, error) { |
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.
this method has nothing to do with Peer, make it a free helper function for easier review.
} | ||
ipNew, err := p.ParseIPAddr(data.Addr) | ||
if err != nil { | ||
log.Error(err) |
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.
close the connection
…onnection Signed-off-by: Xiang Fu <fuxiang@onchain.com>
Signed-off-by: Xiang Fu <fuxiang@onchain.com>
Also add logic to deny forge id connection
Signed-off-by: Xiang Fu fuxiang@onchain.com