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
344
344
if let Some ( payment) = locked_payments. get_mut ( & update. id ) {
345
345
if let Some ( hash_opt) = update. hash {
346
346
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
+ } ,
349
357
_ => { } ,
350
358
}
351
359
}
@@ -381,7 +389,6 @@ where
381
389
self . persist_info ( & update. id , payment) ?;
382
390
updated = true ;
383
391
}
384
-
385
392
Ok ( updated)
386
393
}
387
394
You can’t perform that action at this time.
0 commit comments