@@ -2239,6 +2239,9 @@ where
2239
2239
/// keeping additional state.
2240
2240
probing_cookie_secret: [u8; 32],
2241
2241
2242
+ /// When generating [`PaymentId`]s for inbound payments, we HMAC the HTLCs with this secret.
2243
+ inbound_payment_id_secret: [u8; 32],
2244
+
2242
2245
/// The highest block timestamp we've seen, which is usually a good guess at the current time.
2243
2246
/// Assuming most miners are generating blocks with reasonable timestamps, this shouldn't be
2244
2247
/// very far in the past, and can only ever be up to two hours in the future.
@@ -3120,6 +3123,7 @@ where
3120
3123
fake_scid_rand_bytes: entropy_source.get_secure_random_bytes(),
3121
3124
3122
3125
probing_cookie_secret: entropy_source.get_secure_random_bytes(),
3126
+ inbound_payment_id_secret: entropy_source.get_secure_random_bytes(),
3123
3127
3124
3128
highest_seen_timestamp: AtomicUsize::new(current_timestamp as usize),
3125
3129
@@ -12232,6 +12236,7 @@ where
12232
12236
let mut events_override = None;
12233
12237
let mut in_flight_monitor_updates: Option<HashMap<(PublicKey, OutPoint), Vec<ChannelMonitorUpdate>>> = None;
12234
12238
let mut decode_update_add_htlcs: Option<HashMap<u64, Vec<msgs::UpdateAddHTLC>>> = None;
12239
+ let mut inbound_payment_id_secret = None;
12235
12240
read_tlv_fields!(reader, {
12236
12241
(1, pending_outbound_payments_no_retry, option),
12237
12242
(2, pending_intercepted_htlcs, option),
@@ -12246,6 +12251,7 @@ where
12246
12251
(11, probing_cookie_secret, option),
12247
12252
(13, claimable_htlc_onion_fields, optional_vec),
12248
12253
(14, decode_update_add_htlcs, option),
12254
+ (15, inbound_payment_id_secret, option),
12249
12255
});
12250
12256
let mut decode_update_add_htlcs = decode_update_add_htlcs.unwrap_or_else(|| new_hash_map());
12251
12257
if fake_scid_rand_bytes.is_none() {
@@ -12256,6 +12262,10 @@ where
12256
12262
probing_cookie_secret = Some(args.entropy_source.get_secure_random_bytes());
12257
12263
}
12258
12264
12265
+ if inbound_payment_id_secret.is_none() {
12266
+ inbound_payment_id_secret = Some(args.entropy_source.get_secure_random_bytes());
12267
+ }
12268
+
12259
12269
if let Some(events) = events_override {
12260
12270
pending_events_read = events;
12261
12271
}
@@ -12807,6 +12817,7 @@ where
12807
12817
fake_scid_rand_bytes: fake_scid_rand_bytes.unwrap(),
12808
12818
12809
12819
probing_cookie_secret: probing_cookie_secret.unwrap(),
12820
+ inbound_payment_id_secret: inbound_payment_id_secret.unwrap(),
12810
12821
12811
12822
our_network_pubkey,
12812
12823
secp_ctx,
0 commit comments