throttling P2P code

This commit is contained in:
Daniel Larimer 2015-10-05 08:44:59 -04:00
parent 93a108487d
commit bb0ea77e80
3 changed files with 3 additions and 13 deletions

@ -1 +1 @@
Subproject commit 83a9e4d7c859df37ceed6a427c493b852eac0cac
Subproject commit dacdb997f885d837c48ea3d8f8fa57cb27a82c23

View file

@ -71,11 +71,9 @@
*/
#define GRAPHENE_NET_FUTURE_SYNC_BLOCKS_GRACE_PERIOD_SEC (60 * 60)
#define GRAPHENE_NET_INSUFFICIENT_RELAY_FEE_PENALTY_SEC 15
#define GRAPHENE_NET_MAX_INVENTORY_SIZE_IN_MINUTES 2
#define GRAPHENE_NET_MAX_BLOCKS_PER_PEER_DURING_SYNCING 100
#define GRAPHENE_NET_MAX_BLOCKS_PER_PEER_DURING_SYNCING 200
/**
* During normal operation, how many items will be fetched from each
@ -88,7 +86,7 @@
* parameter, so consider increasing or decreasing it if performance
* during flooding is lacking.
*/
#define GRAPHENE_NET_MAX_ITEMS_PER_PEER_DURING_NORMAL_OPERATION 50
#define GRAPHENE_NET_MAX_ITEMS_PER_PEER_DURING_NORMAL_OPERATION 1
/**
* Instead of fetching all item IDs from a peer, then fetching all blocks

View file

@ -3784,14 +3784,6 @@ namespace graphene { namespace net { namespace detail {
_delegate->handle_message( message_to_process );
message_validated_time = fc::time_point::now();
}
catch ( const insufficient_relay_fee& )
{
// flooding control. The message was valid but we can't handle it now.
assert(message_to_process.msg_type == graphene::net::trx_message_type); // we only support throttling transactions.
if (message_to_process.msg_type == graphene::net::trx_message_type)
originating_peer->transaction_fetching_inhibited_until = fc::time_point::now() + fc::seconds(GRAPHENE_NET_INSUFFICIENT_RELAY_FEE_PENALTY_SEC);
return;
}
catch ( const fc::canceled_exception& )
{
throw;