improve path getting.
This commit is contained in:
parent
2e5df5514a
commit
59755841f9
@ -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);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user