projects
/
rust-lightning
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7a04595
)
Add simple utility to ChannelManager to force close all channels
author
Matt Corallo
<git@bluematt.me>
Tue, 14 Aug 2018 14:43:34 +0000
(10:43 -0400)
committer
Matt Corallo
<git@bluematt.me>
Mon, 20 Aug 2018 17:58:31 +0000
(13:58 -0400)
src/ln/channelmanager.rs
patch
|
blob
|
history
diff --git
a/src/ln/channelmanager.rs
b/src/ln/channelmanager.rs
index d273be52b8fcc43b4b8a17ddccc3c3a724b61c36..c884f8a1adb9bec87afcd301d170afe0729268d9 100644
(file)
--- a/
src/ln/channelmanager.rs
+++ b/
src/ln/channelmanager.rs
@@
-415,6
+415,14
@@
impl ChannelManager {
}
}
+ /// Force close all channels, immediately broadcasting the latest local commitment transaction
+ /// for each to the chain and rejecting new HTLCs on each.
+ pub fn force_close_all_channels(&self) {
+ for chan in self.list_channels() {
+ self.force_close_channel(&chan.channel_id);
+ }
+ }
+
#[inline]
fn gen_rho_mu_from_shared_secret(shared_secret: &SharedSecret) -> ([u8; 32], [u8; 32]) {
({