|
@ -41,6 +41,8 @@ function CopayServer(opts) { |
|
|
CopayServer.prototype.createWallet = function (opts, cb) { |
|
|
CopayServer.prototype.createWallet = function (opts, cb) { |
|
|
var self = this; |
|
|
var self = this; |
|
|
|
|
|
|
|
|
|
|
|
// TODO: validate opts.pubKey is valid and belongs to opts.network
|
|
|
|
|
|
|
|
|
self.storage.fetchWallet(opts.id, function (err, wallet) { |
|
|
self.storage.fetchWallet(opts.id, function (err, wallet) { |
|
|
if (err) return cb(err); |
|
|
if (err) return cb(err); |
|
|
if (wallet) return cb('Wallet already exists'); |
|
|
if (wallet) return cb('Wallet already exists'); |
|
|