我在 eosio 有两个版本的响应:
诉1.8.1
block_state::block_state( pending_block_header_state&& cur,
const signed_block_ptr& b,
vector<transaction_metadata_ptr>&& trx_metas,
const std::function<void( block_timestamp_type,
const flat_set<digest_type>&,
const vector<digest_type>& )>& validator,
bool skip_validate_signee
)
:block_header_state( std::move(cur).finish_next( *b, validator, skip_validate_signee ) )
,block( b )
,trxs( std::move(trx_metas) ) <-----
{}
诉2.0.11
block_state::block_state( pending_block_header_state&& cur,
signed_block_ptr&& b,
vector<transaction_metadata_ptr>&& trx_metas,
const protocol_feature_set& pfs,
const std::function<void( block_timestamp_type,
const flat_set<digest_type>&,
const vector<digest_type>& )>& validator,
const signer_callback_type& signer
)
:block_header_state( inject_additional_signatures( std::move(cur), *b, pfs, validator, signer ) )
,block( std::move(b) )
,_pub_keys_recovered( true ) // called by produce_block so signature recovery of trxs must have been done
,_cached_trxs( std::move(trx_metas) ) <-----
{}
它适用于第一个版本:
for (const auto &transaction : block->trxs)
{ }
但是当我想在第二个类似地打电话时:
for (const auto &transaction : block->_cached_trxs)
{ }
我有一个错误:
_cached_trxs is a private member of 'eosio::chain::block_state'
我该如何解决这个问题?
UPD:添加了源链接 src