Skip to content

Commit

Permalink
Farcasterd: Check if walletd is running before restoring checkpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCharlatan committed Jun 26, 2022
1 parent 91756f6 commit b6b1b30
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/farcasterd/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -896,14 +896,22 @@ impl Runtime {
}

Request::RestoreCheckpoint(swap_id) => {
if self.running_swaps.contains(&swap_id) {
if endpoints
.send_to(
ServiceBus::Msg,
ServiceId::Farcasterd,
ServiceId::Wallet,
Request::Hello,
)
.is_err()
{
endpoints.send_to(
ServiceBus::Ctl,
ServiceId::Farcasterd,
source,
Request::Failure(Failure {
code: 1,
info: "Cannot restore an already running swap".to_string(),
info: "Cannot restore a swap when walletd is not running".to_string(),
}),
)?;
return Ok(());
Expand Down

0 comments on commit b6b1b30

Please sign in to comment.