-
Notifications
You must be signed in to change notification settings - Fork 54
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
wire: make all nodes reply to user requests #399
base: master
Are you sure you want to change the base?
wire: make all nodes reply to user requests #399
Conversation
Until now, only the running_node could reply to user request. However, that's cumbersome and limiting. After this commit, both sync_node and chain_selector can handle user requests made from the handle.
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.
A good opportunity to add docs for these functions.
Here some suggestions to see if my intuition about them are right.
Ill be locally testing them.
} | ||
} | ||
|
||
pub(crate) async fn check_is_user_block_and_reply( |
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.
/// Check if this block request is made by a user through the user interface and answer it back to the
/// user if so.
///
/// This function will return the given block if isnt.
); | ||
} | ||
|
||
async fn perform_user_request(&mut self, user_req: Vec<UserRequest>) { |
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 function executes user requests pacing it against inflights requests.
Ok(()) | ||
} | ||
|
||
fn handle_get_peer_info(&self) { |
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.
/// Executes all getpeerinfo
user requests.
self.user_requests.clone() | ||
} | ||
|
||
pub(crate) async fn handle_user_request(&mut self) -> Result<(), WireError> { |
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.
/// Wrapper/Helper function that iterate over all user_requests
and pass it to perform_user_request
.
What is the purpose of this pull request?
Which crates are being modified?
Description
Until now, only the running_node could reply to user request. However, that's cumbersome and limiting. After this commit, both sync_node and chain_selector can handle user requests made from the handle.
Checklist
just lint
cargo test