Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

Commit

Permalink
Merge 9bae3fe into b587605
Browse files Browse the repository at this point in the history
  • Loading branch information
plondon committed Sep 1, 2017
2 parents b587605 + 9bae3fe commit 7aa5a7f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,14 @@ Helpers.guessFee = function (nInputs, nOutputs, feePerKb) {
return Math.ceil(feePerKb * (sizeBytes / 1000));
};

Helpers.toMilliseconds = function (n, unit) {
var units = {
seconds: 1000,
minutes: 60000
};
return n * units[unit];
};

// password scorer
Helpers.scorePassword = function (password) {
if (!Helpers.isString(password)) { return 0; }
Expand Down
4 changes: 3 additions & 1 deletion src/shift/quote.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/* eslint-disable semi */
const Helpers = require('../helpers')

class Quote {
constructor (obj) {
this._orderId = obj.orderId
Expand All @@ -8,8 +10,8 @@ class Quote {
this._withdrawal = obj.withdrawal
this._withdrawalAmount = obj.withdrawalAmount
this._minerFee = obj.minerFee
this._expiration = new Date(obj.expiration)
this._quotedRate = obj.quotedRate
this._expiration = new Date(obj.expiration - Helpers.toMilliseconds(5, 'minutes'));
}

get orderId () {
Expand Down

0 comments on commit 7aa5a7f

Please sign in to comment.