From a61c23fa6a870c20fad12b9c3e993a7cfb0d6576 Mon Sep 17 00:00:00 2001 From: Daniel Larimer Date: Mon, 12 Oct 2015 12:06:26 -0400 Subject: [PATCH] reduce trx spam messages --- libraries/app/application.cpp | 11 ++++++++++- libraries/fc | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/libraries/app/application.cpp b/libraries/app/application.cpp index a3e01010..8fe24dfb 100644 --- a/libraries/app/application.cpp +++ b/libraries/app/application.cpp @@ -443,7 +443,16 @@ namespace detail { virtual void handle_transaction(const graphene::net::trx_message& transaction_message) override { try { - ilog("Got transaction from network"); + static fc::time_point last_call; + static int trx_count = 0; + ++trx_count; + auto now = fc::time_point::now(); + if( now - last_call > fc::seconds(1) ) { + ilog("Got ${c} transactions from network", ("c",trx_count) ); + last_call = now; + trx_count = 0; + } + _chain_db->push_transaction( transaction_message.trx ); } FC_CAPTURE_AND_RETHROW( (transaction_message) ) } diff --git a/libraries/fc b/libraries/fc index 1e10d3dc..64950043 160000 --- a/libraries/fc +++ b/libraries/fc @@ -1 +1 @@ -Subproject commit 1e10d3dc4774426e735eb6aabd8e0aa43799fe30 +Subproject commit 6495004302239ae0c775f05a0e78780c3b189502