Fix a minor memory leak on PermanentFailure mon errs when sending 2021-10-no-payment-id-leaks
authorMatt Corallo <git@bluematt.me>
Tue, 26 Oct 2021 21:40:14 +0000 (21:40 +0000)
committerMatt Corallo <git@bluematt.me>
Thu, 11 Nov 2021 20:38:58 +0000 (20:38 +0000)
commit0ec13f611bbbee831e37416f052c97d924b23ec0
tree56d1bd9356f5aca04d3feace46457330b2a38348
parent6f002ea93ab1edf4b6dcf05a9e45580745d97669
Fix a minor memory leak on PermanentFailure mon errs when sending

If we send a payment and fail to update the first-hop channel state
with a `PermanentFailure` ChannelMonitorUpdateErr, we would have an
entry in our pending payments map, but possibly not return the
PaymentId back to the user to retry the payment, leading to a (rare
and relatively minor) memory leak.
lightning/src/ln/channelmanager.rs