-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Network start/stop #1313
Network start/stop #1313
Conversation
/// 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); |
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.
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.
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.
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>; |
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 probably not be call NetSyncMessage
, but something more generic...
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.
Will do later, this requires refactoring anyway
looks pretty good. |
No description provided.