Make channel_target return as channelmanager removes on shutdown

This commit is contained in:
Matt Corallo 2018-05-10 10:35:39 -04:00
parent 22342134ef
commit cff3ae5f26

View file

@ -158,7 +158,7 @@ pub fn do_test(data: &[u8]) {
macro_rules! return_err { macro_rules! return_err {
($expr: expr) => { ($expr: expr) => {
match $expr { match $expr {
Ok(_) => {}, Ok(r) => r,
Err(_) => return, Err(_) => return,
} }
} }
@ -278,10 +278,14 @@ pub fn do_test(data: &[u8]) {
9 => { 9 => {
let shutdown = decode_msg_with_len16!(msgs::Shutdown, 32, 1); let shutdown = decode_msg_with_len16!(msgs::Shutdown, 32, 1);
return_err!(channel.shutdown(&fee_est, &shutdown)); return_err!(channel.shutdown(&fee_est, &shutdown));
if channel.is_shutdown() { return; }
}, },
10 => { 10 => {
let closing_signed = decode_msg!(msgs::ClosingSigned, 32+8+64); 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, _ => return,
} }