@@ -47,15 +47,15 @@ use crate::ln::features::{ChannelFeatures, ChannelTypeFeatures, InitFeatures, No
47
47
#[ cfg( any( feature = "_test_utils" , test) ) ]
48
48
use crate :: ln:: features:: InvoiceFeatures ;
49
49
use crate :: routing:: gossip:: NetworkGraph ;
50
- use crate :: routing:: router:: { DefaultRouter , InFlightHtlcs , PaymentParameters , Route , RouteHop , RoutePath , Router } ;
50
+ use crate :: routing:: router:: { DefaultRouter , InFlightHtlcs , PaymentParameters , Route , RouteHop , RouteParameters , RoutePath , Router } ;
51
51
use crate :: routing:: scoring:: ProbabilisticScorer ;
52
52
use crate :: ln:: msgs;
53
53
use crate :: ln:: onion_utils;
54
54
use crate :: ln:: onion_utils:: HTLCFailReason ;
55
55
use crate :: ln:: msgs:: { ChannelMessageHandler , DecodeError , LightningError , MAX_VALUE_MSAT } ;
56
56
#[ cfg( test) ]
57
- use crate :: ln:: outbound_payment;
58
- use crate :: ln:: outbound_payment:: { OutboundPayments , PendingOutboundPayment , Retry } ;
57
+ use crate :: ln:: outbound_payment:: { self , Retry } ;
58
+ use crate :: ln:: outbound_payment:: { OutboundPayments , PendingOutboundPayment } ;
59
59
use crate :: ln:: wire:: Encode ;
60
60
use crate :: chain:: keysinterface:: { EntropySource , KeysInterface , KeysManager , NodeSigner , Recipient , Sign , SignerProvider } ;
61
61
use crate :: util:: config:: { UserConfig , ChannelConfig } ;
@@ -6530,12 +6530,19 @@ where
6530
6530
debug_assert ! ( false , "While we have code to serialize pending_claiming_payments, the map should always be empty until a later PR" ) ;
6531
6531
}
6532
6532
6533
+ let mut retryable_htlcs = None ;
6534
+ let our_retryable_htlcs = self . pending_outbound_payments . retryable_htlcs . lock ( ) . unwrap ( ) ;
6535
+ if our_retryable_htlcs. len ( ) != 0 {
6536
+ retryable_htlcs = Some ( our_retryable_htlcs) ;
6537
+ }
6538
+
6533
6539
write_tlv_fields ! ( writer, {
6534
6540
( 1 , pending_outbound_payments_no_retry, required) ,
6535
6541
( 2 , pending_intercepted_htlcs, option) ,
6536
6542
( 3 , pending_outbound_payments, required) ,
6537
6543
( 4 , pending_claiming_payments, option) ,
6538
6544
( 5 , self . our_network_pubkey, required) ,
6545
+ ( 6 , retryable_htlcs, option) ,
6539
6546
( 7 , self . fake_scid_rand_bytes, required) ,
6540
6547
( 9 , htlc_purposes, vec_type) ,
6541
6548
( 11 , self . probing_cookie_secret, required) ,
@@ -6870,6 +6877,7 @@ where
6870
6877
let mut pending_outbound_payments_no_retry: Option < HashMap < PaymentId , HashSet < [ u8 ; 32 ] > > > = None ;
6871
6878
let mut pending_outbound_payments = None ;
6872
6879
let mut pending_intercepted_htlcs: Option < HashMap < InterceptId , PendingAddHTLCInfo > > = Some ( HashMap :: new ( ) ) ;
6880
+ let mut retryable_htlcs: Option < Vec < ( PaymentId , RouteParameters ) > > = Some ( Vec :: new ( ) ) ;
6873
6881
let mut received_network_pubkey: Option < PublicKey > = None ;
6874
6882
let mut fake_scid_rand_bytes: Option < [ u8 ; 32 ] > = None ;
6875
6883
let mut probing_cookie_secret: Option < [ u8 ; 32 ] > = None ;
@@ -6881,6 +6889,7 @@ where
6881
6889
( 3 , pending_outbound_payments, option) ,
6882
6890
( 4 , pending_claiming_payments, option) ,
6883
6891
( 5 , received_network_pubkey, option) ,
6892
+ ( 6 , retryable_htlcs, option) ,
6884
6893
( 7 , fake_scid_rand_bytes, option) ,
6885
6894
( 9 , claimable_htlc_purposes, vec_type) ,
6886
6895
( 11 , probing_cookie_secret, option) ,
@@ -7149,7 +7158,9 @@ where
7149
7158
} ) ,
7150
7159
inbound_payment_key : expanded_inbound_key,
7151
7160
pending_inbound_payments : Mutex :: new ( pending_inbound_payments) ,
7152
- pending_outbound_payments : OutboundPayments { pending_outbound_payments : Mutex :: new ( pending_outbound_payments. unwrap ( ) ) } ,
7161
+ pending_outbound_payments : OutboundPayments :: from_outbounds (
7162
+ pending_outbound_payments. unwrap ( ) ,
7163
+ retryable_htlcs. unwrap ( ) ) ,
7153
7164
pending_intercepted_htlcs : Mutex :: new ( pending_intercepted_htlcs. unwrap ( ) ) ,
7154
7165
7155
7166
forward_htlcs : Mutex :: new ( forward_htlcs) ,
0 commit comments