Skip to content
This repository was archived by the owner on Feb 8, 2026. It is now read-only.

Commit 0916862

Browse files
Merge pull request #896 from synonymdev/min-tx-relay-fee-dialog
feat(wallet): Add Minimum Transaction Relay Fee Dialog
2 parents fdd540e + 4dca7d9 commit 0916862

2 files changed

Lines changed: 28 additions & 1 deletion

File tree

src/screens/Wallets/Send/ReviewAndSend.tsx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ const ReviewAndSend = ({
128128
const [showDialog2, setShowDialog2] = useState(false);
129129
const [showDialog3, setShowDialog3] = useState(false);
130130
const [showDialog4, setShowDialog4] = useState(false);
131+
const [showDialog5, setShowDialog5] = useState(false);
131132
const [rawTx, setRawTx] = useState<{ hex: string; id: string }>();
132133
const [decodedInvoice, setDecodedInvoice] = useState<TInvoice>();
133134

@@ -493,6 +494,16 @@ const ReviewAndSend = ({
493494
return;
494495
}
495496

497+
// Check if the user is setting the minimum relay fee given the current fee environment.
498+
if (
499+
transaction?.satsPerByte &&
500+
// This check is to prevent situations where all values are set to 1sat/vbyte. Where setting 1sat/vbyte is perfectly fine.
501+
feeEstimates.minimum < feeEstimates.slow &&
502+
transaction.satsPerByte <= feeEstimates.minimum
503+
) {
504+
setShowDialog5(true);
505+
}
506+
496507
// fee > 50% of send amount
497508
if (!transaction?.lightningInvoice && feeSats > amount / 2) {
498509
setShowDialog3(true);
@@ -506,7 +517,10 @@ const ReviewAndSend = ({
506517
bitcoinUnit,
507518
feeSats,
508519
transaction?.lightningInvoice,
520+
transaction.satsPerByte,
509521
enableSendAmountWarning,
522+
feeEstimates.minimum,
523+
feeEstimates.slow,
510524
confirmPayment,
511525
lightningBalance.localBalance,
512526
onChainBalance,
@@ -762,6 +776,19 @@ const ReviewAndSend = ({
762776
confirmPayment();
763777
}}
764778
/>
779+
<Dialog
780+
visible={showDialog5}
781+
title="Fee is potentially too low"
782+
description={`The fee you are trying to set is below ${feeEstimates.minimum} sats and may be too low due to current network conditions. This transaction may fail, take a while to confirm, or get trimmed from the mempool. Do you wish to proceed?`}
783+
onCancel={(): void => {
784+
setShowDialog5(false);
785+
setTimeout(() => navigation.goBack(), 100);
786+
}}
787+
onConfirm={async (): Promise<void> => {
788+
setShowDialog5(false);
789+
confirmPayment();
790+
}}
791+
/>
765792
</GradientView>
766793

767794
{showBiotmetrics && (

src/utils/startup/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ export const startWalletServices = async ({
160160

161161
if (onchain || lightning) {
162162
await Promise.all([
163-
updateOnchainFeeEstimates({ selectedNetwork }),
163+
updateOnchainFeeEstimates({ selectedNetwork, forceUpdate: true }),
164164
// if we restore wallet, we need to generate addresses for all types
165165
refreshWallet({
166166
onchain: isConnectedToElectrum,

0 commit comments

Comments
 (0)