File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,10 @@ impl PaymentDetails {
8585 PaymentDirection :: Outbound ,
8686 "We should only ever override payment hash for outbound BOLT 12 payments"
8787 ) ;
88+ debug_assert ! (
89+ hash. is_none( ) || * hash == hash_opt,
90+ "We should never change a payment hash after being initially set"
91+ ) ;
8892 update_if_necessary ! ( * hash, hash_opt) ;
8993 } ,
9094 PaymentKind :: Bolt12Refund { ref mut hash, .. } => {
@@ -93,6 +97,10 @@ impl PaymentDetails {
9397 PaymentDirection :: Outbound ,
9498 "We should only ever override payment hash for outbound BOLT 12 payments"
9599 ) ;
100+ debug_assert ! (
101+ hash. is_none( ) || * hash == hash_opt,
102+ "We should never change a payment hash after being initially set"
103+ ) ;
96104 update_if_necessary ! ( * hash, hash_opt) ;
97105 } ,
98106 _ => {
You can’t perform that action at this time.
0 commit comments