Support ignoring some errors, deserialize empty flags types
[rust-lightning] / src / ln / peer_handler.rs
index 7b140b0797284f04ca55d993b75a45f53be5069a..bccfe5a03b0256b365b6ad5f6d65ecbedf500db8 100644 (file)
@@ -272,16 +272,19 @@ impl<Descriptor: SocketDescriptor> PeerManager<Descriptor> {
                                                                        match $thing {
                                                                                Ok(x) => x,
                                                                                Err(e) => {
-                                                                                       // TODO: Log e.err
+                                                                                       println!("Got error handling message: {}!", e.err);
                                                                                        if let Some(action) = e.msg {
                                                                                                match action {
                                                                                                        msgs::ErrorAction::UpdateFailHTLC { msg } => {
                                                                                                                encode_and_send_msg!(msg, 131);
                                                                                                                continue;
                                                                                                        },
-                                                                                                       msgs::ErrorAction::DisconnectPeer {} => {
+                                                                                                       msgs::ErrorAction::DisconnectPeer => {
                                                                                                                return Err(PeerHandleError{ no_connection_possible: false });
                                                                                                        },
+                                                                                                       msgs::ErrorAction::IgnoreError => {
+                                                                                                               continue;
+                                                                                                       },
                                                                                                }
                                                                                        } else {
                                                                                                return Err(PeerHandleError{ no_connection_possible: false });
@@ -296,6 +299,7 @@ impl<Descriptor: SocketDescriptor> PeerManager<Descriptor> {
                                                                        match $thing {
                                                                                Ok(x) => x,
                                                                                Err(_e) => {
+                                                                                       println!("Error decoding message");
                                                                                        //TODO: Handle e?
                                                                                        return Err(PeerHandleError{ no_connection_possible: false });
                                                                                }