X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fln%2Fmsgs.rs;h=3cdd4c77cb0efbd198b2c1ef782186e488088a6f;hb=f47ba769f544c4fd2e2d1aa0bd5b1fa74ae15daa;hp=3c56aa120ec43fb974c25c80c099411bd1f6c66e;hpb=deb23a930915d21c94c57ae5a885834083f3d6be;p=rust-lightning diff --git a/src/ln/msgs.rs b/src/ln/msgs.rs index 3c56aa12..3cdd4c77 100644 --- a/src/ln/msgs.rs +++ b/src/ln/msgs.rs @@ -205,12 +205,14 @@ pub struct UpdateFulfillHTLC { pub payment_preimage: [u8; 32], } +#[derive(Clone)] pub struct UpdateFailHTLC { pub channel_id: Uint256, pub htlc_id: u64, pub reason: OnionErrorPacket, } +#[derive(Clone)] pub struct UpdateFailMalformedHTLC { pub channel_id: Uint256, pub htlc_id: u64, @@ -337,6 +339,9 @@ pub struct HandleError { //TODO: rename me pub msg: Option, //TODO: Move into an Action enum and require it! } +/// A trait to describe an object which can receive channel messages. Messages MAY be called in +/// paralell when they originate from different their_node_ids, however they MUST NOT be called in +/// paralell when the two calls have the same their_node_id. pub trait ChannelMessageHandler : events::EventsProvider { //Channel init: fn handle_open_channel(&self, their_node_id: &PublicKey, msg: &OpenChannel) -> Result; @@ -399,6 +404,7 @@ pub struct DecodedOnionErrorPacket { pub pad: Vec, } +#[derive(Clone)] pub struct OnionErrorPacket { // This really should be a constant size slice, but the spec lets these things be up to 128KB? // (TODO) We limit it in decode to much lower...