@@ -46,7 +46,7 @@ use crate::ln::channel::{Channel, ChannelError, ChannelUpdateStatus, UpdateFulfi
46
46
use crate :: ln:: features:: { ChannelFeatures , ChannelTypeFeatures , InitFeatures , NodeFeatures } ;
47
47
#[ cfg( any( feature = "_test_utils" , test) ) ]
48
48
use crate :: ln:: features:: InvoiceFeatures ;
49
- use crate :: routing:: router:: { InFlightHtlcs , PaymentParameters , Route , RouteHop , RoutePath , Router } ;
49
+ use crate :: routing:: router:: { InFlightHtlcs , PaymentParameters , Route , RouteHop , RouteParameters , RoutePath , Router } ;
50
50
use crate :: ln:: msgs;
51
51
use crate :: ln:: onion_utils;
52
52
use crate :: ln:: onion_utils:: HTLCFailReason ;
@@ -6524,12 +6524,19 @@ where
6524
6524
debug_assert ! ( false , "While we have code to serialize pending_claiming_payments, the map should always be empty until a later PR" ) ;
6525
6525
}
6526
6526
6527
+ let mut retryable_htlcs = None ;
6528
+ let our_retryable_htlcs = self . pending_outbound_payments . retryable_htlcs . lock ( ) . unwrap ( ) ;
6529
+ if our_retryable_htlcs. len ( ) != 0 {
6530
+ retryable_htlcs = Some ( our_retryable_htlcs) ;
6531
+ }
6532
+
6527
6533
write_tlv_fields ! ( writer, {
6528
6534
( 1 , pending_outbound_payments_no_retry, required) ,
6529
6535
( 2 , pending_intercepted_htlcs, option) ,
6530
6536
( 3 , pending_outbound_payments, required) ,
6531
6537
( 4 , pending_claiming_payments, option) ,
6532
6538
( 5 , self . our_network_pubkey, required) ,
6539
+ ( 6 , retryable_htlcs, option) ,
6533
6540
( 7 , self . fake_scid_rand_bytes, required) ,
6534
6541
( 9 , htlc_purposes, vec_type) ,
6535
6542
( 11 , self . probing_cookie_secret, required) ,
@@ -6864,6 +6871,7 @@ where
6864
6871
let mut pending_outbound_payments_no_retry: Option < HashMap < PaymentId , HashSet < [ u8 ; 32 ] > > > = None ;
6865
6872
let mut pending_outbound_payments = None ;
6866
6873
let mut pending_intercepted_htlcs: Option < HashMap < InterceptId , PendingAddHTLCInfo > > = Some ( HashMap :: new ( ) ) ;
6874
+ let mut retryable_htlcs: Option < Vec < ( PaymentId , RouteParameters ) > > = Some ( Vec :: new ( ) ) ;
6867
6875
let mut received_network_pubkey: Option < PublicKey > = None ;
6868
6876
let mut fake_scid_rand_bytes: Option < [ u8 ; 32 ] > = None ;
6869
6877
let mut probing_cookie_secret: Option < [ u8 ; 32 ] > = None ;
@@ -6875,6 +6883,7 @@ where
6875
6883
( 3 , pending_outbound_payments, option) ,
6876
6884
( 4 , pending_claiming_payments, option) ,
6877
6885
( 5 , received_network_pubkey, option) ,
6886
+ ( 6 , retryable_htlcs, option) ,
6878
6887
( 7 , fake_scid_rand_bytes, option) ,
6879
6888
( 9 , claimable_htlc_purposes, vec_type) ,
6880
6889
( 11 , probing_cookie_secret, option) ,
@@ -7143,7 +7152,9 @@ where
7143
7152
} ) ,
7144
7153
inbound_payment_key : expanded_inbound_key,
7145
7154
pending_inbound_payments : Mutex :: new ( pending_inbound_payments) ,
7146
- pending_outbound_payments : OutboundPayments { pending_outbound_payments : Mutex :: new ( pending_outbound_payments. unwrap ( ) ) } ,
7155
+ pending_outbound_payments : OutboundPayments :: from_outbounds (
7156
+ pending_outbound_payments. unwrap ( ) ,
7157
+ retryable_htlcs. unwrap ( ) ) ,
7147
7158
pending_intercepted_htlcs : Mutex :: new ( pending_intercepted_htlcs. unwrap ( ) ) ,
7148
7159
7149
7160
forward_htlcs : Mutex :: new ( forward_htlcs) ,
0 commit comments