Skip to content

Commit 777f6b1

Browse files
committed
fixup: Add OurPeerStorage for serialized Peer Storage backups
1 parent 35863ce commit 777f6b1

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lightning/src/ln/our_peer_storage.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,7 @@ impl OurPeerStorage {
5858

5959
/// Create serialised [`OurPeerStorage`] from the given ser_channels data.
6060
pub fn create_from_data(key: [u8; 32], ser_channels: Vec<u8>) -> Vec<u8> {
61-
let our_peer_storage = Self {
62-
version: 1,
63-
ser_channels,
64-
};
61+
let our_peer_storage = Self { version: 1, ser_channels };
6562

6663
let n = 0u64;
6764
let mut peer_storage = VecWriter(Vec::new());
@@ -81,7 +78,9 @@ impl OurPeerStorage {
8178

8279
/// Decrypt `OurPeerStorage` using the `key`, result is stored inside the `res`.
8380
/// Returns an error if the the `cyphertext` is not correct.
84-
pub fn decrypt_our_peer_storage(res: &mut [u8], cyphertext: &[u8], key: [u8; 32]) -> Result<(), ()> {
81+
pub fn decrypt_our_peer_storage(
82+
res: &mut [u8], cyphertext: &[u8], key: [u8; 32],
83+
) -> Result<(), ()> {
8584
const MIN_CYPHERTEXT_LEN: usize = 16;
8685

8786
// Ensure the cyphertext is at least as large as the MIN_CYPHERTEXT_LEN.

0 commit comments

Comments
 (0)