From 21443591d5002068154e598d88e5003bf3df62e1 Mon Sep 17 00:00:00 2001 From: Dang Nguyen Date: Tue, 5 Mar 2019 11:44:45 +0700 Subject: [PATCH] lib/transaction: backward 5 minutes --- lib/transaction/transaction.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/transaction/transaction.js b/lib/transaction/transaction.js index 6f21ad946..511add525 100644 --- a/lib/transaction/transaction.js +++ b/lib/transaction/transaction.js @@ -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);