Browse Source

Transition `PendingOpen` to `PendingOpen` upon attestation

In a real-world scenario this should actually never happen, but it is still weird to see `PendingOpen` jump to `Open` when testing with timelocks and attestations.
Since this is "more correct" we distinguish fine-granular.

Co-authored-by: Lucas <lucas@comit.network>
refactor/no-log-handler
Daniel Karzel 3 years ago
parent
commit
39c73f3d63
No known key found for this signature in database GPG Key ID: 30C3FC2E438ADB6E
  1. 9
      daemon/src/model/cfd.rs

9
daemon/src/model/cfd.rs

@ -741,7 +741,14 @@ impl Cfd {
}
}
CfdStateChangeEvent::OracleAttestation(attestation) => match self.state.clone() {
CfdState::PendingOpen { dlc, .. } | CfdState::Open { dlc, .. } => CfdState::Open {
CfdState::PendingOpen { dlc, .. } => CfdState::PendingOpen {
common: CfdStateCommon {
transition_timestamp: SystemTime::now(),
},
dlc,
attestation: Some(attestation),
},
CfdState::Open { dlc, .. } => CfdState::Open {
common: CfdStateCommon {
transition_timestamp: SystemTime::now(),
},

Loading…
Cancel
Save