use cached history first
This commit is contained in:
parent
1cfd4c733f
commit
9ce67ed68a
1 changed files with 13 additions and 5 deletions
|
|
@ -503,15 +503,23 @@ angular.module('copayApp.services').factory('walletService', function($log, $tim
|
||||||
};
|
};
|
||||||
|
|
||||||
root.getTx = function(wallet, txid, cb) {
|
root.getTx = function(wallet, txid, cb) {
|
||||||
root.getTxHistory(wallet, {}, function(err, txHistory) {
|
if (wallet.completeHistory && wallet.completeHistory.isValid) {
|
||||||
if (err) return cb(err);
|
var tx = lodash.find(wallet.completeHistory, {
|
||||||
|
|
||||||
var tx = lodash.find(txHistory, {
|
|
||||||
txid: txid
|
txid: txid
|
||||||
});
|
});
|
||||||
|
|
||||||
return cb(null, tx);
|
return cb(null, tx);
|
||||||
});
|
} else {
|
||||||
|
root.getTxHistory(wallet, {}, function(err, txHistory) {
|
||||||
|
if (err) return cb(err);
|
||||||
|
|
||||||
|
var tx = lodash.find(txHistory, {
|
||||||
|
txid: txid
|
||||||
|
});
|
||||||
|
|
||||||
|
return cb(null, tx);
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
root.getTxHistory = function(wallet, opts, cb) {
|
root.getTxHistory = function(wallet, opts, cb) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue