|
|
@ -87,6 +87,8 @@ ClientLib.prototype._loadAndCheck = function() { |
|
|
|
ClientLib.prototype.createWallet = function(walletName, copayerName, m, n, network, cb) { |
|
|
|
var self = this; |
|
|
|
network = network || 'livenet'; |
|
|
|
if (!_.contains(['testnet', 'livenet'], network)) |
|
|
|
return cb('Invalid network'); |
|
|
|
|
|
|
|
var data = this._load(); |
|
|
|
if (data) return cb('File ' + this.filename + ' already contains a wallet'); |
|
|
@ -122,7 +124,7 @@ ClientLib.prototype.createWallet = function(walletName, copayerName, m, n, netwo |
|
|
|
} |
|
|
|
|
|
|
|
var walletId = body.walletId; |
|
|
|
var secret = walletId + ':' + privKey.toString() + ':' + (network ? 'T' : 'L'); |
|
|
|
var secret = walletId + ':' + privKey.toString() + ':' + (network == 'testnet' ? 'T' : 'L'); |
|
|
|
data.secret = secret; |
|
|
|
|
|
|
|
self._save(data); |
|
|
|