Run offchain workers at hash, not number. (#4878)

* Run offchain workers at particular hash, not number.

* Don't run if not new best.

* Don't run if not new best.

* Update client/service/src/builder.rs

Co-Authored-By: Nikolay Volf <nikvolf@gmail.com>

* Update client/service/src/builder.rs

Co-Authored-By: Nikolay Volf <nikvolf@gmail.com>

* Update client/service/src/builder.rs

Co-authored-by: Nikolay Volf <nikvolf@gmail.com>
This commit is contained in:
Tomasz Drwięga
2020-02-11 00:41:59 +01:00
committed by GitHub
parent ef7d19ed93
commit 05b3e1f654
4 changed files with 30 additions and 23 deletions
+3 -1
View File
@@ -320,7 +320,9 @@ pub fn require_header<Block: BlockT>(
id: BlockId<Block>,
) -> sp_blockchain::Result<Block::Header> {
read_header(db, col_index, col, id)
.and_then(|header| header.ok_or_else(|| sp_blockchain::Error::UnknownBlock(format!("{}", id))))
.and_then(|header| header.ok_or_else(||
sp_blockchain::Error::UnknownBlock(format!("Require header: {}", id))
))
}
/// Read meta from the database.