Implement std:#️⃣:Hash for Inventory

This commit is contained in:
Steven Roose 2019-12-08 17:44:51 +00:00
parent 854718219e
commit b4c4a9658d
No known key found for this signature in database
GPG Key ID: 2F2A88D7F8D68E87
1 changed files with 6 additions and 0 deletions

View File

@ -76,6 +76,12 @@ pub struct Inventory {
pub hash: sha256d::Hash pub hash: sha256d::Hash
} }
impl ::std::hash::Hash for Inventory {
fn hash<H: ::std::hash::Hasher>(&self, state: &mut H) {
self.hash.hash(state)
}
}
impl GetBlocksMessage { impl GetBlocksMessage {
/// Construct a new `getblocks` message /// Construct a new `getblocks` message
pub fn new(locator_hashes: Vec<sha256d::Hash>, stop_hash: sha256d::Hash) -> GetBlocksMessage { pub fn new(locator_hashes: Vec<sha256d::Hash>, stop_hash: sha256d::Hash) -> GetBlocksMessage {