diff --git a/lib/bcoin/wallet.js b/lib/bcoin/wallet.js index 97b565be..39395ee2 100644 --- a/lib/bcoin/wallet.js +++ b/lib/bcoin/wallet.js @@ -705,11 +705,11 @@ Wallet.prototype.getInputPaths = function getInputPaths(tx, callback) { }); } - utils.forEachSerial(tx.inputs, function(input, next, i) { - if (!input.coin) - return next(new Error('Not all coins available.')); + if (!tx.hasCoins()) + return next(new Error('Not all coins available.')); - self.getPath(input.coin.getHash(), function(err, path) { + utils.forEachSerial(tx.getInputHashes(), function(hash, next, i) { + self.getPath(hash, function(err, path) { if (err) return next(err); @@ -723,7 +723,7 @@ Wallet.prototype.getInputPaths = function getInputPaths(tx, callback) { }, function(err) { if (err) return callback(err); - return callback(null, utils.uniq(paths)); + return callback(null, paths); }); }; @@ -747,8 +747,8 @@ Wallet.prototype.getOutputPaths = function getOutputPaths(tx, callback) { }); } - utils.forEachSerial(tx.outputs, function(output, next, i) { - self.getPath(output.getHash(), function(err, path) { + utils.forEachSerial(tx.getOutputHashes(), function(hash, next, i) { + self.getPath(hash, function(err, path) { if (err) return next(err); @@ -762,7 +762,7 @@ Wallet.prototype.getOutputPaths = function getOutputPaths(tx, callback) { }, function(err) { if (err) return callback(err); - return callback(null, utils.uniq(paths)); + return callback(null, paths); }); };