diff --git a/protocols/v2/roles-logic-sv2/src/channel_logic/channel_factory.rs b/protocols/v2/roles-logic-sv2/src/channel_logic/channel_factory.rs index 22a05c9dc..60c3298c9 100644 --- a/protocols/v2/roles-logic-sv2/src/channel_logic/channel_factory.rs +++ b/protocols/v2/roles-logic-sv2/src/channel_logic/channel_factory.rs @@ -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 { + 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 diff --git a/roles/translator/src/error.rs b/roles/translator/src/error.rs index 73652bdc7..35049265f 100644 --- a/roles/translator/src/error.rs +++ b/roles/translator/src/error.rs @@ -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> { @@ -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) } diff --git a/roles/translator/src/status.rs b/roles/translator/src/status.rs index c297f6591..4d1c677e4 100644 --- a/roles/translator/src/status.rs +++ b/roles/translator/src/status.rs @@ -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 - } } }