Skip to content

Commit

Permalink
Merge pull request #1843 from kaloudis/extend-zaplocker-warning
Browse files Browse the repository at this point in the history
Extend Zaplocker warning to zaps
  • Loading branch information
kaloudis committed Nov 14, 2023
2 parents ec6105d + 8a1375e commit ebdd220
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@
"views.Send.lookup": "Look Up Payment Request",
"views.Send.noOnchainBalance": "No on-chain balance available. Close a channel or receive an on-chain transaction first.",
"views.Send.noLightningBalance": "No lightning balance available. Open a channel or receive a lightning payment first.",
"views.Send.zaplockerWarning": "It currently is not recommended to pay Zaplocker invoices with nodes that aren't online 24/7. Not coming online during the period between the payment completion and the final expiration may result in a force closed channel. Open ZEUS regularly to mitigate the issue. Proceed at your own risk.",
"views.Send.zaplockerWarning": "This is a Zaplocker invoices that will hold payment up to 24 hours. Open ZEUS regularly after payment to help mitigate the risk of a force closed channel. Proceed at your own risk.",
"views.SendingLightning.sending": "Sending Transaction",
"views.SendingLightning.success": "Transaction successfully sent",
"views.SendingLightning.paymentHash": "Payment Hash",
Expand Down
15 changes: 14 additions & 1 deletion views/PaymentRequest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ import CaretRight from '../assets/images/SVG/Caret Right.svg';
import QR from '../assets/images/SVG/QR.svg';
import Conversion from '../components/Conversion';

const zaplockerDestinations = [
// OLYMPUS
'031b301307574bbe9b9ac7b79cbe1700e31e544513eae0b5d7497483083f99e581'
// TODO add Zaplocker.com
];

interface InvoiceProps {
exitSetup: any;
navigation: any;
Expand Down Expand Up @@ -354,6 +360,13 @@ export default class PaymentRequest extends React.Component<

const noBalance = this.props.BalanceStore.lightningBalance === 0;

const showZaplockerWarning =
isZaplocker ||
(destination &&
zaplockerDestinations.includes(destination) &&
cltv_expiry &&
Number(cltv_expiry) > 200);

const QRButton = () => (
<TouchableOpacity
onPress={() =>
Expand Down Expand Up @@ -406,7 +419,7 @@ export default class PaymentRequest extends React.Component<
{!loading && !loadingFeeEstimate && !!pay_req && (
<View style={styles.content}>
<>
{isZaplocker &&
{showZaplockerWarning &&
implementation === 'embedded-lnd' && (
<View
style={{
Expand Down

0 comments on commit ebdd220

Please sign in to comment.