File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -344,8 +344,16 @@ where
344344 if let Some ( payment) = locked_payments. get_mut ( & update. id ) {
345345 if let Some ( hash_opt) = update. hash {
346346 match payment. kind {
347- PaymentKind :: Bolt12Offer { ref mut hash, .. } => * hash = hash_opt,
348- PaymentKind :: Bolt12Refund { ref mut hash, .. } => * hash = hash_opt,
347+ PaymentKind :: Bolt12Offer { ref mut hash, .. } => {
348+ debug_assert_eq ! ( payment. direction, PaymentDirection :: Outbound ,
349+ "We should only ever override payment hash for outbound BOLT 12 payments" ) ;
350+ * hash = hash_opt
351+ } ,
352+ PaymentKind :: Bolt12Refund { ref mut hash, .. } => {
353+ debug_assert_eq ! ( payment. direction, PaymentDirection :: Outbound ,
354+ "We should only ever override payment hash for outbound BOLT 12 payments" ) ;
355+ * hash = hash_opt
356+ } ,
349357 _ => { } ,
350358 }
351359 }
@@ -381,7 +389,6 @@ where
381389 self . persist_info ( & update. id , payment) ?;
382390 updated = true ;
383391 }
384-
385392 Ok ( updated)
386393 }
387394
You can’t perform that action at this time.
0 commit comments