projects
/
rust-lightning
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fail incoming HTLCs sent after we start shutdown, not the chan
[rust-lightning]
/
src
/
ln
/
channel.rs
diff --git
a/src/ln/channel.rs
b/src/ln/channel.rs
index 9d58caf9a1450aff9847be6946c073b96bee0cb4..e0768e37cc1a67553ed94d3b3740dc42ab96e36a 100644
(file)
--- a/
src/ln/channel.rs
+++ b/
src/ln/channel.rs
@@
-1553,6
+1553,12
@@
impl Channel {
//TODO: Check msg.cltv_expiry further? Do this in channel manager?
//TODO: Check msg.cltv_expiry further? Do this in channel manager?
+ if self.channel_state & ChannelState::LocalShutdownSent as u32 != 0 {
+ if let PendingHTLCStatus::Forward(_) = pending_forward_state {
+ panic!("ChannelManager shouldn't be trying to add a forwardable HTLC after we've started closing");
+ }
+ }
+
// Now update local state:
self.next_remote_htlc_id += 1;
self.pending_inbound_htlcs.push(InboundHTLCOutput {
// Now update local state:
self.next_remote_htlc_id += 1;
self.pending_inbound_htlcs.push(InboundHTLCOutput {