Browse Source
Don't panic on unexpected messages
This is actually a security bug as it would allow remote triggers
of panics!
fix-olivia-event-id
Thomas Eizinger
3 years ago
No known key found for this signature in database
GPG Key ID: 651AC83A6C6C8B96
2 changed files with
6 additions and
4 deletions
-
daemon/src/maker_cfd.rs
-
daemon/src/taker_cfd.rs
|
@ -154,9 +154,9 @@ impl Actor { |
|
|
SetupState::Active { taker, .. } => { |
|
|
SetupState::Active { taker, .. } => { |
|
|
anyhow::bail!("Currently setting up contract with taker {}", taker) |
|
|
anyhow::bail!("Currently setting up contract with taker {}", taker) |
|
|
} |
|
|
} |
|
|
SetupState::None => unreachable!( |
|
|
SetupState::None => { |
|
|
"`SetupState` is guaranteed to be `Active` before anyone sends a message" |
|
|
anyhow::bail!("Received setup message without an active contract setup"); |
|
|
), |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
Ok(()) |
|
|
Ok(()) |
|
|
|
@ -220,7 +220,9 @@ impl Actor { |
|
|
SetupState::Active { sender } => { |
|
|
SetupState::Active { sender } => { |
|
|
sender.send(msg).await?; |
|
|
sender.send(msg).await?; |
|
|
} |
|
|
} |
|
|
SetupState::None => anyhow::bail!("OrderAccepted message should arrive first"), |
|
|
SetupState::None => { |
|
|
|
|
|
anyhow::bail!("Received setup message without an active contract setup") |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
Ok(()) |
|
|
Ok(()) |
|
|