diff --git a/libraries/chain/block_state.cpp b/libraries/chain/block_state.cpp index c2c7ed92f7..ddb53e5cee 100644 --- a/libraries/chain/block_state.cpp +++ b/libraries/chain/block_state.cpp @@ -12,13 +12,17 @@ block_state::block_state(const block_header_state& prev, signed_block_ptr b, con {} block_state::block_state(const block_header_state& bhs, deque&& trx_metas, - deque&& trx_receipts) + deque&& trx_receipts, const std::optional& qc) : block_header_state(bhs) , block(std::make_shared(signed_block_header{bhs.header})) // [greg todo] do we need signatures? , pub_keys_recovered(true) // probably not needed , cached_trxs(std::move(trx_metas)) { block->transactions = std::move(trx_receipts); + + if( qc && bhs.is_needed(*qc) ) { + emplace_extension(block->block_extensions, quorum_certificate_extension::extension_id(), fc::raw::pack( *qc )); + } } // Used for transition from dpos to instant-finality diff --git a/libraries/chain/controller.cpp b/libraries/chain/controller.cpp index 38294a630a..2ac7acb64c 100644 --- a/libraries/chain/controller.cpp +++ b/libraries/chain/controller.cpp @@ -549,7 +549,7 @@ struct assembled_block { }, [&](assembled_block_if& ab) { auto bsp = std::make_shared(ab.bhs, std::move(ab.trx_metas), - std::move(ab.trx_receipts)); + std::move(ab.trx_receipts), ab.qc); return completed_block{std::move(bsp)}; }}, v); diff --git a/libraries/chain/include/eosio/chain/block_state.hpp b/libraries/chain/include/eosio/chain/block_state.hpp index 26c3883ff7..aeb8298d9c 100644 --- a/libraries/chain/include/eosio/chain/block_state.hpp +++ b/libraries/chain/include/eosio/chain/block_state.hpp @@ -48,7 +48,7 @@ struct block_state : public block_header_state { // block_header_state provi const validator_t& validator, bool skip_validate_signee); block_state(const block_header_state& bhs, deque&& trx_metas, - deque&& trx_receipts); + deque&& trx_receipts, const std::optional& qc); explicit block_state(const block_state_legacy& bsp); };