Skip to content

Commit

Permalink
Merge pull request #131 from chenyukang/yukang-fix-shutdown-trivial-i…
Browse files Browse the repository at this point in the history
…ssue

Do not update channel status before error
  • Loading branch information
quake authored Jul 11, 2024
2 parents 5167a03 + 5c578f5 commit 6a4931c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ckb/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2807,13 +2807,11 @@ impl ChannelActorState {

match self.remote_shutdown_signature {
Some(remote_shutdown_signature) => {
self.update_state(ChannelState::Closed);
let tx = self.aggregate_partial_signatures_to_consume_funding_cell(
[local_shutdown_signature, remote_shutdown_signature],
u64::MAX,
&shutdown_tx,
)?;

assert_eq!(
tx.data().serialized_size_in_block(),
commitment_tx_size(
Expand All @@ -2825,6 +2823,8 @@ impl ChannelActorState {
)
);

self.update_state(ChannelState::Closed);

network
.send_message(NetworkActorMessage::new_event(
NetworkActorEvent::ClosingTransactionPending(
Expand Down

0 comments on commit 6a4931c

Please sign in to comment.