Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

c-lightning-REST: all channels were unannounced #901

Merged
merged 2 commits into from
Mar 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions backends/CLightningREST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export default class CLightningREST extends LND {
id: data.id,
satoshis: data.satoshis,
feeRate: data.sat_per_byte,
annnounce: data.announce,
announce: !data.private ? 'true' : 'false',
minfConf: data.min_confs,
utxos: data.utxos
};
Expand All @@ -98,7 +98,7 @@ export default class CLightningREST extends LND {
id: data.id,
satoshis: data.satoshis,
feeRate: data.sat_per_byte,
annnounce: data.announce,
announce: !data.private ? 'true' : 'false',
minfConf: data.min_confs
};
}
Expand Down
2 changes: 1 addition & 1 deletion components/Touchable.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Pressable, TouchableOpacity, View } from 'react-native';
import { Pressable, TouchableOpacity } from 'react-native';

interface TouchableProps {
touch: () => void;
Expand Down
2 changes: 0 additions & 2 deletions models/OpenChannelRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@ export default class OpenChannelRequest extends BaseModel {
public host: string;
public id?: string;
public satoshis?: string;
public announce?: boolean;
public utxos?: string[];

constructor(data?: any) {
super(data);
this.id = data.node_pubkey_string || data.node_pubkey;
this.satoshis = data.local_funding_amount;
this.announce = !data.private;
}
}
20 changes: 9 additions & 11 deletions views/Lockscreen.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import * as React from 'react';
import { ScrollView, StyleSheet, Text, View } from 'react-native';
import { inject, observer } from 'mobx-react';
import { Header, Icon } from 'react-native-elements';

import Button from './../components/Button';
import Pin from './../components/Pin';
import { ErrorMessage } from './../components/SuccessErrorMessage';
import TextInput from './../components/TextInput';

import SettingsStore from './../stores/SettingsStore';

import LinkingUtils from './../utils/LinkingUtils';
import { localeString } from './../utils/LocaleUtils';

import SettingsStore from './../stores/SettingsStore';
import Pin from './../components/Pin';
import { themeColor } from './../utils/ThemeUtils';
import { Header, Icon } from 'react-native-elements';

interface LockscreenProps {
navigation: any;
Expand Down Expand Up @@ -70,7 +70,7 @@ export default class Lockscreen extends React.Component<
const deletePin: boolean = navigation.getParam('deletePin');
const deleteDuressPin: boolean = navigation.getParam('deleteDuressPin');

if (!!settings.authenticationAttempts) {
if (settings.authenticationAttempts) {
this.setState({
authenticationAttempts: settings.authenticationAttempts
});
Expand Down Expand Up @@ -185,7 +185,7 @@ export default class Lockscreen extends React.Component<
duressPassphrase: updatedSettings?.duressPassphrase,
pin: updatedSettings?.pin,
duressPin: updatedSettings?.duressPin,
authenticationAttempts: authenticationAttempts,
authenticationAttempts,
fiat: updatedSettings?.fiat,
locale: updatedSettings?.locale,
privacy: updatedSettings?.privacy
Expand Down Expand Up @@ -324,7 +324,7 @@ export default class Lockscreen extends React.Component<
const { passphrase, authenticationAttempts } = this.state;
let incorrect = '';

if (!!passphrase) {
if (passphrase) {
incorrect = localeString('views.Lockscreen.incorrect');
} else {
incorrect = localeString('views.Lockscreen.incorrectPin');
Expand All @@ -340,18 +340,16 @@ export default class Lockscreen extends React.Component<
};

render() {
const { navigation, SettingsStore } = this.props;
const { navigation } = this.props;
const {
passphrase,
passphraseAttempt,
pin,
pinAttempt,
hidden,
error,
modifySecurityScreen,
deletePin,
deleteDuressPin,
authenticationAttempts
deleteDuressPin
} = this.state;

const BackButton = () => (
Expand Down
8 changes: 4 additions & 4 deletions views/OpenChannel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,11 @@ export default class OpenChannel extends React.Component<
host,
sat_per_byte,
suggestImport,
utxoBalance
utxoBalance,
private
} = this.state;
const { implementation, settings } = SettingsStore;
const { privacy } = settings;
const privateChannel = this.state.private;
const enableMempoolRates = privacy && privacy.enableMempoolRates;

const {
Expand Down Expand Up @@ -484,10 +484,10 @@ export default class OpenChannel extends React.Component<
{localeString('views.OpenChannel.private')}
</Text>
<Switch
value={privateChannel}
value={private}
onValueChange={() =>
this.setState({
private: !privateChannel
private: !private
})
}
trackColor={{
Expand Down
3 changes: 1 addition & 2 deletions views/Settings/AddEditNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,7 @@ export default class AddEditNode extends React.Component<
index
} = this.state;
const { setSettings, settings } = SettingsStore;
const { privacy, passphrase, fiat, locale } = settings;
const lurkerMode = (privacy && privacy.lurkerMode) || false;
const { passphrase, fiat, locale } = settings;

if (
implementation === 'lndhub' &&
Expand Down
5 changes: 3 additions & 2 deletions views/Settings/Security.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import * as React from 'react';
import { FlatList, View } from 'react-native';
import { Header, Icon, ListItem } from 'react-native-elements';

import stores from '../../stores/Stores';

import { localeString } from './../../utils/LocaleUtils';
import { themeColor } from './../../utils/ThemeUtils';
import stores from '../../stores/Stores';
import { useEffect, useState } from 'react';

interface SecurityProps {
navigation: any;
Expand Down
8 changes: 2 additions & 6 deletions views/Settings/SetDuressPin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,8 @@ export default class SetDuressPin extends React.Component<

render() {
const { navigation } = this.props;
const {
duressPin,
duressPinConfirm,
duressPinMismatchError,
duressPinInvalidError
} = this.state;
const { duressPin, duressPinMismatchError, duressPinInvalidError } =
this.state;
const BackButton = () => (
<Icon
name="arrow-back"
Expand Down
3 changes: 1 addition & 2 deletions views/Settings/SetPin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@ export default class SetPin extends React.Component<SetPinProps, SetPinState> {

render() {
const { navigation } = this.props;
const { pin, pinConfirm, pinMismatchError, pinInvalidError } =
this.state;
const { pin, pinMismatchError, pinInvalidError } = this.state;
const BackButton = () => (
<Icon
name="arrow-back"
Expand Down