correctly assign sentTxid when proposal is broadcasted

This commit is contained in:
Ivan Socolsky 2014-10-30 16:38:08 -03:00
commit 05e836424a
2 changed files with 5 additions and 4 deletions

View file

@ -72,6 +72,7 @@ angular.module('copayApp.controllers').controller('HistoryController',
} }
$scope.getShortNetworkName = function() { $scope.getShortNetworkName = function() {
var w = $rootScope.wallet;
return w.getNetworkName().substring(0, 4); return w.getNetworkName().substring(0, 4);
}; };
$scope.amountAlternative = function(amount, txIndex, cb) { $scope.amountAlternative = function(amount, txIndex, cb) {

View file

@ -442,7 +442,7 @@ Wallet.prototype._checkSentTx = function(ntxid, cb) {
this.blockchain.getTransaction(txid, function(err, tx) { this.blockchain.getTransaction(txid, function(err, tx) {
if (err) return cb(false); if (err) return cb(false);
return cb(ret); return cb(txid);
}); });
}; };
@ -477,10 +477,10 @@ Wallet.prototype._onTxProposal = function(senderId, data) {
var tx = m.txp.builder.build(); var tx = m.txp.builder.build();
if (tx.isComplete()) { if (tx.isComplete()) {
this._checkSentTx(m.ntxid, function(ret) { this._checkSentTx(m.ntxid, function(txid) {
if (ret) { if (txid) {
if (!m.txp.getSent()) { if (!m.txp.getSent()) {
m.txp.setSent(m.ntxid); m.txp.setSent(txid);
self.emitAndKeepAlive('txProposalsUpdated'); self.emitAndKeepAlive('txProposalsUpdated');
} }
} }