From 133dce6a37e634aebf6f9e41b8535393ac5f819e Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Thu, 10 May 2012 20:20:31 -0400 Subject: [PATCH 1/2] CTxMemPool: consolidate two frequently-printed debug.log lines into one Previously, a single TX would trigger two log lines in quick succession, addUnchecked(): size 152 CTxMemPool::accept() : accepted c4cfdd48b7 After this change, only one log line is used: CTxMemPool::accept() : accepted 98885e65db (poolsz 26) --- src/main.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index b0ed28aa..3cc18639 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -594,7 +594,9 @@ bool CTxMemPool::accept(CTxDB& txdb, CTransaction &tx, bool fCheckInputs, if (ptxOld) EraseFromWallets(ptxOld->GetHash()); - printf("CTxMemPool::accept() : accepted %s\n", hash.ToString().substr(0,10).c_str()); + printf("CTxMemPool::accept() : accepted %s (poolsz %u)\n", + hash.ToString().substr(0,10).c_str(), + mapTx.size()); return true; } @@ -605,7 +607,6 @@ bool CTransaction::AcceptToMemoryPool(CTxDB& txdb, bool fCheckInputs, bool* pfMi bool CTxMemPool::addUnchecked(CTransaction &tx) { - printf("addUnchecked(): size %lu\n", mapTx.size()); // Add to memory pool without checking anything. Don't call this directly, // call CTxMemPool::accept to properly check the transaction first. { From 33a53bc13b1ddb7b0d9ba74a87ab5ffd9d11b31f Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Thu, 10 May 2012 20:31:46 -0400 Subject: [PATCH 2/2] CTxMemPool::accept(): do not log FetchInputs failure redundantly FetchInputs already logs failures internally. This commit makes the logging more consistent with other FetchInputs callsites also. Prior to this commit, two log lines were logged for one condition: ERROR: FetchInputs() : de15fde415 mempool Tx prev not found a2c75da227 ERROR: CTxMemPool::accept() : FetchInputs failed de15fde415 After this commit, only one line is logged: ERROR: FetchInputs() : e0507ab2c7 mempool Tx prev not found 9a620262cd --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 3cc18639..98f9b71e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -527,7 +527,7 @@ bool CTxMemPool::accept(CTxDB& txdb, CTransaction &tx, bool fCheckInputs, return error("CTxMemPool::accept() : FetchInputs found invalid tx %s", hash.ToString().substr(0,10).c_str()); if (pfMissingInputs) *pfMissingInputs = true; - return error("CTxMemPool::accept() : FetchInputs failed %s", hash.ToString().substr(0,10).c_str()); + return false; } // Check for non-standard pay-to-script-hash in inputs