Skip to content
This repository has been archived by the owner on Jun 25, 2021. It is now read-only.

Commit

Permalink
fix: forward ResurceChallenge to the bootstrap task
Browse files Browse the repository at this point in the history
  • Loading branch information
madadam authored and dirvine committed Dec 9, 2020
1 parent 667e1fb commit 2552f06
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/routing/approved.rs
Original file line number Diff line number Diff line change
Expand Up @@ -478,16 +478,13 @@ impl Approved {
}
}
}
Variant::ResourceChallenge { .. } => {
// Already approved, no need to resolve challenge.
return Ok(MessageStatus::Useless);
}
Variant::Sync { .. }
| Variant::Relocate(_)
| Variant::BootstrapRequest(_)
| Variant::BouncedUntrustedMessage(_)
| Variant::BouncedUnknownMessage { .. }
| Variant::DKGMessage { .. } => {}
| Variant::DKGMessage { .. }
| Variant::ResourceChallenge { .. } => {}
}

if self.verify_message(msg)? {
Expand Down Expand Up @@ -579,7 +576,9 @@ impl Approved {
commands.extend(result?);
Ok(commands)
}
Variant::NodeApproval(_) | Variant::BootstrapResponse(_) => {
Variant::NodeApproval(_)
| Variant::BootstrapResponse(_)
| Variant::ResourceChallenge { .. } => {
if let Some(RelocateState::InProgress(message_tx)) = &mut self.relocate_state {
if let Some(sender) = sender {
trace!("Forwarding {:?} to the bootstrap task", msg);
Expand All @@ -591,10 +590,6 @@ impl Approved {

Ok(vec![])
}
Variant::ResourceChallenge { .. } => {
trace!("Already got approved to join, no need to resolve challenge");
Ok(vec![])
}
}
}

Expand Down

0 comments on commit 2552f06

Please sign in to comment.