Skip to content

Commit bcb50a6

Browse files
committed
Fixing panic messages for decryption procedures
1 parent eb8bcaa commit bcb50a6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lightning/src/ln/peer_channel_encryptor.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -421,15 +421,15 @@ impl PeerChannelEncryptor {
421421
*rn += 1;
422422
Ok(byte_utils::slice_to_be16(&res))
423423
},
424-
_ => panic!("Tried to encrypt a message prior to noise handshake completion"),
424+
_ => panic!("Tried to decrypt a message prior to noise handshake completion"),
425425
}
426426
}
427427

428428
/// Decrypts the given message.
429429
/// panics if msg.len() > 65535 + 16
430430
pub fn decrypt_message(&mut self, msg: &[u8]) -> Result<Vec<u8>, LightningError> {
431431
if msg.len() > LN_MAX_MSG_LEN + 16 {
432-
panic!("Attempted to encrypt message longer than 65535 bytes!");
432+
panic!("Attempted to decrypt message longer than 65535 + 16 bytes!");
433433
}
434434

435435
match self.noise_state {
@@ -441,7 +441,7 @@ impl PeerChannelEncryptor {
441441

442442
Ok(res)
443443
},
444-
_ => panic!("Tried to encrypt a message prior to noise handshake completion"),
444+
_ => panic!("Tried to decrypt a message prior to noise handshake completion"),
445445
}
446446
}
447447

0 commit comments

Comments
 (0)