From 2bbcc70ff10190111ab783c920e3ca4e98ab23ec Mon Sep 17 00:00:00 2001 From: Alexander Blair Date: Fri, 19 May 2017 17:16:26 -0700 Subject: [PATCH] New share handler again. With catch for error. --- lib/local_comms.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/local_comms.js b/lib/local_comms.js index 19583a9..733524b 100644 --- a/lib/local_comms.js +++ b/lib/local_comms.js @@ -274,7 +274,11 @@ function Database(){ let sharesSeen = 0; shares[key].forEach(function(final_share){ sharesSeen += 1; - txn.putBinary(global.database.shareDB, parseInt(key), global.protos.Share.encode(final_share)); + try { + txn.putBinary(global.database.shareDB, parseInt(key), global.protos.Share.encode(final_share)); + } catch (e) { + debug(final_share); + } if (Object.keys(shares).length === blocksSeen && sharesSeen === shares[key].length){ debug('Made it to where I can do the insert'); txn.commit();