@@ -82,7 +82,6 @@ pub(crate) enum PendingOutboundPayment {
82
82
payment_hash : PaymentHash ,
83
83
keysend_preimage : PaymentPreimage ,
84
84
retry_strategy : Retry ,
85
- payment_release_secret : [ u8 ; 32 ] ,
86
85
route_params : RouteParameters ,
87
86
} ,
88
87
Retryable {
@@ -984,7 +983,7 @@ impl OutboundPayments {
984
983
& self , invoice : & StaticInvoice , payment_id : PaymentId , features : Bolt12InvoiceFeatures ,
985
984
best_block_height : u32 , entropy_source : ES ,
986
985
pending_events : & Mutex < VecDeque < ( events:: Event , Option < EventCompletionAction > ) > >
987
- ) -> Result < [ u8 ; 32 ] , Bolt12PaymentError > where ES :: Target : EntropySource {
986
+ ) -> Result < ( ) , Bolt12PaymentError > where ES :: Target : EntropySource {
988
987
macro_rules! abandon_with_entry {
989
988
( $payment: expr, $reason: expr) => {
990
989
$payment. get_mut( ) . mark_abandoned( $reason) ;
@@ -1029,7 +1028,6 @@ impl OutboundPayments {
1029
1028
} ;
1030
1029
let keysend_preimage = PaymentPreimage ( entropy_source. get_secure_random_bytes ( ) ) ;
1031
1030
let payment_hash = PaymentHash ( Sha256 :: hash ( & keysend_preimage. 0 ) . to_byte_array ( ) ) ;
1032
- let payment_release_secret = entropy_source. get_secure_random_bytes ( ) ;
1033
1031
let pay_params = PaymentParameters :: from_static_invoice ( invoice) ;
1034
1032
let mut route_params = RouteParameters :: from_payment_params_and_value ( pay_params, amount_msat) ;
1035
1033
route_params. max_total_routing_fee_msat = * max_total_routing_fee_msat;
@@ -1046,10 +1044,9 @@ impl OutboundPayments {
1046
1044
payment_hash,
1047
1045
keysend_preimage,
1048
1046
retry_strategy : * retry_strategy,
1049
- payment_release_secret,
1050
1047
route_params,
1051
1048
} ;
1052
- return Ok ( payment_release_secret )
1049
+ return Ok ( ( ) )
1053
1050
} ,
1054
1051
_ => return Err ( Bolt12PaymentError :: DuplicateInvoice ) ,
1055
1052
} ,
@@ -1061,9 +1058,9 @@ impl OutboundPayments {
1061
1058
pub ( super ) fn send_payment_for_static_invoice <
1062
1059
R : Deref , ES : Deref , NS : Deref , NL : Deref , IH , SP , L : Deref
1063
1060
> (
1064
- & self , payment_id : PaymentId , payment_release_secret : [ u8 ; 32 ] , router : & R ,
1065
- first_hops : Vec < ChannelDetails > , inflight_htlcs : IH , entropy_source : & ES , node_signer : & NS ,
1066
- node_id_lookup : & NL , secp_ctx : & Secp256k1 < secp256k1:: All > , best_block_height : u32 , logger : & L ,
1061
+ & self , payment_id : PaymentId , router : & R , first_hops : Vec < ChannelDetails > , inflight_htlcs : IH ,
1062
+ entropy_source : & ES , node_signer : & NS , node_id_lookup : & NL ,
1063
+ secp_ctx : & Secp256k1 < secp256k1:: All > , best_block_height : u32 , logger : & L ,
1067
1064
pending_events : & Mutex < VecDeque < ( events:: Event , Option < EventCompletionAction > ) > > ,
1068
1065
send_payment_along_path : SP ,
1069
1066
) -> Result < ( ) , Bolt12PaymentError >
@@ -1080,12 +1077,8 @@ impl OutboundPayments {
1080
1077
match self . pending_outbound_payments . lock ( ) . unwrap ( ) . entry ( payment_id) {
1081
1078
hash_map:: Entry :: Occupied ( entry) => match entry. get ( ) {
1082
1079
PendingOutboundPayment :: StaticInvoiceReceived {
1083
- payment_hash, payment_release_secret : release_secret, route_params, retry_strategy,
1084
- keysend_preimage, ..
1080
+ payment_hash, route_params, retry_strategy, keysend_preimage, ..
1085
1081
} => {
1086
- if payment_release_secret != * release_secret {
1087
- return Err ( Bolt12PaymentError :: UnexpectedInvoice )
1088
- }
1089
1082
( * payment_hash, * keysend_preimage, route_params. clone ( ) , * retry_strategy)
1090
1083
} ,
1091
1084
_ => return Err ( Bolt12PaymentError :: DuplicateInvoice ) ,
@@ -2196,8 +2189,7 @@ impl_writeable_tlv_based_enum_upgradable!(PendingOutboundPayment,
2196
2189
( 0 , payment_hash, required) ,
2197
2190
( 2 , keysend_preimage, required) ,
2198
2191
( 4 , retry_strategy, required) ,
2199
- ( 6 , payment_release_secret, required) ,
2200
- ( 8 , route_params, required) ,
2192
+ ( 6 , route_params, required) ,
2201
2193
} ,
2202
2194
) ;
2203
2195
@@ -2785,7 +2777,6 @@ mod tests {
2785
2777
payment_hash,
2786
2778
keysend_preimage : PaymentPreimage ( [ 0 ; 32 ] ) ,
2787
2779
retry_strategy : Retry :: Attempts ( 0 ) ,
2788
- payment_release_secret : [ 0 ; 32 ] ,
2789
2780
route_params,
2790
2781
} ;
2791
2782
outbounds. insert ( payment_id, outbound) ;
@@ -2832,7 +2823,6 @@ mod tests {
2832
2823
payment_hash,
2833
2824
keysend_preimage : PaymentPreimage ( [ 0 ; 32 ] ) ,
2834
2825
retry_strategy : Retry :: Attempts ( 0 ) ,
2835
- payment_release_secret : [ 0 ; 32 ] ,
2836
2826
route_params,
2837
2827
} ;
2838
2828
outbounds. insert ( payment_id, outbound) ;
0 commit comments