]> git.bitcoin.ninja Git - rust-lightning/commitdiff
f - Add TODO for using validate_pow result
authorJeffrey Czyz <jkczyz@gmail.com>
Thu, 18 Feb 2021 21:33:14 +0000 (13:33 -0800)
committerJeffrey Czyz <jkczyz@gmail.com>
Mon, 22 Feb 2021 16:49:13 +0000 (08:49 -0800)
lightning-block-sync/src/poll.rs

index 933af2e5f8189912af21b7b5e060644c966de6f9..f0f5a0c8a3cc331531246ce4e545fdddbbbe74b8 100644 (file)
@@ -52,6 +52,7 @@ impl Validate for BlockHeaderData {
                        .validate_pow(&self.header.target())
                        .or_else(|e| Err(BlockSourceError::persistent(e)))?;
 
+               // TODO: Use the result of validate_pow instead of recomputing the block hash once upstream.
                if self.header.block_hash() != block_hash {
                        return Err(BlockSourceError::persistent("invalid block hash"));
                }
@@ -68,6 +69,7 @@ impl Validate for Block {
                        .validate_pow(&self.header.target())
                        .or_else(|e| Err(BlockSourceError::persistent(e)))?;
 
+               // TODO: Use the result of validate_pow instead of recomputing the block hash once upstream.
                if self.block_hash() != block_hash {
                        return Err(BlockSourceError::persistent("invalid block hash"));
                }