Skip to content

Commit 543da42

Browse files
committed
f Force close after funding generation failed
1 parent a983cce commit 543da42

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/event.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ impl LdkEventHandler for LdkLiteEventHandler {
287287
}
288288
Err(err) => {
289289
log_error!(self.logger, "Failed to create funding transaction: {}", err);
290+
self.channel_manager.force_close_without_broadcasting_txn(temporary_channel_id, counterparty_node_id).expect("Failed to force close channel after funding generation failed");
290291
}
291292
}
292293
}
@@ -305,7 +306,7 @@ impl LdkEventHandler for LdkLiteEventHandler {
305306
(self.channel_manager.get_payment_preimage(*payment_hash, *payment_secret).ok(), *payment_secret)
306307
}
307308
}
308-
PaymentPurpose::SpontaneousPayment(preimage) => Some(*preimage),
309+
PaymentPurpose::SpontaneousPayment(preimage) => (Some(*preimage), None),
309310
};
310311
if let Some(preimage) = payment_preimage {
311312
self.channel_manager.claim_funds(preimage);

0 commit comments

Comments
 (0)