X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fln%2Fchannelmanager.rs;h=213a2882fbc3f899e5dd43ebc09a92a47f35c39a;hb=ef8945e33901ffd4c06f5cfc5f08636894c16584;hp=64d5521dcb95f78ba3317398e19438f074b19dbc;hpb=61d896d5193bad813ce53cc823e9f2afa17e09a8;p=rust-lightning diff --git a/lightning/src/ln/channelmanager.rs b/lightning/src/ln/channelmanager.rs index 64d5521d..213a2882 100644 --- a/lightning/src/ln/channelmanager.rs +++ b/lightning/src/ln/channelmanager.rs @@ -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(&self, w: &mut W) -> Result<(), io::Error> {