Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle reject renew offer if position gets resized #2558

Open
holzeis opened this issue May 21, 2024 · 0 comments
Open

Handle reject renew offer if position gets resized #2558

holzeis opened this issue May 21, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@holzeis
Copy link
Contributor

holzeis commented May 21, 2024

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. 
@holzeis holzeis added the bug Something isn't working label May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant