]> git.bitcoin.ninja Git - rust-lightning/commit
`derive(Hash)` for P2P messages 2023-11-hash-if-eq
authorMatt Corallo <git@bluematt.me>
Mon, 13 Nov 2023 22:50:40 +0000 (22:50 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 14 Nov 2023 00:40:30 +0000 (00:40 +0000)
commit26c00ad751341f94159fcb18eea0f641fe4f7f2c
tree4e94544a976289bbf8743b5abe0cb84c3a3c701f
parenteb23c1e43b0372e53c0b19b1eeafebeef50d2089
`derive(Hash)` for P2P messages

In other languages (Java and C#, notably), overriding `Eq` without
overriding `Hash` can lead to surprising or broken behavior. Even
in Rust, its usually the case that you actually want both. Here we
add missing `Hash` derivations for P2P messages, to at least
address the first pile of warnings the C# compiler dumps.
lightning/src/ln/msgs.rs
lightning/src/onion_message/packet.rs
lightning/src/routing/gossip.rs
lightning/src/util/ser.rs