From: Matt Corallo Date: Thu, 10 May 2018 14:35:39 +0000 (-0400) Subject: Make channel_target return as channelmanager removes on shutdown X-Git-Tag: v0.0.12~408^2 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=cff3ae5f265f0eac4565dd378097904bf4add359;p=rust-lightning Make channel_target return as channelmanager removes on shutdown --- 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, }