X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fln%2Fmsgs.rs;h=c3b997566c81ce1b165e166458f641712cd867bc;hb=4f77c812a4b0e42454cb92b8b460dfa1323016cb;hp=7f502530a9db55f5177aad787380645d8d72fcf0;hpb=fe9bb1d97028d1c0c98972809d12e7129d18356d;p=rust-lightning diff --git a/src/ln/msgs.rs b/src/ln/msgs.rs index 7f502530..c3b99756 100644 --- a/src/ln/msgs.rs +++ b/src/ln/msgs.rs @@ -376,11 +376,6 @@ pub struct ChannelUpdate { /// Used to put an error message in a HandleError pub enum ErrorAction { - /// Indicates an inbound HTLC add resulted in a failure, and the UpdateFailHTLC provided in msg - /// should be sent back to the sender. - UpdateFailHTLC { - msg: UpdateFailHTLC - }, /// The peer took some action which made us think they were useless. Disconnect them. DisconnectPeer { msg: Option @@ -937,7 +932,7 @@ impl MsgDecodable for UpdateAddHTLC { } impl MsgEncodable for UpdateAddHTLC { fn encode(&self) -> Vec { - let mut res = Vec::with_capacity(32+8+8+32+4+1+1366); + let mut res = Vec::with_capacity(32+8+8+32+4+1366); res.extend_from_slice(&self.channel_id); res.extend_from_slice(&byte_utils::be64_to_array(self.htlc_id)); res.extend_from_slice(&byte_utils::be64_to_array(self.amount_msat)); @@ -1648,7 +1643,7 @@ impl MsgDecodable for ErrorMessage { #[cfg(test)] mod tests { - use bitcoin::util::misc::hex_bytes; + use hex; use ln::msgs::MsgEncodable; use ln::msgs; use secp256k1::key::{PublicKey,SecretKey}; @@ -1658,7 +1653,7 @@ mod tests { fn encoding_channel_reestablish_no_secret() { let public_key = { let secp_ctx = Secp256k1::new(); - PublicKey::from_secret_key(&secp_ctx, &SecretKey::from_slice(&secp_ctx, &hex_bytes("0101010101010101010101010101010101010101010101010101010101010101").unwrap()[..]).unwrap()).unwrap() + PublicKey::from_secret_key(&secp_ctx, &SecretKey::from_slice(&secp_ctx, &hex::decode("0101010101010101010101010101010101010101010101010101010101010101").unwrap()[..]).unwrap()) }; let cr = msgs::ChannelReestablish { @@ -1680,7 +1675,7 @@ mod tests { fn encoding_channel_reestablish_with_secret() { let public_key = { let secp_ctx = Secp256k1::new(); - PublicKey::from_secret_key(&secp_ctx, &SecretKey::from_slice(&secp_ctx, &hex_bytes("0101010101010101010101010101010101010101010101010101010101010101").unwrap()[..]).unwrap()).unwrap() + PublicKey::from_secret_key(&secp_ctx, &SecretKey::from_slice(&secp_ctx, &hex::decode("0101010101010101010101010101010101010101010101010101010101010101").unwrap()[..]).unwrap()) }; let cr = msgs::ChannelReestablish {