Fix double-locking in channelmanager 2018-03-fixups
authorMatt Corallo <git@bluematt.me>
Sun, 25 Mar 2018 19:48:41 +0000 (15:48 -0400)
committerMatt Corallo <git@bluematt.me>
Sun, 25 Mar 2018 21:02:28 +0000 (17:02 -0400)
src/ln/channelmanager.rs

index d7bd9ff9d6e621477d679355c853b8ca11375fd9..ff6f924c61f5c18b3cd3bae946ce3f005c781ddf 100644 (file)
@@ -772,6 +772,7 @@ impl ChannelManager {
                                if from_user {
                                        panic!("Called claim_funds with a preimage for an outgoing payment. There is nothing we can do with this, and something is seriously wrong if you knew this...");
                                }
+                               mem::drop(channel_state);
                                let mut pending_events = self.pending_events.lock().unwrap();
                                pending_events.push(events::Event::PaymentSent {
                                        payment_preimage
@@ -795,6 +796,7 @@ impl ChannelManager {
                                        }
                                };
 
+                               mem::drop(channel_state);
                                let mut pending_events = self.pending_events.lock().unwrap();
                                pending_events.push(events::Event::SendFulfillHTLC {
                                        node_id: node_id,