Browse Source

use BIP45 by default

activeAddress
Ivan Socolsky 10 years ago
parent
commit
004890bd6b
  1. 3
      lib/model/copayer.js
  2. 4
      lib/model/wallet.js
  3. 7
      lib/server.js

3
lib/model/copayer.js

@ -37,7 +37,8 @@ Copayer.create = function(opts) {
}];
x.addressManager = AddressManager.create({
copayerIndex: opts.copayerIndex
derivationStrategy: 'BIP45',
copayerIndex: opts.copayerIndex,
});
x.customData = opts.customData;

4
lib/model/wallet.js

@ -29,7 +29,9 @@ Wallet.create = function(opts) {
x.copayers = [];
x.pubKey = opts.pubKey;
x.network = opts.network;
x.addressManager = AddressManager.create();
x.addressManager = AddressManager.create({
derivationStrategy: 'BIP45',
});
x.scanStatus = null;
return x;

7
lib/server.js

@ -941,7 +941,10 @@ WalletService.prototype._selectTxInputs = function(txp, utxosToExclude, cb) {
self.getUtxos({}, function(err, utxos) {
if (err) return cb(err);
var excludeIndex = _.reduce(utxosToExclude, function(res, val) { res[val] = val; return res; }, {});
var excludeIndex = _.reduce(utxosToExclude, function(res, val) {
res[val] = val;
return res;
}, {});
utxos = _.reject(utxos, function(utxo) {
return excludeIndex[utxo.txid + ":" + utxo.vout];
@ -1817,10 +1820,12 @@ WalletService.prototype.scan = function(opts, cb) {
});
if (opts.includeCopayerBranches) {
_.each(wallet.copayers, function(copayer) {
if (copayer.addressManager.supportsDerivation()) {
derivators.push({
derive: _.bind(copayer.createAddress, copayer, wallet, isChange),
rewind: _.bind(copayer.addressManager.rewindIndex, copayer.addressManager, isChange),
});
}
});
}
});

Loading…
Cancel
Save