Skip to content

Handle reject renew offer if position gets resized #2558

@holzeis

Description

@holzeis

If a renew offer gets rejected, e.g. because the app was closed before the RenewOffer was successfully processed, the coordinator can't correctly process the reject at the moment.

Channel::Signed(SignedChannel {
state: SignedChannelState::Established { .. },
..
}) => {
// TODO(holzeis): Reverting the position state back from `Closing`
// to `Open` only works as long as we do not support resizing. This
// logic needs to be adapted when we implement resize.
tracing::info!(
channel_id = channel_id_hex_string,
node_id = node_id.to_string(),
"DLC Channel settle offer has been rejected. Setting position to back to open."
);
db::positions::Position::update_closing_position(
&mut connection,
node_id.to_string(),
PositionState::Open,
)?;
}

For one the position state wouldn't get updated correctly. Fixing that isn't too hard, but then you run into the following issue, which seems to be a bit more complicated.

Failed to resize position 18: Could not propose resize DLC channel update: Invalid parameters were provided: Sum of collaterals in contract must equal total collateral in channel. 

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions