From 3b14263e5a41f439d84dc26688a937f22ce62998 Mon Sep 17 00:00:00 2001 From: Javier Smooth Date: Sat, 8 Aug 2015 15:44:01 -0700 Subject: [PATCH 1/2] Track failed outgoing connections and slow down retries --- src/p2p/net_node.inl | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl index 5c76f6e..65a42c4 100644 --- a/src/p2p/net_node.inl +++ b/src/p2p/net_node.inl @@ -644,6 +644,13 @@ namespace nodetool #undef LOG_PRINT_CC_PRIORITY_NODE + //----------------------------------------------------------------------------------- + template + void node_server::cache_connect_fail_info(const net_address& addr) + { + CRITICAL_REGION_LOCAL(m_conn_fails_cache_lock); + m_conn_fails_cache[addr] = time(NULL); + } //----------------------------------------------------------------------------------- template bool node_server::is_addr_recently_failed(const net_address& addr) @@ -703,8 +710,10 @@ namespace nodetool << "] last_seen: " << (pe.last_seen ? epee::misc_utils::get_time_interval_string(time(NULL) - pe.last_seen) : "never")); if(!try_to_connect_and_handshake_with_new_peer(pe.adr, false, pe.last_seen, use_white_list)) + { + cache_connect_fail_info(pe.adr); continue; - + } return true; } return false; From ca3b36dfeb114e93da57c2d01961e8195b9dbbed Mon Sep 17 00:00:00 2001 From: Javier Smooth Date: Tue, 11 Aug 2015 00:45:58 -0700 Subject: [PATCH 2/2] Increase default transaction fee to 0.01 --- src/cryptonote_config.h | 8 ++++---- src/cryptonote_core/tx_pool.cpp | 8 ++++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/cryptonote_config.h b/src/cryptonote_config.h index e7b1f7b..263814c 100644 --- a/src/cryptonote_config.h +++ b/src/cryptonote_config.h @@ -59,10 +59,10 @@ #define CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE 20000 //size of block (bytes) after which reward for block calculated using block size #define CRYPTONOTE_COINBASE_BLOB_RESERVED_SIZE 600 #define CRYPTONOTE_DISPLAY_DECIMAL_POINT 12 -// COIN - number of smallest units in one coin -#define COIN ((uint64_t)100000000) // pow(10, 8) -#define DEFAULT_FEE ((uint64_t)1000000) // pow(10, 6) - +// COIN - number of smallest units in one coin (currently unused except by tests) +#define COIN ((uint64_t)1000000000000) // pow(10, 12) +#define DEFAULT_FEE ((uint64_t)10000000000) // pow(10, 10) +#define MINIMUM_RELAY_FEE ((uint64_t)1000000) // pow(10, 6) #define ORPHANED_BLOCKS_MAX_COUNT 100 diff --git a/src/cryptonote_core/tx_pool.cpp b/src/cryptonote_core/tx_pool.cpp index 6f67464..e7acae0 100644 --- a/src/cryptonote_core/tx_pool.cpp +++ b/src/cryptonote_core/tx_pool.cpp @@ -86,7 +86,7 @@ namespace cryptonote } uint64_t fee = inputs_amount - outputs_amount; - if (!kept_by_block && fee < DEFAULT_FEE) + if (!kept_by_block && fee < MINIMUM_RELAY_FEE) { LOG_ERROR("transaction fee is not enough: " << print_money(fee) << ", minumim fee: " << print_money(DEFAULT_FEE)); tvc.m_verifivation_failed = true; @@ -449,9 +449,13 @@ namespace cryptonote if (total_size > median_size) break; + // Don't mine transactions with too-low fee + if (DEFAULT_FEE > MINIMUM_RELAY_FEE && tx.second.fee < DEFAULT_FEE) + continue; + // Skip transactions that are not ready to be // included into the blockchain or that are - // missing key images + // double spends of another transaction already in the template if (!is_transaction_ready_to_go(tx.second) || have_key_images(k_images, tx.second.tx)) continue;