@@ -62,6 +62,13 @@ pub(crate) enum PendingOutboundPayment {
62
62
// used anywhere.
63
63
max_total_routing_fee_msat : Option < u64 > ,
64
64
} ,
65
+ StaticInvoiceReceived {
66
+ payment_hash : PaymentHash ,
67
+ keysend_preimage : PaymentPreimage ,
68
+ retry_strategy : Retry ,
69
+ payment_release_secret : [ u8 ; 32 ] ,
70
+ route_params : RouteParameters ,
71
+ } ,
65
72
Retryable {
66
73
retry_strategy : Option < Retry > ,
67
74
attempts : PaymentAttempts ,
@@ -168,6 +175,7 @@ impl PendingOutboundPayment {
168
175
PendingOutboundPayment :: Legacy { .. } => None ,
169
176
PendingOutboundPayment :: AwaitingInvoice { .. } => None ,
170
177
PendingOutboundPayment :: InvoiceReceived { payment_hash, .. } => Some ( * payment_hash) ,
178
+ PendingOutboundPayment :: StaticInvoiceReceived { payment_hash, .. } => Some ( * payment_hash) ,
171
179
PendingOutboundPayment :: Retryable { payment_hash, .. } => Some ( * payment_hash) ,
172
180
PendingOutboundPayment :: Fulfilled { payment_hash, .. } => * payment_hash,
173
181
PendingOutboundPayment :: Abandoned { payment_hash, .. } => Some ( * payment_hash) ,
@@ -182,7 +190,8 @@ impl PendingOutboundPayment {
182
190
PendingOutboundPayment :: Fulfilled { session_privs, .. } |
183
191
PendingOutboundPayment :: Abandoned { session_privs, .. } => session_privs,
184
192
PendingOutboundPayment :: AwaitingInvoice { .. } |
185
- PendingOutboundPayment :: InvoiceReceived { .. } => { debug_assert ! ( false ) ; return ; } ,
193
+ PendingOutboundPayment :: InvoiceReceived { .. } |
194
+ PendingOutboundPayment :: StaticInvoiceReceived { .. } => { debug_assert ! ( false ) ; return ; } ,
186
195
} ) ;
187
196
let payment_hash = self . payment_hash ( ) ;
188
197
* self = PendingOutboundPayment :: Fulfilled { session_privs, payment_hash, timer_ticks_without_htlcs : 0 } ;
@@ -216,7 +225,8 @@ impl PendingOutboundPayment {
216
225
session_privs. remove ( session_priv)
217
226
} ,
218
227
PendingOutboundPayment :: AwaitingInvoice { .. } |
219
- PendingOutboundPayment :: InvoiceReceived { .. } => { debug_assert ! ( false ) ; false } ,
228
+ PendingOutboundPayment :: InvoiceReceived { .. } |
229
+ PendingOutboundPayment :: StaticInvoiceReceived { .. } => { debug_assert ! ( false ) ; false } ,
220
230
} ;
221
231
if remove_res {
222
232
if let PendingOutboundPayment :: Retryable {
@@ -245,7 +255,8 @@ impl PendingOutboundPayment {
245
255
session_privs. insert ( session_priv)
246
256
} ,
247
257
PendingOutboundPayment :: AwaitingInvoice { .. } |
248
- PendingOutboundPayment :: InvoiceReceived { .. } => { debug_assert ! ( false ) ; false } ,
258
+ PendingOutboundPayment :: InvoiceReceived { .. } |
259
+ PendingOutboundPayment :: StaticInvoiceReceived { .. } => { debug_assert ! ( false ) ; false } ,
249
260
PendingOutboundPayment :: Fulfilled { .. } => false ,
250
261
PendingOutboundPayment :: Abandoned { .. } => false ,
251
262
} ;
@@ -278,6 +289,7 @@ impl PendingOutboundPayment {
278
289
} ,
279
290
PendingOutboundPayment :: AwaitingInvoice { .. } => 0 ,
280
291
PendingOutboundPayment :: InvoiceReceived { .. } => 0 ,
292
+ PendingOutboundPayment :: StaticInvoiceReceived { .. } => 0 ,
281
293
}
282
294
}
283
295
}
@@ -1094,6 +1106,7 @@ impl OutboundPayments {
1094
1106
* payment. into_mut ( ) = retryable_payment;
1095
1107
( total_amount, recipient_onion, None , onion_session_privs)
1096
1108
} ,
1109
+ PendingOutboundPayment :: StaticInvoiceReceived { .. } => todo ! ( ) ,
1097
1110
PendingOutboundPayment :: Fulfilled { .. } => {
1098
1111
log_error ! ( logger, "Payment already completed" ) ;
1099
1112
return
@@ -1865,6 +1878,13 @@ impl_writeable_tlv_based_enum_upgradable!(PendingOutboundPayment,
1865
1878
( 2 , retry_strategy, required) ,
1866
1879
( 4 , max_total_routing_fee_msat, option) ,
1867
1880
} ,
1881
+ ( 9 , StaticInvoiceReceived ) => {
1882
+ ( 0 , payment_hash, required) ,
1883
+ ( 2 , keysend_preimage, required) ,
1884
+ ( 4 , retry_strategy, required) ,
1885
+ ( 6 , payment_release_secret, required) ,
1886
+ ( 8 , route_params, required) ,
1887
+ } ,
1868
1888
) ;
1869
1889
1870
1890
#[ cfg( test) ]
0 commit comments