Skip to content

Commit

Permalink
switching to using abandonchannel function from channel.ts file
Browse files Browse the repository at this point in the history
Signed-off-by: Nitesh Balusu <[email protected]>
  • Loading branch information
niteshbalusu11 authored and hsjoberg committed Jul 19, 2023
1 parent fcedc71 commit c87ab00
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 19 deletions.
19 changes: 1 addition & 18 deletions src/lndmobile/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Long from "long";
import { NativeModules } from "react-native";
import { checkLndStreamErrorResponse } from "../utils/lndmobile";
import sha from "sha.js";

const { LndMobile, LndMobileTools } = NativeModules;

/**
Expand Down Expand Up @@ -695,21 +696,3 @@ export type IReadLndLogResponse = string[];
export const readLndLog = async (): Promise<IReadLndLogResponse> => {
return [""];
};


export const abandonChannel = async (fundingTxId: string, index: number): Promise<lnrpc.AbandonChannelResponse> => {
const response = await sendCommand<lnrpc.IAbandonChannelRequest, lnrpc.AbandonChannelRequest, lnrpc.AbandonChannelResponse>({
request: lnrpc.AbandonChannelRequest,
response: lnrpc.AbandonChannelResponse,
method: "AbandonChannel",
options: {
channelPoint: {
fundingTxidStr: fundingTxId,
outputIndex: index,
},
iKnowWhatIAmDoing: true,
}
})

return response;
}
3 changes: 2 additions & 1 deletion src/windows/InitProcess/DEV_Commands.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import { CONSTANTS, JSHash } from "react-native-hash";
import { DeviceEventEmitter, EventEmitter, Linking, NativeEventEmitter, NativeModules, ScrollView, StatusBar, StyleSheet } from "react-native";
import React, { useState } from "react";
import { StorageItem, getItem, setItem, setItemObject, storage } from "../../storage/app";
import { abandonChannel, checkStatus, connectPeer, decodePayReq, getInfo, getNetworkInfo, getNodeInfo, importGraph, listInvoices, listPeers, listUnspent, queryRoutes } from "../../lndmobile/index";
import { bytesToHexString, bytesToString, stringToUint8Array, toast } from "../../utils";
import { channelAcceptor, channelAcceptorResponse, closeChannel, decodeChannelAcceptRequest, decodeChannelEvent, listChannels, openChannel, pendingChannels } from "../../lndmobile/channel";
import { checkStatus, connectPeer, decodePayReq, getInfo, getNetworkInfo, getNodeInfo, importGraph, listInvoices, listPeers, listUnspent, queryRoutes } from "../../lndmobile/index";
import { clearTransactions, createTransaction, getTransaction, getTransactions } from "../../storage/database/transaction";
import { deriveKey, derivePrivateKey, genSeed, initWallet, signMessage } from "../../lndmobile/wallet";
import { getItemObject, getPin, getWalletPassword, setWalletPassword } from "../../storage/keystore";
Expand All @@ -31,6 +31,7 @@ import PushNotification from "react-native-push-notification";
import { RootStackParamList } from "../../Main";
import Spinner from "../../components/Spinner";
import { StackNavigationProp } from "@react-navigation/stack";
import { abandonChannel } from '../../lndmobile/channel';
import { blixtTheme } from "../../native-base-theme/variables/commonColor";
import { generateSecureRandom } from "react-native-securerandom";
import { localNotification } from "../../utils/push-notification";
Expand Down

0 comments on commit c87ab00

Please sign in to comment.