Merge pull request #89 from tamasblummer/wittness_block

add witness inv types
This commit is contained in:
Andrew Poelstra 2018-06-04 18:34:28 +00:00 committed by GitHub
commit fb0c782df6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 2 deletions

View File

@ -31,7 +31,11 @@ pub enum InvType {
/// Transaction
Transaction,
/// Block
Block
Block,
/// Witness Block
WitnessBlock,
/// Witness Transaction
WitnessTransaction
}
// Some simple messages
@ -103,7 +107,9 @@ impl<S: SimpleEncoder> ConsensusEncodable<S> for Inventory {
try!(match self.inv_type {
InvType::Error => 0u32,
InvType::Transaction => 1,
InvType::Block => 2
InvType::Block => 2,
InvType::WitnessBlock => 0x40000002,
InvType::WitnessTransaction => 0x40000001
}.consensus_encode(s));
self.hash.consensus_encode(s)
}