Skip to content

Commit

Permalink
Add update downstream target for pool channel factory
Browse files Browse the repository at this point in the history
  • Loading branch information
UnidenifiedUser committed Nov 26, 2023
1 parent 88d4ad9 commit 631887c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1285,6 +1285,15 @@ impl PoolChannelFactory {
pub fn update_channel(&mut self, m: &UpdateChannel) -> Result<(), Error> {
self.inner.update_channel(m)
}

/// calls [`ChannelFactory::update_target_for_channel`]
pub fn update_target_for_channel(
&mut self,
channel_id: u32,
new_target: Target,
) -> Option<bool> {
self.inner.update_target_for_channel(channel_id, new_target)
}
}

/// Used by proxies that want to open extended channls with upstream. If the proxy has job
Expand Down
4 changes: 0 additions & 4 deletions roles/translator/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ pub enum Error<'a> {
// used to handle SV2 protocol error messages from pool
Sv2ProtocolError(Mining<'a>),
TargetError(roles_logic_sv2::errors::Error),
HashrateError(roles_logic_sv2::errors::Error),
}

impl<'a> fmt::Display for Error<'a> {
Expand Down Expand Up @@ -115,9 +114,6 @@ impl<'a> fmt::Display for Error<'a> {
Sv2ProtocolError(ref e) => {
write!(f, "Received Sv2 Protocol Error from upstream: `{:?}`", e)
}
HashrateError(ref e) => {
write!(f, "Impossible to get hashrate from target: `{:?}`", e)
}
TargetError(ref e) => {
write!(f, "Impossible to get target from hashrate: `{:?}`", e)
}
Expand Down
3 changes: 0 additions & 3 deletions roles/translator/src/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,5 @@ pub async fn handle_error(
Error::TargetError(_) => {
send_status(sender, e, error_handling::ErrorBranch::Continue).await
}
Error::HashrateError(_) => {
send_status(sender, e, error_handling::ErrorBranch::Continue).await
}
}
}

0 comments on commit 631887c

Please sign in to comment.