18 if (block_header.
number == 0)
return true;
21 "Block tree must have been initialized with " 22 "JustificationStoragePolicyImpl::initBlockchainInfo()");
24 auto last_finalized =
block_tree_->getLastFinalized();
25 BOOST_ASSERT_MSG(last_finalized.number >= block_header.
number,
26 "Target block must be finalized");
28 for (
auto &digest : block_header.
digest) {
29 if (
auto *consensus_digest_enc =
30 boost::get<primitives::Consensus>(&digest);
31 consensus_digest_enc !=
nullptr) {
32 OUTCOME_TRY(consensus_digest, consensus_digest_enc->decode());
33 bool authority_change =
36 if (authority_change)
return true;
39 if (block_header.
number % 512 == 0) {
46 std::shared_ptr<const blockchain::BlockTree> block_tree) {
48 "Block tree should be initialized once");
49 BOOST_ASSERT(block_tree !=
nullptr);
virtual outcome::result< bool > shouldStoreFor(const primitives::BlockHeader &block) const override
virtual void initBlockchainInfo(std::shared_ptr< const blockchain::BlockTree > block_tree)
std::shared_ptr< const blockchain::BlockTree > block_tree_