From cff3ae5f265f0eac4565dd378097904bf4add359 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Thu, 10 May 2018 10:35:39 -0400 Subject: [PATCH] Make channel_target return as channelmanager removes on shutdown --- fuzz/fuzz_targets/channel_target.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fuzz/fuzz_targets/channel_target.rs b/fuzz/fuzz_targets/channel_target.rs index 2c0da092e..3f680be4d 100644 --- a/fuzz/fuzz_targets/channel_target.rs +++ b/fuzz/fuzz_targets/channel_target.rs @@ -158,7 +158,7 @@ pub fn do_test(data: &[u8]) { macro_rules! return_err { ($expr: expr) => { match $expr { - Ok(_) => {}, + Ok(r) => r, Err(_) => return, } } @@ -278,10 +278,14 @@ pub fn do_test(data: &[u8]) { 9 => { let shutdown = decode_msg_with_len16!(msgs::Shutdown, 32, 1); return_err!(channel.shutdown(&fee_est, &shutdown)); + if channel.is_shutdown() { return; } }, 10 => { let closing_signed = decode_msg!(msgs::ClosingSigned, 32+8+64); - return_err!(channel.closing_signed(&fee_est, &closing_signed)); + if return_err!(channel.closing_signed(&fee_est, &closing_signed)).1.is_some() { + assert!(channel.is_shutdown()); + return; + } }, _ => return, } -- 2.39.5