Skip to content

Commit

Permalink
feat(mutinynet): cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
thebrandonlucas committed Apr 22, 2024
1 parent 3326358 commit 8ee3dee
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/app/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,13 @@ export function decodeLightningInvoice(
try {
return lightningPayReq.decode(invoice);
} catch (e) {
const err = e as Error;
// NOTE: is there a way to get network for the current account from here?
// This catch-and-rethrow is a workaround for us not having the network
const mutinynet = {
bech32: "tbs",
pubKeyHash: 0x6f,
scriptHash: 0xc4,
validWitnessVersions: [0],
};
if (err.message === "Unknown coin bech32 prefix") {
if ((e as Error).message === "Unknown coin bech32 prefix") {
return lightningPayReq.decode(invoice, customNetwork ?? mutinynet);
} else {
throw e;
Expand Down

0 comments on commit 8ee3dee

Please sign in to comment.