Skip to content

Commit 608e119

Browse files
author
Fabien
authored
Merge pull request #123 from steemit/fix-expiration
fix chain time access, remove local time fallback
2 parents c7f9297 + d49fb3f commit 608e119

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "steem",
3-
"version": "0.5.3",
3+
"version": "0.5.4",
44
"description": "Steem.js the JavaScript API for Steem blockchain",
55
"main": "index.js",
66
"scripts": {

src/broadcast/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,12 @@ steemBroadcast._prepareTransaction = function steemBroadcast$_prepareTransaction
5353
return propertiesP
5454
.then((properties) => {
5555
// Set defaults on the transaction
56+
const chainDate = new Date(properties.time + 'Z');
5657
return Object.assign({
5758
ref_block_num: properties.head_block_number & 0xFFFF,
5859
ref_block_prefix: new Buffer(properties.head_block_id, 'hex').readUInt32LE(4),
5960
expiration: new Date(
60-
(properties.timestamp || Date.now()) +
61+
chainDate.getTime() +
6162
15 * 1000
6263
),
6364
}, tx);

0 commit comments

Comments
 (0)