Skip to content
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

Merged
merged 2 commits into from
Jun 14, 2018

Conversation

BooniesFX
Copy link

Also add logic to deny forge id connection

Signed-off-by: Xiang Fu fuxiang@onchain.com

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()),
Copy link
Contributor

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.

//parseIPAddr return ip address
func parseIPAddr(s string) (string, error) {
//ParseIPAddr return ip address
func (this *Peer) ParseIPAddr(s string) (string, error) {
Copy link
Contributor

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

close the connection

Xiang Fu added 2 commits June 13, 2018 16:33
…onnection

Signed-off-by: Xiang Fu <fuxiang@onchain.com>
Signed-off-by: Xiang Fu <fuxiang@onchain.com>
@laizy laizy merged commit e975aec into ontio:master Jun 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants