update timestamp *after* processing messages

This commit is contained in:
Matias Alejo Garcia 2014-08-28 18:05:29 -03:00
parent ad4ebfdc3c
commit 534a5f6349
1 changed files with 2 additions and 1 deletions

View File

@ -317,10 +317,10 @@ Wallet.prototype._onData = function(senderId, data, ts) {
preconditions.checkArgument(ts);
preconditions.checkArgument(typeof ts === 'number');
this.updateTimestamp(ts);
if (data.type !== 'walletId' && this.id !== data.walletId) {
this.emit('corrupt', senderId);
this.updateTimestamp(ts);
return;
}
@ -356,6 +356,7 @@ Wallet.prototype._onData = function(senderId, data, ts) {
this._onDisconnect(senderId, data);
break;
}
this.updateTimestamp(ts);
};