Skip to content

Commit 32325a3

Browse files
committed
[Qt] hide bump context menu action if tx already has been bumped
1 parent 4314544 commit 32325a3

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/qt/transactionview.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ void TransactionView::contextualMenu(const QPoint &point)
379379
uint256 hash;
380380
hash.SetHex(selection.at(0).data(TransactionTableModel::TxHashRole).toString().toStdString());
381381
abandonAction->setEnabled(model->transactionCanBeAbandoned(hash));
382-
bumpFeeAction->setEnabled(model->transactionSignalsRBF(hash));
382+
bumpFeeAction->setEnabled(model->transactionCanBeBumped(hash));
383383

384384
if(index.isValid())
385385
{

src/qt/walletmodel.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -656,11 +656,11 @@ bool WalletModel::abandonTransaction(uint256 hash) const
656656
return wallet->AbandonTransaction(hash);
657657
}
658658

659-
bool WalletModel::transactionSignalsRBF(uint256 hash) const
659+
bool WalletModel::transactionCanBeBumped(uint256 hash) const
660660
{
661661
LOCK2(cs_main, wallet->cs_wallet);
662662
const CWalletTx *wtx = wallet->GetWalletTx(hash);
663-
return wtx && SignalsOptInRBF(*wtx);
663+
return wtx && SignalsOptInRBF(*wtx) && !wtx->mapValue.count("replaced_by_txid");
664664
}
665665

666666
bool WalletModel::bumpFee(uint256 hash)

src/qt/walletmodel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ class WalletModel : public QObject
207207
bool transactionCanBeAbandoned(uint256 hash) const;
208208
bool abandonTransaction(uint256 hash) const;
209209

210-
bool transactionSignalsRBF(uint256 hash) const;
210+
bool transactionCanBeBumped(uint256 hash) const;
211211
bool bumpFee(uint256 hash);
212212

213213
static bool isWalletEnabled();

0 commit comments

Comments
 (0)