@@ -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 ;
@@ -6517,12 +6517,19 @@ where
6517
6517
debug_assert ! ( false , "While we have code to serialize pending_claiming_payments, the map should always be empty until a later PR" ) ;
6518
6518
}
6519
6519
6520
+ let mut retryable_htlcs = None ;
6521
+ let our_retryable_htlcs = self . pending_outbound_payments . retryable_htlcs . lock ( ) . unwrap ( ) ;
6522
+ if our_retryable_htlcs. len ( ) != 0 {
6523
+ retryable_htlcs = Some ( our_retryable_htlcs) ;
6524
+ }
6525
+
6520
6526
write_tlv_fields ! ( writer, {
6521
6527
( 1 , pending_outbound_payments_no_retry, required) ,
6522
6528
( 2 , pending_intercepted_htlcs, option) ,
6523
6529
( 3 , pending_outbound_payments, required) ,
6524
6530
( 4 , pending_claiming_payments, option) ,
6525
6531
( 5 , self . our_network_pubkey, required) ,
6532
+ ( 6 , retryable_htlcs, option) ,
6526
6533
( 7 , self . fake_scid_rand_bytes, required) ,
6527
6534
( 9 , htlc_purposes, vec_type) ,
6528
6535
( 11 , self . probing_cookie_secret, required) ,
@@ -6857,6 +6864,7 @@ where
6857
6864
let mut pending_outbound_payments_no_retry: Option < HashMap < PaymentId , HashSet < [ u8 ; 32 ] > > > = None ;
6858
6865
let mut pending_outbound_payments = None ;
6859
6866
let mut pending_intercepted_htlcs: Option < HashMap < InterceptId , PendingAddHTLCInfo > > = Some ( HashMap :: new ( ) ) ;
6867
+ let mut retryable_htlcs: Option < Vec < ( PaymentId , RouteParameters ) > > = Some ( Vec :: new ( ) ) ;
6860
6868
let mut received_network_pubkey: Option < PublicKey > = None ;
6861
6869
let mut fake_scid_rand_bytes: Option < [ u8 ; 32 ] > = None ;
6862
6870
let mut probing_cookie_secret: Option < [ u8 ; 32 ] > = None ;
@@ -6868,6 +6876,7 @@ where
6868
6876
( 3 , pending_outbound_payments, option) ,
6869
6877
( 4 , pending_claiming_payments, option) ,
6870
6878
( 5 , received_network_pubkey, option) ,
6879
+ ( 6 , retryable_htlcs, option) ,
6871
6880
( 7 , fake_scid_rand_bytes, option) ,
6872
6881
( 9 , claimable_htlc_purposes, vec_type) ,
6873
6882
( 11 , probing_cookie_secret, option) ,
@@ -7136,7 +7145,9 @@ where
7136
7145
} ) ,
7137
7146
inbound_payment_key : expanded_inbound_key,
7138
7147
pending_inbound_payments : Mutex :: new ( pending_inbound_payments) ,
7139
- pending_outbound_payments : OutboundPayments { pending_outbound_payments : Mutex :: new ( pending_outbound_payments. unwrap ( ) ) } ,
7148
+ pending_outbound_payments : OutboundPayments :: from_outbounds (
7149
+ pending_outbound_payments. unwrap ( ) ,
7150
+ retryable_htlcs. unwrap ( ) ) ,
7140
7151
pending_intercepted_htlcs : Mutex :: new ( pending_intercepted_htlcs. unwrap ( ) ) ,
7141
7152
7142
7153
forward_htlcs : Mutex :: new ( forward_htlcs) ,
0 commit comments