Skip to content

Commit

Permalink
fix: Set position to open if a rollover is rejected
Browse files Browse the repository at this point in the history
Otherwise the position is stuck in `Rollover` and won't get recovered.
  • Loading branch information
holzeis committed May 21, 2024
1 parent 63d275c commit c6b5237
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion coordinator/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -481,9 +481,14 @@ impl Node {
"DLC Channel settle offer has been rejected. Setting position to back to open."
);

db::positions::Position::update_closing_position(
db::positions::Position::update_position_state(
&mut connection,
node_id.to_string(),
vec![
// the closing price doesn't matter here.
PositionState::Closing { closing_price: 0.0 },
PositionState::Rollover,
],
PositionState::Open,
)?;
}
Expand Down

0 comments on commit c6b5237

Please sign in to comment.