Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Network start/stop #1313

Merged
merged 5 commits into from Jun 18, 2016
Merged

Network start/stop #1313

merged 5 commits into from Jun 18, 2016

Conversation

arkpar
Copy link
Collaborator

@arkpar arkpar commented Jun 17, 2016

No description provided.

@arkpar arkpar added the A0-pleasereview 🤓 Pull request needs code review. label Jun 17, 2016
/// Should be used to convert object to io delegate.
fn to_delegate(self) -> IoDelegate<Self> {
let mut delegate = IoDelegate::new(Arc::new(self));
delegate.add_method("net_version", Net::version);
delegate.add_method("net_peerCount", Net::peer_count);
delegate.add_method("net_listening", Net::is_listening);
delegate.add_method("net_start", Net::start_network);
Copy link
Collaborator

Choose a reason for hiding this comment

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

It will be possible to enable/disable network for a potential attacker (browsing malicious website with Flash enabled) are we ok with that?

If not we should put the API to separate trait, in future it could require confirmation using Trusted Signer.

Copy link
Contributor

Choose a reason for hiding this comment

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

agree - there's no need to have these as RPC functions right now.

/// Start network command.
StartNetwork,
/// Stop network command.
StopNetwork,
}

/// IO Message type used for Network service
pub type NetSyncMessage = NetworkIoMessage<SyncMessage>;
Copy link
Contributor

Choose a reason for hiding this comment

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

Should probably not be call NetSyncMessage, but something more generic...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Will do later, this requires refactoring anyway

@gavofyork
Copy link
Contributor

looks pretty good.

@gavofyork gavofyork added A6-mustntgrumble 💦 Pull request has areas for improvement. The author need not address them before merging. and removed A0-pleasereview 🤓 Pull request needs code review. labels Jun 18, 2016
@arkpar arkpar merged commit 591fa96 into master Jun 18, 2016
@debris debris deleted the net branch June 20, 2016 15:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A6-mustntgrumble 💦 Pull request has areas for improvement. The author need not address them before merging.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants