From 5b45e9225080ea848ab1bc909b55570a9020ff6a Mon Sep 17 00:00:00 2001 From: ansuz Date: Thu, 14 Sep 2017 12:08:41 +0200 Subject: [PATCH] delete range requests after they have completed --- www/common/common-messenger.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/www/common/common-messenger.js b/www/common/common-messenger.js index f40b85ae8..476e60b52 100644 --- a/www/common/common-messenger.js +++ b/www/common/common-messenger.js @@ -129,6 +129,10 @@ define([ return messenger.range_requests[txid]; }; + var deleteRangeRequest = function (txid) { + delete messenger.range_requests[txid]; + }; + messenger.getMoreHistory = function (curvePublic, hash, count, cb) { if (typeof(cb) !== 'function') { return; } @@ -393,7 +397,8 @@ define([ }); orderMessages(curvePublic, decrypted, req.sig); - return void req.cb(void 0, decrypted); + req.cb(void 0, decrypted); + return deleteRangeRequest(txid); } else { console.log(parsed); }