MCPcopy Create free account
hub / github.com/cryptonomex/graphene / request_sync_items_from_peer

Method request_sync_items_from_peer

libraries/net/node.cpp:1011–1023  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1009 }
1010
1011 void node_impl::request_sync_items_from_peer( const peer_connection_ptr& peer, const std::vector<item_hash_t>& items_to_request )
1012 {
1013 VERIFY_CORRECT_THREAD();
1014 dlog( "requesting ${item_count} item(s) ${items_to_request} from peer ${endpoint}",
1015 ("item_count", items_to_request.size())("items_to_request", items_to_request)("endpoint", peer->get_remote_endpoint()) );
1016 for (const item_hash_t& item_to_request : items_to_request)
1017 {
1018 _active_sync_requests.insert( active_sync_requests_map::value_type(item_to_request, fc::time_point::now() ) );
1019 item_id item_id_to_request( graphene::net::block_message_type, item_to_request );
1020 peer->sync_items_requested_from_peer.insert( peer_connection::item_to_time_map_type::value_type(item_id_to_request, fc::time_point::now() ) );
1021 }
1022 peer->send_message(fetch_items_message(graphene::net::block_message_type, items_to_request));
1023 }
1024
1025 void node_impl::fetch_sync_items_loop()
1026 {

Callers

nothing calls this directly

Calls 5

nowFunction · 0.85
fetch_items_messageClass · 0.85
sizeMethod · 0.45
get_remote_endpointMethod · 0.45
send_messageMethod · 0.45

Tested by

no test coverage detected