Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
transaction_metadata.cpp
Go to the documentation of this file.
3#include <boost/asio/thread_pool.hpp>
4
5namespace sysio { namespace chain {
6
8 boost::asio::io_context& thread_pool,
9 const chain_id_type& chain_id,
10 fc::microseconds time_limit,
11 trx_type t,
12 uint32_t max_variable_sig_size )
13{
14 return async_thread_pool( thread_pool, [trx{std::move(trx)}, chain_id, time_limit, t, max_variable_sig_size]() mutable {
15 fc::time_point deadline = time_limit == fc::microseconds::maximum() ?
17 check_variable_sig_size( trx, max_variable_sig_size );
18 const signed_transaction& trn = trx->get_signed_transaction();
19 flat_set<public_key_type> recovered_pub_keys;
20 fc::microseconds cpu_usage = trn.get_signature_keys( chain_id, deadline, recovered_pub_keys );
21 return std::make_shared<transaction_metadata>( private_type(), std::move( trx ), cpu_usage, std::move( recovered_pub_keys ),
23 }
24 );
25}
26
28 return sizeof(*this) + _recovered_pub_keys.size() * sizeof(public_key_type) + packed_trx()->get_estimated_size();
29}
30
31} } // sysio::chain
static constexpr microseconds maximum()
Definition time.hpp:14
static time_point now()
Definition time.cpp:14
static constexpr time_point maximum()
Definition time.hpp:46
static recover_keys_future start_recover_keys(packed_transaction_ptr trx, boost::asio::io_context &thread_pool, const chain_id_type &chain_id, fc::microseconds time_limit, trx_type t, uint32_t max_variable_sig_size=UINT32_MAX)
const packed_transaction_ptr & packed_trx() const
std::future< transaction_metadata_ptr > recover_keys_future
fc::crypto::public_key public_key_type
Definition types.hpp:76
std::shared_ptr< const packed_transaction > packed_transaction_ptr
auto async_thread_pool(boost::asio::io_context &thread_pool, F &&f)
unsigned int uint32_t
Definition stdint.h:126
fc::microseconds get_signature_keys(const chain_id_type &chain_id, fc::time_point deadline, flat_set< public_key_type > &recovered_pub_keys, bool allow_duplicate_keys=false) const