throw if adminEmail and allowSubscriptions are not compatible

This commit is contained in:
ansuz 2017-05-30 16:27:42 +02:00
parent 76c530037b
commit 8507f77116

5
rpc.js
View file

@ -373,7 +373,10 @@ var getHash = function (Env, publicKey, cb) {
// To each key is associated an object containing the 'limit' value and a 'note' explaining that limit
var limits = {};
var updateLimits = function (config, publicKey, cb) {
if (config.adminEmail === false && config.allowSubscriptions === false) { return; }
if (config.adminEmail === false) {
if (config.allowSubscriptions === false) { return; }
throw new Error("allowSubscriptions must be false if adminEmail is false");
}
if (typeof cb !== "function") { cb = function () {}; }
var defaultLimit = typeof(config.defaultStorageLimit) === 'number'?