Browse Source

add preconditons

activeAddress
Matias Alejo Garcia 10 years ago
parent
commit
57532242a4
  1. 0
      bit-wallet/bit-reject
  2. 0
      bit-wallet/bit-rm
  3. 4
      lib/client/api.js

0
bit-wallet/bit-reject

0
bit-wallet/bit-rm

4
lib/client/api.js

@ -284,14 +284,12 @@ API.prototype.createAddress = function(cb) {
var self = this;
var data = this._loadAndCheck();
$.checkState(data.publicKeyRing.length != data.n, 'Wallet Incomplete, cannot derive address.');
var url = '/v1/addresses/';
this._doPostRequest(url, {}, data, function(err, address) {
if (err) return cb(err);
if (data.publicKeyRing.length != data.n)
return cb('Wallet Incomplete, cannot derive address.')
if (!Verifier.checkAddress(data, address)) {
return cb(new ServerCompromisedError('Server sent fake address'));
}

Loading…
Cancel
Save