Expired transaction after bugfix (#121)

* other minor fixes

* reedemable transaction expiry fix
This commit is contained in:
Fabio Cigliano 2018-06-13 01:15:58 +12:00 committed by Josh Harvey
parent 25030fab2a
commit 63e0782e32
3 changed files with 13 additions and 3 deletions

View file

@ -6,7 +6,7 @@ const T = require('./time')
const BN = require('./bn')
const settingsLoader = require('./settings-loader')
const TRANSACTION_EXPIRATION = 2 * T.days
const TRANSACTION_EXPIRATION = T.day
function httpError (msg, code) {
const err = new Error(msg)
@ -49,7 +49,7 @@ function toCashOutTx (row) {
function fetchPhoneTx (phone) {
const sql = `select * from cash_out_txs
where phone=$1 and dispense=$2
and (extract(epoch from (coalesce(confirmed_at, now()) - created))) * 1000 < $3`
and (extract(epoch from (now() - created))) * 1000 < $3`
const values = [phone, false, TRANSACTION_EXPIRATION]