FIX: increase lock

This commit is contained in:
Overtorment 2019-03-01 22:41:50 +00:00
parent 17cd8adf41
commit 3cbe38ed28
3 changed files with 22 additions and 1 deletions

View File

@ -24,7 +24,7 @@ export class Lock {
}
// success - got lock
await this._redis.expire(this._lock_key, 10 * 60);
await this._redis.expire(this._lock_key, 3600);
// lock expires in 5 mins just for any case
return true;
}

20
class/Paym.js Normal file
View File

@ -0,0 +1,20 @@
var crypto = require('crypto');
var lightningPayReq = require('bolt11');
import { BigNumber } from 'bignumber.js';
export class Paym {
constructor(redis, bitcoindrpc, lightning) {
this._redis = redis;
this._bitcoindrpc = bitcoindrpc;
this._lightning = lightning;
}
async decodePayReq(invoice) {
return new Promise(function(resolve, reject) {
this._lightning.decodePayReq({ pay_req: invoice }, function(err, info) {
if (err) return reject(err);
return resolve(info);
});
});
}
}

View File

@ -285,6 +285,7 @@ export class User {
let range = await this._redis.lrange('txs_for_' + this._userid, 0, -1);
for (let invoice of range) {
invoice = JSON.parse(invoice);
// console.log(invoice);process.exit();
invoice.type = 'paid_invoice';
// for internal invoices it might not have properties `payment_route` and `decoded`...