mirror of
https://github.com/dashpay/dash.git
synced 2024-12-28 13:32:47 +01:00
[Qt] hide bump context menu action if tx already has been bumped
This commit is contained in:
parent
4314544d46
commit
32325a3f58
@ -379,7 +379,7 @@ void TransactionView::contextualMenu(const QPoint &point)
|
|||||||
uint256 hash;
|
uint256 hash;
|
||||||
hash.SetHex(selection.at(0).data(TransactionTableModel::TxHashRole).toString().toStdString());
|
hash.SetHex(selection.at(0).data(TransactionTableModel::TxHashRole).toString().toStdString());
|
||||||
abandonAction->setEnabled(model->transactionCanBeAbandoned(hash));
|
abandonAction->setEnabled(model->transactionCanBeAbandoned(hash));
|
||||||
bumpFeeAction->setEnabled(model->transactionSignalsRBF(hash));
|
bumpFeeAction->setEnabled(model->transactionCanBeBumped(hash));
|
||||||
|
|
||||||
if(index.isValid())
|
if(index.isValid())
|
||||||
{
|
{
|
||||||
|
@ -656,11 +656,11 @@ bool WalletModel::abandonTransaction(uint256 hash) const
|
|||||||
return wallet->AbandonTransaction(hash);
|
return wallet->AbandonTransaction(hash);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WalletModel::transactionSignalsRBF(uint256 hash) const
|
bool WalletModel::transactionCanBeBumped(uint256 hash) const
|
||||||
{
|
{
|
||||||
LOCK2(cs_main, wallet->cs_wallet);
|
LOCK2(cs_main, wallet->cs_wallet);
|
||||||
const CWalletTx *wtx = wallet->GetWalletTx(hash);
|
const CWalletTx *wtx = wallet->GetWalletTx(hash);
|
||||||
return wtx && SignalsOptInRBF(*wtx);
|
return wtx && SignalsOptInRBF(*wtx) && !wtx->mapValue.count("replaced_by_txid");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WalletModel::bumpFee(uint256 hash)
|
bool WalletModel::bumpFee(uint256 hash)
|
||||||
|
@ -207,7 +207,7 @@ public:
|
|||||||
bool transactionCanBeAbandoned(uint256 hash) const;
|
bool transactionCanBeAbandoned(uint256 hash) const;
|
||||||
bool abandonTransaction(uint256 hash) const;
|
bool abandonTransaction(uint256 hash) const;
|
||||||
|
|
||||||
bool transactionSignalsRBF(uint256 hash) const;
|
bool transactionCanBeBumped(uint256 hash) const;
|
||||||
bool bumpFee(uint256 hash);
|
bool bumpFee(uint256 hash);
|
||||||
|
|
||||||
static bool isWalletEnabled();
|
static bool isWalletEnabled();
|
||||||
|
Loading…
Reference in New Issue
Block a user