Skip to content

Commit

Permalink
reject inbound legacy channels by default
Browse files Browse the repository at this point in the history
Signed-off-by: Nitesh Balusu <[email protected]>
  • Loading branch information
niteshbalusu11 committed Nov 24, 2023
1 parent 30b206e commit bd12d52
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/state/ChannelAcceptanceManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { bytesToHexString } from "../utils";
import logger from "./../utils/log";
import { IStoreModel } from "./index";
import { checkLndStreamErrorResponse } from "../utils/lndmobile";
import { lnrpc } from "../../proto/lightning";

const log = logger("ChannelAcceptanceManager");

Expand Down Expand Up @@ -34,6 +35,20 @@ export const channelAcceptanceManager: IChannelAcceptanceManagerModel = {

log.i("Channel accept request", [channelAcceptRequest]);

// Reject unknown, legacy and static remote key channels

if (
channelAcceptRequest.commitmentType === lnrpc.CommitmentType.LEGACY ||
channelAcceptRequest.commitmentType === lnrpc.CommitmentType.STATIC_REMOTE_KEY ||
channelAcceptRequest.commitmentType === lnrpc.CommitmentType.UNKNOWN_COMMITMENT_TYPE
) {
await injections.lndMobile.channel.channelAcceptorResponse(
channelAcceptRequest.pendingChanId,
false,
);
return;
}

if (!!channelAcceptRequest.wantsZeroConf) {
const zeroConfPeers = getStoreState().settings.zeroConfPeers;

Expand Down

0 comments on commit bd12d52

Please sign in to comment.