FIX: increase lock
This commit is contained in:
parent
17cd8adf41
commit
3cbe38ed28
@ -24,7 +24,7 @@ export class Lock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// success - got 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
|
// lock expires in 5 mins just for any case
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
20
class/Paym.js
Normal file
20
class/Paym.js
Normal 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);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
@ -285,6 +285,7 @@ export class User {
|
|||||||
let range = await this._redis.lrange('txs_for_' + this._userid, 0, -1);
|
let range = await this._redis.lrange('txs_for_' + this._userid, 0, -1);
|
||||||
for (let invoice of range) {
|
for (let invoice of range) {
|
||||||
invoice = JSON.parse(invoice);
|
invoice = JSON.parse(invoice);
|
||||||
|
// console.log(invoice);process.exit();
|
||||||
invoice.type = 'paid_invoice';
|
invoice.type = 'paid_invoice';
|
||||||
|
|
||||||
// for internal invoices it might not have properties `payment_route` and `decoded`...
|
// for internal invoices it might not have properties `payment_route` and `decoded`...
|
||||||
|
Loading…
x
Reference in New Issue
Block a user