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