index proposals in history for performace
This commit is contained in:
parent
0e6044ae6f
commit
32396c1ad4
1 changed files with 2 additions and 4 deletions
|
|
@ -2573,6 +2573,7 @@ Wallet.prototype.getTransactionHistory = function(opts, cb) {
|
|||
var proposals = self.getTxProposals();
|
||||
var satToUnit = 1 / self.settings.unitToSatoshi;
|
||||
|
||||
var indexedProposals = _.indexBy(proposal,'sentTxid');
|
||||
|
||||
|
||||
function extractInsOuts(tx) {
|
||||
|
|
@ -2664,10 +2665,7 @@ Wallet.prototype.getTransactionHistory = function(opts, cb) {
|
|||
tx.amount = tx.amountSat * satToUnit;
|
||||
tx.minedTs = !_.isNaN(tx.time) ? tx.time * 1000 : undefined;
|
||||
|
||||
var proposal = _.findWhere(proposals, {
|
||||
sentTxid: tx.txid
|
||||
});
|
||||
|
||||
var proposal = indexedProposals[tx.txid];
|
||||
if (proposal) {
|
||||
// TODO refactor
|
||||
tx.comment = proposal.comment;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue