Commit 608e1199 authored by Fabien's avatar Fabien Committed by GitHub

Merge pull request #123 from steemit/fix-expiration

fix chain time access, remove local time fallback
parents c7f9297d d49fb3fb
{
"name": "steem",
"version": "0.5.3",
"version": "0.5.4",
"description": "Steem.js the JavaScript API for Steem blockchain",
"main": "index.js",
"scripts": {
......
......@@ -53,11 +53,12 @@ steemBroadcast._prepareTransaction = function steemBroadcast$_prepareTransaction
return propertiesP
.then((properties) => {
// Set defaults on the transaction
const chainDate = new Date(properties.time + 'Z');
return Object.assign({
ref_block_num: properties.head_block_number & 0xFFFF,
ref_block_prefix: new Buffer(properties.head_block_id, 'hex').readUInt32LE(4),
expiration: new Date(
(properties.timestamp || Date.now()) +
chainDate.getTime() +
15 * 1000
),
}, tx);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment