From 9bf9130b9d2dcdbeac002679c05a8f54d31c7f15 Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 4 Jul 2017 17:02:29 +0200 Subject: [PATCH] fix error in pin reset --- rpc.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/rpc.js b/rpc.js index 3a97dc80d..83f2010a2 100644 --- a/rpc.js +++ b/rpc.js @@ -583,9 +583,10 @@ var resetUserPins = function (Env, publicKey, channelList, cb) { if (e) { return void cb(e); } var pinSize = sumChannelSizes(sizes); - getFreeSpace(Env, publicKey, function (e, free) { + + getLimit(Env, publicKey, function (e, limit) { if (e) { - WARN('getFreeSpace', e); + WARN('[RESET_ERR]', e); return void cb(e); } @@ -597,7 +598,7 @@ var resetUserPins = function (Env, publicKey, channelList, cb) { They will not be able to pin additional pads until they upgrade or delete enough files to go back under their limit. */ - if (pinSize > free && session.hasPinned) { return void(cb('E_OVER_LIMIT')); } + if (pinSize > limit && session.hasPinned) { return void(cb('E_OVER_LIMIT')); } pinStore.message(publicKey, JSON.stringify(['RESET', channelList]), function (e) { if (e) { return void cb(e); }