File tree Expand file tree Collapse file tree 5 files changed +13
-0
lines changed Expand file tree Collapse file tree 5 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -426,6 +426,7 @@ class WalletImpl : public Wallet
426
426
}
427
427
unsigned int getConfirmTarget () override { return m_wallet.m_confirm_target ; }
428
428
bool hdEnabled () override { return m_wallet.IsHDEnabled (); }
429
+ bool IsWalletFlagSet (uint64_t flag) override { return m_wallet.IsWalletFlagSet (flag); }
429
430
OutputType getDefaultAddressType () override { return m_wallet.m_default_address_type ; }
430
431
OutputType getDefaultChangeType () override { return m_wallet.m_default_change_type ; }
431
432
std::unique_ptr<Handler> handleUnload (UnloadFn fn) override
Original file line number Diff line number Diff line change @@ -236,6 +236,9 @@ class Wallet
236
236
// Return whether HD enabled.
237
237
virtual bool hdEnabled () = 0;
238
238
239
+ // check if a certain wallet flag is set.
240
+ virtual bool IsWalletFlagSet (uint64_t flag) = 0;
241
+
239
242
// Get default address type.
240
243
virtual OutputType getDefaultAddressType () = 0;
241
244
Original file line number Diff line number Diff line change @@ -99,6 +99,9 @@ void ReceiveCoinsDialog::setModel(WalletModel *_model)
99
99
} else {
100
100
ui->useBech32 ->setCheckState (Qt::Unchecked);
101
101
}
102
+
103
+ // eventually disable the main receive button if private key operations are disabled
104
+ ui->receiveButton ->setEnabled (!model->privateKeysDisabled ());
102
105
}
103
106
}
104
107
Original file line number Diff line number Diff line change @@ -558,6 +558,11 @@ bool WalletModel::isWalletEnabled()
558
558
return !gArgs .GetBoolArg (" -disablewallet" , DEFAULT_DISABLE_WALLET);
559
559
}
560
560
561
+ bool WalletModel::privateKeysDisabled () const
562
+ {
563
+ return m_wallet->IsWalletFlagSet (WALLET_FLAG_DISABLE_PRIVATE_KEYS);
564
+ }
565
+
561
566
QString WalletModel::getWalletName () const
562
567
{
563
568
return QString::fromStdString (m_wallet->getWalletName ());
Original file line number Diff line number Diff line change @@ -197,6 +197,7 @@ class WalletModel : public QObject
197
197
bool bumpFee (uint256 hash);
198
198
199
199
static bool isWalletEnabled ();
200
+ bool privateKeysDisabled () const ;
200
201
201
202
interfaces::Node& node () const { return m_node; }
202
203
interfaces::Wallet& wallet () const { return *m_wallet; }
You can’t perform that action at this time.
0 commit comments