Merge pull request #361 from stevenroose/inventory-hash

Implement std:#️⃣:Hash for Inventory
This commit is contained in:
Andrew Poelstra 2019-12-09 00:43:03 +00:00 committed by GitHub
commit 1d209362eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -76,6 +76,12 @@ pub struct Inventory {
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 {
/// Construct a new `getblocks` message
pub fn new(locator_hashes: Vec<sha256d::Hash>, stop_hash: sha256d::Hash) -> GetBlocksMessage {