From d4371e014df8d768a24b291c64ee63cb864e5885 Mon Sep 17 00:00:00 2001 From: aleitner Date: Mon, 8 Aug 2016 10:21:56 -0400 Subject: [PATCH] Added validator to payout address field --- app/lib/userdata.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/lib/userdata.js b/app/lib/userdata.js index 5316364..94ddff7 100644 --- a/app/lib/userdata.js +++ b/app/lib/userdata.js @@ -4,6 +4,8 @@ var assert = require('assert'); var fs = require('fs'); var Tab = require('./tab'); var merge = require('merge'); +var storj = require('storj'); +var bitcore = storj.deps.bitcore; /** * Initializes user data handler @@ -116,7 +118,8 @@ UserData.prototype._migrateLegacyConfig = function(config) { * @param {String} address */ UserData.prototype._isValidPayoutAddress = function(address) { - return !!(address && typeof address !== 'undefined'); + return bitcore.Address.isValid(address) || + bitcore.Address.isValid(address, bitcore.Networks.testnet); }; /**