Skip to content

Commit c0d8351

Browse files
committed
fix: prioritize blocktank over mempool.space
1 parent 63ae06a commit c0d8351

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/utils/lightning/index.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -321,21 +321,21 @@ export const getFees: TGetFees = async () => {
321321
try {
322322
fees = await new Promise<IOnchainFees>((resolve, reject) => {
323323
// try twice
324-
const mpPromise = Promise.race([
325-
fetchMp().catch(fetchMp),
326-
throwTimeout(10000),
327-
]);
328324
const btPromise = Promise.race([
329325
fetchBt().catch(fetchBt),
330326
throwTimeout(10000),
327+
]);
328+
const mpPromise = Promise.race([
329+
fetchMp().catch(fetchMp),
330+
throwTimeout(10000),
331331
]).catch(() => null); // Prevent unhandled rejection
332332

333-
// prioritize mempool.space over blocktank
334-
mpPromise.then(resolve).catch(() => {
335-
btPromise
336-
.then((btFees) => {
337-
if (btFees !== null) {
338-
resolve(btFees);
333+
// prioritize blocktank over mempool.space
334+
btPromise.then(resolve).catch(() => {
335+
mpPromise
336+
.then((mpFees) => {
337+
if (mpFees !== null) {
338+
resolve(mpFees);
339339
} else {
340340
reject(new Error('Failed to fetch fees'));
341341
}

0 commit comments

Comments
 (0)