File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -59,12 +59,11 @@ impl Validate for BlockHeaderData {
5959 type T = ValidatedBlockHeader ;
6060
6161 fn validate ( self , block_hash : BlockHash ) -> BlockSourceResult < Self :: T > {
62- self . header
62+ let pow_valid_block_hash = self . header
6363 . validate_pow ( & self . header . target ( ) )
6464 . or_else ( |e| Err ( BlockSourceError :: persistent ( e) ) ) ?;
6565
66- // TODO: Use the result of validate_pow instead of recomputing the block hash once upstream.
67- if self . header . block_hash ( ) != block_hash {
66+ if pow_valid_block_hash != block_hash {
6867 return Err ( BlockSourceError :: persistent ( "invalid block hash" ) ) ;
6968 }
7069
@@ -76,12 +75,11 @@ impl Validate for Block {
7675 type T = ValidatedBlock ;
7776
7877 fn validate ( self , block_hash : BlockHash ) -> BlockSourceResult < Self :: T > {
79- self . header
78+ let pow_valid_block_hash = self . header
8079 . validate_pow ( & self . header . target ( ) )
8180 . or_else ( |e| Err ( BlockSourceError :: persistent ( e) ) ) ?;
8281
83- // TODO: Use the result of validate_pow instead of recomputing the block hash once upstream.
84- if self . block_hash ( ) != block_hash {
82+ if pow_valid_block_hash != block_hash {
8583 return Err ( BlockSourceError :: persistent ( "invalid block hash" ) ) ;
8684 }
8785
You can’t perform that action at this time.
0 commit comments