]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Add force_close_channel call command to full_stack_target
authorMatt Corallo <git@bluematt.me>
Thu, 6 Sep 2018 21:23:09 +0000 (17:23 -0400)
committerMatt Corallo <git@bluematt.me>
Sun, 9 Sep 2018 15:36:00 +0000 (11:36 -0400)
fuzz/fuzz_targets/full_stack_target.rs

index ced754acb514d58acc5fc9c628c8db276088e7f8..42e7f2ea14a0087931623f493061f15cdfd748c6 100644 (file)
@@ -403,6 +403,13 @@ pub fn do_test(data: &[u8], logger: &Arc<Logger>) {
                        13 => {
                                loss_detector.disconnect_block();
                        },
+                       14 => {
+                               let mut channels = channelmanager.list_channels();
+                               let channel_id = get_slice!(1)[0] as usize;
+                               if channel_id >= channels.len() { return; }
+                               channels.sort_by(|a, b| { a.channel_id.cmp(&b.channel_id) });
+                               channelmanager.force_close_channel(&channels[channel_id].channel_id);
+                       },
                        _ => return,
                }
                loss_detector.handler.process_events();