From 673912e7695be6b2cbfe03c38ddd37cb1b5a4655 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Thu, 6 Sep 2018 17:23:09 -0400 Subject: [PATCH] Add force_close_channel call command to full_stack_target --- fuzz/fuzz_targets/full_stack_target.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fuzz/fuzz_targets/full_stack_target.rs b/fuzz/fuzz_targets/full_stack_target.rs index ced754acb..42e7f2ea1 100644 --- a/fuzz/fuzz_targets/full_stack_target.rs +++ b/fuzz/fuzz_targets/full_stack_target.rs @@ -403,6 +403,13 @@ pub fn do_test(data: &[u8], logger: &Arc) { 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(); -- 2.39.5