Skip to content

Commit

Permalink
lib/transaction: backward 5 minutes
Browse files Browse the repository at this point in the history
  • Loading branch information
Dang Nguyen committed Mar 5, 2019
1 parent 0d2074d commit 2144359
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/transaction/transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,8 @@ Transaction.prototype.toBufferWriter = function(writer, noWitness) {
writer.write(new Buffer('0001', 'hex'));
}

writer.writeInt32LE(Math.round(new Date().getTime()/1000));
// backward 5 minutes to ensure timestamp not bigger than latest block in crypto node
writer.writeInt32LE(Math.round(new Date().getTime()/1000 - 5*60));

writer.writeVarintNum(this.inputs.length);

Expand Down

0 comments on commit 2144359

Please sign in to comment.