@@ -2205,6 +2205,9 @@ where
2205
2205
/// keeping additional state.
2206
2206
probing_cookie_secret: [u8; 32],
2207
2207
2208
+ /// When generating [`PaymentId`]s for inbound payments, we HMAC the HTLCs with this secret.
2209
+ inbound_payment_id_secret: [u8; 32],
2210
+
2208
2211
/// The highest block timestamp we've seen, which is usually a good guess at the current time.
2209
2212
/// Assuming most miners are generating blocks with reasonable timestamps, this shouldn't be
2210
2213
/// very far in the past, and can only ever be up to two hours in the future.
@@ -3086,6 +3089,7 @@ where
3086
3089
fake_scid_rand_bytes: entropy_source.get_secure_random_bytes(),
3087
3090
3088
3091
probing_cookie_secret: entropy_source.get_secure_random_bytes(),
3092
+ inbound_payment_id_secret: entropy_source.get_secure_random_bytes(),
3089
3093
3090
3094
highest_seen_timestamp: AtomicUsize::new(current_timestamp as usize),
3091
3095
@@ -12135,6 +12139,7 @@ where
12135
12139
let mut events_override = None;
12136
12140
let mut in_flight_monitor_updates: Option<HashMap<(PublicKey, OutPoint), Vec<ChannelMonitorUpdate>>> = None;
12137
12141
let mut decode_update_add_htlcs: Option<HashMap<u64, Vec<msgs::UpdateAddHTLC>>> = None;
12142
+ let mut inbound_payment_id_secret = None;
12138
12143
read_tlv_fields!(reader, {
12139
12144
(1, pending_outbound_payments_no_retry, option),
12140
12145
(2, pending_intercepted_htlcs, option),
@@ -12149,6 +12154,7 @@ where
12149
12154
(11, probing_cookie_secret, option),
12150
12155
(13, claimable_htlc_onion_fields, optional_vec),
12151
12156
(14, decode_update_add_htlcs, option),
12157
+ (15, inbound_payment_id_secret, option),
12152
12158
});
12153
12159
let mut decode_update_add_htlcs = decode_update_add_htlcs.unwrap_or_else(|| new_hash_map());
12154
12160
if fake_scid_rand_bytes.is_none() {
@@ -12159,6 +12165,10 @@ where
12159
12165
probing_cookie_secret = Some(args.entropy_source.get_secure_random_bytes());
12160
12166
}
12161
12167
12168
+ if inbound_payment_id_secret.is_none() {
12169
+ inbound_payment_id_secret = Some(args.entropy_source.get_secure_random_bytes());
12170
+ }
12171
+
12162
12172
if let Some(events) = events_override {
12163
12173
pending_events_read = events;
12164
12174
}
@@ -12713,6 +12723,7 @@ where
12713
12723
fake_scid_rand_bytes: fake_scid_rand_bytes.unwrap(),
12714
12724
12715
12725
probing_cookie_secret: probing_cookie_secret.unwrap(),
12726
+ inbound_payment_id_secret: inbound_payment_id_secret.unwrap(),
12716
12727
12717
12728
our_network_pubkey,
12718
12729
secp_ctx,
0 commit comments