Merge pull request #2543 from optout21/txabort-typo
[rust-lightning] / lightning / src / ln / channelmanager.rs
index 64d5521dcb95f78ba3317398e19438f074b19dbc..213a2882fbc3f899e5dd43ebc09a92a47f35c39a 100644 (file)
@@ -237,7 +237,12 @@ impl From<&ClaimableHTLC> for events::ClaimedHTLC {
 ///
 /// This is not exported to bindings users as we just use [u8; 32] directly
 #[derive(Hash, Copy, Clone, PartialEq, Eq, Debug)]
-pub struct PaymentId(pub [u8; 32]);
+pub struct PaymentId(pub [u8; Self::LENGTH]);
+
+impl PaymentId {
+       /// Number of bytes in the id.
+       pub const LENGTH: usize = 32;
+}
 
 impl Writeable for PaymentId {
        fn write<W: Writer>(&self, w: &mut W) -> Result<(), io::Error> {