Preserve sent timestamp for incoming proposals

This commit is contained in:
Ivan Socolsky 2014-10-06 18:51:45 -03:00
commit 9d5b26f526
3 changed files with 42 additions and 4 deletions

View file

@ -255,7 +255,9 @@ TxProposal.prototype.setSent = function(sentTxid) {
this.sentTs = Date.now();
};
TxProposal.prototype.getSent = function(sentTxid) {
return !!this.sentTxid;
}
TxProposal.prototype._allSignatures = function() {
var ret = {};

View file

@ -405,9 +405,11 @@ Wallet.prototype._onTxProposal = function(senderId, data) {
if (tx.isComplete()) {
this._checkSentTx(m.ntxid, function(ret) {
if (ret) {
m.txp.setSent(m.ntxid);
self.emit('txProposalsUpdated');
self.store();
if (!m.txp.getSent()) {
m.txp.setSent(m.ntxid);
self.emit('txProposalsUpdated');
self.store();
}
}
});
} else {