diff --git a/lib/model/copayer.js b/lib/model/copayer.js index bccdc81..d7cce72 100644 --- a/lib/model/copayer.js +++ b/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; diff --git a/lib/model/wallet.js b/lib/model/wallet.js index 3fc507c..5b632a6 100644 --- a/lib/model/wallet.js +++ b/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; diff --git a/lib/server.js b/lib/server.js index df018f3..68ce60f 100644 --- a/lib/server.js +++ b/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) { - derivators.push({ - derive: _.bind(copayer.createAddress, copayer, wallet, isChange), - rewind: _.bind(copayer.addressManager.rewindIndex, copayer.addressManager, isChange), - }); + if (copayer.addressManager.supportsDerivation()) { + derivators.push({ + derive: _.bind(copayer.createAddress, copayer, wallet, isChange), + rewind: _.bind(copayer.addressManager.rewindIndex, copayer.addressManager, isChange), + }); + } }); } });