From d4869fb5d518f1ab7b925b85fef6392e941ba2ec Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Wed, 4 Jan 2017 17:34:19 +1100 Subject: [PATCH] Only send transactions if there are any in the array. --- src/stratifier.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/stratifier.c b/src/stratifier.c index 76bbbb8e..739b4b09 100644 --- a/src/stratifier.c +++ b/src/stratifier.c @@ -1263,9 +1263,12 @@ static void update_txns(ckpool_t *ckp, sdata_t *sdata, txntable_t *txns, bool lo } ck_wunlock(&sdata->workbase_lock); - JSON_CPACK(val, "{so}", "transaction", txn_array); - send_node_transactions(ckp, sdata, val); - json_decref(val); + if (json_array_size(txn_array)) { + JSON_CPACK(val, "{so}", "transaction", txn_array); + send_node_transactions(ckp, sdata, val); + json_decref(val); + } else + json_decref(txn_array); if (added || purged) { LOGINFO("Stratifier added %d %stransactions and purged %d", added,