Browse Source

fix

master^2
Evan Feenstra 4 years ago
parent
commit
9d35458740
  1. 9
      dist/src/controllers/queries.js
  2. 2
      dist/src/controllers/queries.js.map
  3. 7
      src/controllers/queries.ts

9
dist/src/controllers/queries.js

@ -78,6 +78,7 @@ function getSuggestedSatPerByte() {
// https://mempool.space/api/v1/fees/recommended
function genChannelAndConfirmAccounting(acc) {
return __awaiter(this, void 0, void 0, function* () {
console.log("[WATCH]=> genChannelAndConfirmAccounting");
const sat_per_byte = yield getSuggestedSatPerByte();
console.log("[WATCH]=> sat_per_byte", sat_per_byte);
try {
@ -109,8 +110,12 @@ function pollUTXOs() {
return;
console.log("[WATCH]=> accs", accs.length);
asyncForEach(accs, (acc) => __awaiter(this, void 0, void 0, function* () {
if (acc.confirmations < 1)
return;
if (acc.confirmations <= 0)
return; // needs confs
if (acc.amount <= 0)
return; // needs amount
if (!acc.pubkey)
return; // this shouldnt happen
yield genChannelAndConfirmAccounting(acc);
}));
});

2
dist/src/controllers/queries.js.map

File diff suppressed because one or more lines are too long

7
src/controllers/queries.ts

@ -82,6 +82,7 @@ async function getSuggestedSatPerByte(): Promise<number> {
// https://mempool.space/api/v1/fees/recommended
async function genChannelAndConfirmAccounting(acc: Accounting) {
console.log("[WATCH]=> genChannelAndConfirmAccounting")
const sat_per_byte = await getSuggestedSatPerByte()
console.log("[WATCH]=> sat_per_byte", sat_per_byte)
try {
@ -109,8 +110,10 @@ async function pollUTXOs() {
const accs: Accounting[] = await getPendingAccountings()
if (!accs) return
console.log("[WATCH]=> accs", accs.length)
asyncForEach(accs, async acc=>{
if (acc.confirmations < 1) return
asyncForEach(accs, async (acc:Accounting)=>{
if (acc.confirmations <= 0) return // needs confs
if (acc.amount <= 0) return // needs amount
if (!acc.pubkey) return // this shouldnt happen
await genChannelAndConfirmAccounting(acc)
})
}

Loading…
Cancel
Save