BitShares-Core  5.0.0
BitShares blockchain implementation and command-line interface 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 (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< fc::uint160_t > &contained_transaction_message_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 ()
 

Detailed Description

Definition at line 139 of file node_impl.hxx.

Constructor & Destructor Documentation

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

Definition at line 5110 of file node.cpp.

Member Function Documentation

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 5250 of file node.cpp.

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 5277 of file node.cpp.

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 5272 of file node.cpp.

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 5223 of file node.cpp.

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 5255 of file node.cpp.

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 5262 of file node.cpp.

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 5240 of file node.cpp.

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

Definition at line 5117 of file node.cpp.

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

Implements graphene::net::node_delegate.

Definition at line 5235 of file node.cpp.

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 5282 of file node.cpp.

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 5267 of file node.cpp.

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 5230 of file node.cpp.

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

Called when a new block comes in from the network.

Parameters
sync_modetrue if the message was fetched through the sync process, false during normal operation
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 5213 of file node.cpp.

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 5208 of file node.cpp.

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 5218 of file node.cpp.

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 5203 of file node.cpp.

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 5245 of file node.cpp.


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