Skip to content

Commit 9276aa2

Browse files
committed
Use byte array to represent SendHTLCId::OutboundRoute::session_priv
1 parent ea03f40 commit 9276aa2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use bitcoin::blockdata::block::Header;
2121
use bitcoin::blockdata::transaction::Transaction;
2222
use bitcoin::blockdata::constants::ChainHash;
23+
use bitcoin::key::constants::SECRET_KEY_SIZE;
2324
use bitcoin::network::constants::Network;
2425

2526
use bitcoin::hashes::Hash;
@@ -313,7 +314,7 @@ impl Readable for InterceptId {
313314
/// Uniquely describes an HTLC by its source. Just the guaranteed-unique subset of [`HTLCSource`].
314315
pub(crate) enum SentHTLCId {
315316
PreviousHopData { short_channel_id: u64, htlc_id: u64 },
316-
OutboundRoute { session_priv: SecretKey },
317+
OutboundRoute { session_priv: [u8; SECRET_KEY_SIZE] },
317318
}
318319
impl SentHTLCId {
319320
pub(crate) fn from_source(source: &HTLCSource) -> Self {
@@ -323,7 +324,7 @@ impl SentHTLCId {
323324
htlc_id: hop_data.htlc_id,
324325
},
325326
HTLCSource::OutboundRoute { session_priv, .. } =>
326-
Self::OutboundRoute { session_priv: *session_priv },
327+
Self::OutboundRoute { session_priv: session_priv.secret_bytes() },
327328
}
328329
}
329330
}

0 commit comments

Comments
 (0)