BitShares-Core  7.0.2
BitShares blockchain node software and command-line wallet software
Classes | Public Member Functions | List of all members
graphene::net::detail::statistics_gathering_node_delegate_wrapper Class Reference

#include <node_impl.hxx>

Inheritance diagram for graphene::net::detail::statistics_gathering_node_delegate_wrapper:
graphene::net::node_delegate

Public Member Functions

 statistics_gathering_node_delegate_wrapper (std::shared_ptr< node_delegate > delegate, fc::thread *thread_for_delegate_calls)
 
fc::variant_object get_call_statistics ()
 
bool has_item (const graphene::net::item_id &id) override
 
void handle_message (const message &) override
 Called when a new message comes in from the network other than a block or a transaction. Currently there are no other possible messages, so this should never be called. More...
 
bool handle_block (const graphene::net::block_message &block_message, bool sync_mode, std::vector< message_hash_type > &contained_transaction_msg_ids) override
 Called when a new block comes in from the network. More...
 
void handle_transaction (const graphene::net::trx_message &transaction_message) override
 Called when a new transaction comes in from the network. More...
 
std::vector< item_hash_tget_block_ids (const std::vector< item_hash_t > &blockchain_synopsis, uint32_t &remaining_item_count, uint32_t limit=2000) override
 
message get_item (const item_id &id) override
 
graphene::protocol::chain_id_type get_chain_id () const override
 
std::vector< item_hash_tget_blockchain_synopsis (const item_hash_t &reference_point, uint32_t number_of_blocks_after_reference_point) override
 
void sync_status (uint32_t item_type, uint32_t item_count) override
 
void connection_count_changed (uint32_t c) override
 
uint32_t get_block_number (const item_hash_t &block_id) override
 
fc::time_point_sec get_block_time (const item_hash_t &block_id) override
 
item_hash_t get_head_block_id () const override
 
uint32_t estimate_last_known_fork_from_git_revision_timestamp (uint32_t unix_timestamp) const override
 
void error_encountered (const std::string &message, const fc::oexception &error) override
 
uint8_t get_current_block_interval_in_seconds () const override
 
- Public Member Functions inherited from graphene::net::node_delegate
virtual ~node_delegate ()=default
 

Detailed Description

Definition at line 260 of file node_impl.hxx.

Constructor & Destructor Documentation

◆ statistics_gathering_node_delegate_wrapper()

graphene::net::detail::statistics_gathering_node_delegate_wrapper::statistics_gathering_node_delegate_wrapper ( std::shared_ptr< node_delegate delegate,
fc::thread thread_for_delegate_calls 
)

Definition at line 5238 of file node.cpp.

Member Function Documentation

◆ connection_count_changed()

void graphene::net::detail::statistics_gathering_node_delegate_wrapper::connection_count_changed ( uint32_t  c)
overridevirtual

Call any time the number of connected peers changes.

Implements graphene::net::node_delegate.

Definition at line 5380 of file node.cpp.

◆ error_encountered()

void graphene::net::detail::statistics_gathering_node_delegate_wrapper::error_encountered ( const std::string &  message,
const fc::oexception error 
)
overridevirtual

Implements graphene::net::node_delegate.

Definition at line 5407 of file node.cpp.

◆ estimate_last_known_fork_from_git_revision_timestamp()

uint32_t graphene::net::detail::statistics_gathering_node_delegate_wrapper::estimate_last_known_fork_from_git_revision_timestamp ( uint32_t  unix_timestamp) const
overridevirtual

Implements graphene::net::node_delegate.

Definition at line 5402 of file node.cpp.

◆ get_block_ids()

std::vector< item_hash_t > graphene::net::detail::statistics_gathering_node_delegate_wrapper::get_block_ids ( const std::vector< item_hash_t > &  blockchain_synopsis,
uint32_t &  remaining_item_count,
uint32_t  limit = 2000 
)
overridevirtual

Assuming all data elements are ordered in some way, this method should return up to limit ids that occur after from_id. On return, remaining_item_count will be set to the number of items in our blockchain after the last item returned in the result, or 0 if the result contains the last item in the blockchain

Implements graphene::net::node_delegate.

Definition at line 5353 of file node.cpp.

◆ get_block_number()

uint32_t graphene::net::detail::statistics_gathering_node_delegate_wrapper::get_block_number ( const item_hash_t block_id)
overridevirtual

Implements graphene::net::node_delegate.

Definition at line 5385 of file node.cpp.

◆ get_block_time()

fc::time_point_sec graphene::net::detail::statistics_gathering_node_delegate_wrapper::get_block_time ( const item_hash_t block_id)
overridevirtual

Returns the time a block was produced (if block_id = 0, returns genesis time). If we don't know about the block, returns time_point_sec::min()

Implements graphene::net::node_delegate.

Definition at line 5392 of file node.cpp.

◆ get_blockchain_synopsis()

std::vector< item_hash_t > graphene::net::detail::statistics_gathering_node_delegate_wrapper::get_blockchain_synopsis ( const item_hash_t reference_point,
uint32_t  number_of_blocks_after_reference_point 
)
overridevirtual

Returns a synopsis of the blockchain used for syncing. This consists of a list of selected item hashes from our current preferred blockchain, exponentially falling off into the past. Horrible explanation.

If the blockchain is empty, it will return the empty list. If the blockchain has one block, it will return a list containing just that block. If it contains more than one block: the first element in the list will be the hash of the highest numbered block that we cannot undo the second element will be the hash of an item at the half way point in the undoable segment of the blockchain the third will be ~3/4 of the way through the undoable segment of the block chain the fourth will be at ~7/8... &c. the last item in the list will be the hash of the most recent block on our preferred chain

Implements graphene::net::node_delegate.

Definition at line 5370 of file node.cpp.

◆ get_call_statistics()

fc::variant_object graphene::net::detail::statistics_gathering_node_delegate_wrapper::get_call_statistics ( )

Definition at line 5246 of file node.cpp.

◆ get_chain_id()

chain_id_type graphene::net::detail::statistics_gathering_node_delegate_wrapper::get_chain_id ( ) const
overridevirtual

Implements graphene::net::node_delegate.

Definition at line 5365 of file node.cpp.

◆ get_current_block_interval_in_seconds()

uint8_t graphene::net::detail::statistics_gathering_node_delegate_wrapper::get_current_block_interval_in_seconds ( ) const
overridevirtual

Implements graphene::net::node_delegate.

Definition at line 5412 of file node.cpp.

◆ get_head_block_id()

item_hash_t graphene::net::detail::statistics_gathering_node_delegate_wrapper::get_head_block_id ( ) const
overridevirtual

Implements graphene::net::node_delegate.

Definition at line 5397 of file node.cpp.

◆ get_item()

message graphene::net::detail::statistics_gathering_node_delegate_wrapper::get_item ( const item_id id)
overridevirtual

Given the hash of the requested data, fetch the body.

Implements graphene::net::node_delegate.

Definition at line 5360 of file node.cpp.

◆ handle_block()

bool graphene::net::detail::statistics_gathering_node_delegate_wrapper::handle_block ( const graphene::net::block_message blk_msg,
bool  sync_mode,
std::vector< message_hash_type > &  contained_transaction_msg_ids 
)
overridevirtual

Called when a new block comes in from the network.

Parameters
blk_msgthe message which contains the block
sync_modetrue if the message was fetched through the sync process, false during normal operation
contained_transaction_msg_idscontainer for the transactions to write back into
Returns
true if this message caused the blockchain to switch forks, false if it did not
Exceptions
exceptionif error validating the item, otherwise the item is safe to broadcast on.

Implements graphene::net::node_delegate.

Definition at line 5342 of file node.cpp.

◆ handle_message()

void graphene::net::detail::statistics_gathering_node_delegate_wrapper::handle_message ( const message message_to_process)
overridevirtual

Called when a new message comes in from the network other than a block or a transaction. Currently there are no other possible messages, so this should never be called.

Exceptions
exceptionif error validating the item, otherwise the item is safe to broadcast on.

Implements graphene::net::node_delegate.

Definition at line 5337 of file node.cpp.

◆ handle_transaction()

void graphene::net::detail::statistics_gathering_node_delegate_wrapper::handle_transaction ( const graphene::net::trx_message trx_msg)
overridevirtual

Called when a new transaction comes in from the network.

Exceptions
exceptionif error validating the item, otherwise the item is safe to broadcast on.

Implements graphene::net::node_delegate.

Definition at line 5348 of file node.cpp.

◆ has_item()

bool graphene::net::detail::statistics_gathering_node_delegate_wrapper::has_item ( const graphene::net::item_id id)
overridevirtual

If delegate has the item, the network has no need to fetch it.

Implements graphene::net::node_delegate.

Definition at line 5332 of file node.cpp.

◆ sync_status()

void graphene::net::detail::statistics_gathering_node_delegate_wrapper::sync_status ( uint32_t  item_type,
uint32_t  item_count 
)
overridevirtual

Call this after the call to handle_message succeeds.

Parameters
item_typethe type of the item we're synchronizing, will be the same as item passed to the sync_from() call
item_countthe number of items known to the node that haven't been sent to handle_item() yet. After item_count more calls to handle_item(), the node will be in sync

Implements graphene::net::node_delegate.

Definition at line 5375 of file node.cpp.


The documentation for this class was generated from the following files: