Skip to content

Commit

Permalink
Merge pull request #123 from steemit/fix-expiration
Browse files Browse the repository at this point in the history
fix chain time access, remove local time fallback
  • Loading branch information
Fabien authored Apr 14, 2017
2 parents c7f9297 + d49fb3f commit 608e119
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "steem",
"version": "0.5.3",
"version": "0.5.4",
"description": "Steem.js the JavaScript API for Steem blockchain",
"main": "index.js",
"scripts": {
Expand Down
3 changes: 2 additions & 1 deletion src/broadcast/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 608e119

Please sign in to comment.