X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fln%2Fmsgs.rs;h=5939c09b164c4d67606b7806ef7e809c50c5334d;hb=374ea1f05e301b7f2c47781ad4f7a3ac5ac909fd;hp=e85f25ac78a23248690d520a586af5cb1cca9fb5;hpb=e2b1b1be78384ab7a5d63dd3ef5e54eb7eb6e662;p=rust-lightning diff --git a/src/ln/msgs.rs b/src/ln/msgs.rs index e85f25ac..5939c09b 100644 --- a/src/ln/msgs.rs +++ b/src/ln/msgs.rs @@ -357,6 +357,15 @@ pub struct HandleError { //TODO: rename me pub msg: Option, //TODO: Make this required and rename it } +/// Struct used to return values from revoke_and_ack messages, containing a bunch of commitment +/// transaction updates if they were pending. +pub struct CommitmentUpdate { + pub update_add_htlcs: Vec, + pub update_fulfill_htlcs: Vec, + pub update_fail_htlcs: Vec, + pub commitment_signed: CommitmentSigned, +} + /// 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. @@ -377,8 +386,8 @@ pub trait ChannelMessageHandler : events::EventsProvider { fn handle_update_fulfill_htlc(&self, their_node_id: &PublicKey, msg: &UpdateFulfillHTLC) -> Result<(), HandleError>; fn handle_update_fail_htlc(&self, their_node_id: &PublicKey, msg: &UpdateFailHTLC) -> Result<(), HandleError>; fn handle_update_fail_malformed_htlc(&self, their_node_id: &PublicKey, msg: &UpdateFailMalformedHTLC) -> Result<(), HandleError>; - fn handle_commitment_signed(&self, their_node_id: &PublicKey, msg: &CommitmentSigned) -> Result; - fn handle_revoke_and_ack(&self, their_node_id: &PublicKey, msg: &RevokeAndACK) -> Result, CommitmentSigned)>, HandleError>; + fn handle_commitment_signed(&self, their_node_id: &PublicKey, msg: &CommitmentSigned) -> Result<(RevokeAndACK, Option), HandleError>; + fn handle_revoke_and_ack(&self, their_node_id: &PublicKey, msg: &RevokeAndACK) -> Result, HandleError>; fn handle_update_fee(&self, their_node_id: &PublicKey, msg: &UpdateFee) -> Result<(), HandleError>;