@@ -2261,6 +2261,9 @@ where
22612261 /// keeping additional state.
22622262 probing_cookie_secret: [u8; 32],
22632263
2264+ /// When generating [`PaymentId`]s for inbound payments, we HMAC the HTLCs with this secret.
2265+ inbound_payment_id_secret: [u8; 32],
2266+
22642267 /// The highest block timestamp we've seen, which is usually a good guess at the current time.
22652268 /// Assuming most miners are generating blocks with reasonable timestamps, this shouldn't be
22662269 /// very far in the past, and can only ever be up to two hours in the future.
@@ -3152,6 +3155,7 @@ where
31523155 fake_scid_rand_bytes: entropy_source.get_secure_random_bytes(),
31533156
31543157 probing_cookie_secret: entropy_source.get_secure_random_bytes(),
3158+ inbound_payment_id_secret: entropy_source.get_secure_random_bytes(),
31553159
31563160 highest_seen_timestamp: AtomicUsize::new(current_timestamp as usize),
31573161
@@ -12381,6 +12385,7 @@ where
1238112385 let mut events_override = None;
1238212386 let mut in_flight_monitor_updates: Option<HashMap<(PublicKey, OutPoint), Vec<ChannelMonitorUpdate>>> = None;
1238312387 let mut decode_update_add_htlcs: Option<HashMap<u64, Vec<msgs::UpdateAddHTLC>>> = None;
12388+ let mut inbound_payment_id_secret = None;
1238412389 read_tlv_fields!(reader, {
1238512390 (1, pending_outbound_payments_no_retry, option),
1238612391 (2, pending_intercepted_htlcs, option),
@@ -12395,6 +12400,7 @@ where
1239512400 (11, probing_cookie_secret, option),
1239612401 (13, claimable_htlc_onion_fields, optional_vec),
1239712402 (14, decode_update_add_htlcs, option),
12403+ (15, inbound_payment_id_secret, option),
1239812404 });
1239912405 let mut decode_update_add_htlcs = decode_update_add_htlcs.unwrap_or_else(|| new_hash_map());
1240012406 if fake_scid_rand_bytes.is_none() {
@@ -12405,6 +12411,10 @@ where
1240512411 probing_cookie_secret = Some(args.entropy_source.get_secure_random_bytes());
1240612412 }
1240712413
12414+ if inbound_payment_id_secret.is_none() {
12415+ inbound_payment_id_secret = Some(args.entropy_source.get_secure_random_bytes());
12416+ }
12417+
1240812418 if let Some(events) = events_override {
1240912419 pending_events_read = events;
1241012420 }
@@ -12930,6 +12940,7 @@ where
1293012940 fake_scid_rand_bytes: fake_scid_rand_bytes.unwrap(),
1293112941
1293212942 probing_cookie_secret: probing_cookie_secret.unwrap(),
12943+ inbound_payment_id_secret: inbound_payment_id_secret.unwrap(),
1293312944
1293412945 our_network_pubkey,
1293512946 secp_ctx,
0 commit comments