diff --git a/js/controllers/history.js b/js/controllers/history.js index f5f0e465b..00fb3689c 100644 --- a/js/controllers/history.js +++ b/js/controllers/history.js @@ -72,6 +72,7 @@ angular.module('copayApp.controllers').controller('HistoryController', } $scope.getShortNetworkName = function() { + var w = $rootScope.wallet; return w.getNetworkName().substring(0, 4); }; $scope.amountAlternative = function(amount, txIndex, cb) { diff --git a/js/models/Wallet.js b/js/models/Wallet.js index a1b638a6b..66a391391 100644 --- a/js/models/Wallet.js +++ b/js/models/Wallet.js @@ -428,7 +428,7 @@ Wallet.prototype._checkSentTx = function(ntxid, cb) { this.blockchain.getTransaction(txid, function(err, tx) { if (err) return cb(false); - return cb(ret); + return cb(txid); }); }; @@ -463,10 +463,10 @@ Wallet.prototype._onTxProposal = function(senderId, data) { var tx = m.txp.builder.build(); if (tx.isComplete()) { - this._checkSentTx(m.ntxid, function(ret) { - if (ret) { + this._checkSentTx(m.ntxid, function(txid) { + if (txid) { if (!m.txp.getSent()) { - m.txp.setSent(m.ntxid); + m.txp.setSent(txid); self.emitAndKeepAlive('txProposalsUpdated'); } } diff --git a/test/Wallet.js b/test/Wallet.js index e64202d89..7090943ac 100644 --- a/test/Wallet.js +++ b/test/Wallet.js @@ -1609,10 +1609,11 @@ describe('Wallet model', function() { new: false, hasChanged: true, }); - w._checkSentTx = sinon.stub().yields(true); + w._checkSentTx = sinon.stub().yields('123'); w._onTxProposal('senderID', data); txp.setSent.calledOnce.should.be.true; + txp.setSent.calledWith('123').should.be.true; w.sendTxProposal.called.should.be.false; done(); });