adding api to get recent transactions by id
This commit is contained in:
parent
1ff46f0b29
commit
9b0abe2790
2 changed files with 17 additions and 0 deletions
|
|
@ -331,6 +331,15 @@ processed_transaction database_api::get_transaction( uint32_t block_num, uint32_
|
|||
return my->get_transaction( block_num, trx_in_block );
|
||||
}
|
||||
|
||||
optional<signed_transaction> database_api::get_recent_transaction_by_id( const transaction_id_type& id )const
|
||||
{
|
||||
try {
|
||||
return my->_db.get_recent_transaction( id );
|
||||
} catch ( ... ) {
|
||||
return optional<signed_transaction>();
|
||||
}
|
||||
}
|
||||
|
||||
processed_transaction database_api_impl::get_transaction(uint32_t block_num, uint32_t trx_num)const
|
||||
{
|
||||
auto opt_block = _db.fetch_block_by_number(block_num);
|
||||
|
|
|
|||
|
|
@ -121,6 +121,13 @@ class database_api
|
|||
*/
|
||||
processed_transaction get_transaction( uint32_t block_num, uint32_t trx_in_block )const;
|
||||
|
||||
/**
|
||||
* If the transaction has not expired, this method will return the transaction for the given ID or
|
||||
* it will return NULL if it is not known. Just because it is not known does not mean it wasn't
|
||||
* included in the blockchain.
|
||||
*/
|
||||
optional<signed_transaction> get_recent_transaction_by_id( const transaction_id_type& id )const;
|
||||
|
||||
/////////////
|
||||
// Globals //
|
||||
/////////////
|
||||
|
|
@ -480,6 +487,7 @@ FC_API(graphene::app::database_api,
|
|||
(get_block_header)
|
||||
(get_block)
|
||||
(get_transaction)
|
||||
(get_recent_transaction_by_id)
|
||||
|
||||
// Globals
|
||||
(get_chain_properties)
|
||||
|
|
|
|||
Loading…
Reference in a new issue