Skip to content

Commit

Permalink
fix invoice status
Browse files Browse the repository at this point in the history
  • Loading branch information
chenyukang committed Dec 5, 2024
1 parent 5c9888b commit fde81fd
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/fiber/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,8 @@ where
.apply_remove_tlc_operation(state, remove_tlc)
.await
.map_err(|e| {
error!("Error handling RemoveTlc command: {:?}", e);
debug!("error happened in apply_remove_tlc_operation: {:?}", e);
error!("Error handling apply_remove_tlc_operation: {:?}", e);
});
}
}
Expand Down Expand Up @@ -740,10 +741,18 @@ where
CkbInvoiceStatus::Paid => {
unreachable!("Paid invoice shold not be paid again");
}
_ => {}
_ => {
self.store
.update_invoice_status(&tlc.payment_hash, CkbInvoiceStatus::Paid)
.expect("update invoice status error");
}
}
}

debug!(
"register remove reason: {:?} with reason: {:?}",
tlc.tlc_id, remove_reason
);
self.register_tlc_remove(state, tlc.tlc_id, remove_reason);
}

Expand Down Expand Up @@ -4125,6 +4134,7 @@ impl ChannelActorState {
self.to_remote_amount = to_remote_amount;
debug!("Updated local balance to {} and remote balance to {} by removing tlc {:?} with reason {:?}",
to_local_amount, to_remote_amount, tlc_id, reason);

self.tlc_state
.apply_tlc_remove(tlc_id, removed_at, reason.clone());
current
Expand Down

0 comments on commit fde81fd

Please sign in to comment.