Skip to content

CloseChannel should trigger fallback for aggregated tProxy #140

@plebhash

Description

@plebhash

async fn handle_close_channel(
&mut self,
_server_id: Option<usize>,
m: CloseChannel<'_>,
_tlv_fields: Option<&[Tlv]>,
) -> Result<(), Self::Error> {
info!("Received: {}", m);
_ = self.channel_manager_data.safe_lock(|channel_data_manager| {
if channel_data_manager.mode == ChannelMode::Aggregated {
if channel_data_manager.upstream_extended_channel.is_some() {
channel_data_manager.upstream_extended_channel = None;
}
} else {
channel_data_manager.extended_channels.remove(&m.channel_id);
}
});
Ok(())
}

it makes no sense to simply set channel_data_manager.upstream_extended_channel = None and continue business as usual

if the only channel that was enabling mining on this connection was closed, there's no point in continuing operation

we should trigger fallback and start working for a different server

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions