Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

Commit

Permalink
Merge pull request #334 from aleitner/master
Browse files Browse the repository at this point in the history
Added validator to payout address field
  • Loading branch information
bookchin authored Aug 8, 2016
2 parents 588d6f1 + d4371e0 commit 5f95341
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/lib/userdata.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -117,7 +119,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);
};

/**
Expand Down

0 comments on commit 5f95341

Please sign in to comment.