Increase duration of message cache from two blocks (which in practice meant anything > 1 block) to 30 blocks, and move the constant to config.hpp

This commit is contained in:
Eric Frias 2015-09-02 17:25:52 -04:00
parent cb2c5945b3
commit 5662a8423c
2 changed files with 9 additions and 1 deletions

View file

@ -51,6 +51,14 @@
#define GRAPHENE_NET_MAXIMUM_QUEUED_MESSAGES_IN_BYTES (1024 * 1024)
/**
* When we receive a message from the network, we advertise it to
* our peers and save a copy in a cache were we will find it if
* a peer requests it. We expire out old items out of the cache
* after this number of blocks go by.
*/
#define GRAPHENE_NET_MESSAGE_CACHE_DURATION_IN_BLOCKS 30
/**
* We prevent a peer from offering us a list of blocks which, if we fetched them
* all, would result in a blockchain that extended into the future.

View file

@ -120,7 +120,7 @@ namespace graphene { namespace net {
class blockchain_tied_message_cache
{
private:
static const uint32_t cache_duration_in_blocks = 2;
static const uint32_t cache_duration_in_blocks = GRAPHENE_NET_MESSAGE_CACHE_DURATION_IN_BLOCKS;
struct message_hash_index{};
struct message_contents_hash_index{};