From b046e5c01be4022a4cf674bac093e0ca8315c806 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Fri, 5 Feb 2016 17:40:29 +1100 Subject: [PATCH] Don't increment the refcounter when adding transactions on the main pool to avoid getting ahead of nodes and set default refcount to 10 minutes backlog of 20 workinfos --- src/stratifier.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/stratifier.c b/src/stratifier.c index 4a111646..ba667b6c 100644 --- a/src/stratifier.c +++ b/src/stratifier.c @@ -1119,26 +1119,21 @@ static void broadcast_ping(sdata_t *sdata); * existing transactions to determine which need to be propagated */ static void add_txn(sdata_t *sdata, txntable_t **txns, const char *hash, const char *data) { - bool found = false; txntable_t *txn; /* Look for transactions we already know about and increment their * refcount if we're still using them. */ ck_rlock(&sdata->workbase_lock); HASH_FIND_STR(sdata->txns, hash, txn); - if (txn) { - txn->refcount++; - found = true; - } ck_runlock(&sdata->workbase_lock); - if (found) + if (txn) return; txn = ckzalloc(sizeof(txntable_t)); memcpy(txn->hash, hash, 65); txn->data = strdup(data); - txn->refcount = 10; + txn->refcount = 20; HASH_ADD_STR(*txns, hash, txn); }