From: Matt Corallo Date: Thu, 6 Sep 2018 21:23:09 +0000 (-0400) Subject: Add force_close_channel call command to full_stack_target X-Git-Tag: v0.0.12~318^2~3 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=673912e7695be6b2cbfe03c38ddd37cb1b5a4655;p=rust-lightning Add force_close_channel call command to full_stack_target --- 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();