16
16
#include < qt/walletmodel.h>
17
17
18
18
#include < coinjoin/options.h>
19
+ #include < interfaces/coinjoin.h>
19
20
20
21
#include < cmath>
21
22
@@ -306,7 +307,7 @@ void OverviewPage::setWalletModel(WalletModel *model)
306
307
307
308
// Disable coinJoinClient builtin support for automatic backups while we are in GUI,
308
309
// we'll handle automatic backups and user warnings in coinJoinStatus()
309
- walletModel->coinJoin (). disableAutobackups ();
310
+ walletModel->coinJoin ()-> disableAutobackups ();
310
311
311
312
connect (ui->toggleCoinJoin , &QPushButton::clicked, this , &OverviewPage::toggleCoinJoin);
312
313
@@ -523,7 +524,7 @@ void OverviewPage::coinJoinStatus(bool fForce)
523
524
int nBestHeight = clientModel->node ().getNumBlocks ();
524
525
525
526
// We are processing more than 1 block per second, we'll just leave
526
- if (nBestHeight > walletModel->coinJoin (). getCachedBlocks () && GetTime () - nLastDSProgressBlockTime <= 1 ) return ;
527
+ if (nBestHeight > walletModel->coinJoin ()-> getCachedBlocks () && GetTime () - nLastDSProgressBlockTime <= 1 ) return ;
527
528
nLastDSProgressBlockTime = GetTime ();
528
529
529
530
QString strKeysLeftText (tr (" keys left: %1" ).arg (walletModel->getKeysLeftSinceAutoBackup ()));
@@ -533,9 +534,9 @@ void OverviewPage::coinJoinStatus(bool fForce)
533
534
ui->labelCoinJoinEnabled ->setToolTip (strKeysLeftText);
534
535
535
536
QString strCoinJoinName = QString::fromStdString (gCoinJoinName );
536
- if (!walletModel->coinJoin (). isMixing ()) {
537
- if (nBestHeight != walletModel->coinJoin (). getCachedBlocks ()) {
538
- walletModel->coinJoin (). setCachedBlocks (nBestHeight);
537
+ if (!walletModel->coinJoin ()-> isMixing ()) {
538
+ if (nBestHeight != walletModel->coinJoin ()-> getCachedBlocks ()) {
539
+ walletModel->coinJoin ()-> setCachedBlocks (nBestHeight);
539
540
updateCoinJoinProgress ();
540
541
}
541
542
@@ -596,7 +597,7 @@ void OverviewPage::coinJoinStatus(bool fForce)
596
597
}
597
598
}
598
599
599
- QString strEnabled = walletModel->coinJoin (). isMixing () ? tr (" Enabled" ) : tr (" Disabled" );
600
+ QString strEnabled = walletModel->coinJoin ()-> isMixing () ? tr (" Enabled" ) : tr (" Disabled" );
600
601
// Show how many keys left in advanced PS UI mode only
601
602
if (fShowAdvancedCJUI ) strEnabled += " , " + strKeysLeftText;
602
603
ui->labelCoinJoinEnabled ->setText (strEnabled);
@@ -618,15 +619,15 @@ void OverviewPage::coinJoinStatus(bool fForce)
618
619
}
619
620
620
621
// check coinjoin status and unlock if needed
621
- if (nBestHeight != walletModel->coinJoin (). getCachedBlocks ()) {
622
+ if (nBestHeight != walletModel->coinJoin ()-> getCachedBlocks ()) {
622
623
// Balance and number of transactions might have changed
623
- walletModel->coinJoin (). setCachedBlocks (nBestHeight);
624
+ walletModel->coinJoin ()-> setCachedBlocks (nBestHeight);
624
625
updateCoinJoinProgress ();
625
626
}
626
627
627
628
setWidgetsVisible (true );
628
629
629
- ui->labelSubmittedDenom ->setText (QString (walletModel->coinJoin (). getSessionDenoms ().c_str ()));
630
+ ui->labelSubmittedDenom ->setText (QString (walletModel->coinJoin ()-> getSessionDenoms ().c_str ()));
630
631
}
631
632
632
633
void OverviewPage::toggleCoinJoin (){
@@ -641,7 +642,7 @@ void OverviewPage::toggleCoinJoin(){
641
642
settings.setValue (" hasMixed" , " hasMixed" );
642
643
}
643
644
644
- if (!walletModel->coinJoin (). isMixing ()) {
645
+ if (!walletModel->coinJoin ()-> isMixing ()) {
645
646
auto & options = walletModel->node ().coinJoinOptions ();
646
647
const CAmount nMinAmount = options.getSmallestDenomination () + options.getMaxCollateralAmount ();
647
648
if (m_balances.balance < nMinAmount) {
@@ -659,7 +660,7 @@ void OverviewPage::toggleCoinJoin(){
659
660
if (!ctx.isValid ())
660
661
{
661
662
// unlock was cancelled
662
- walletModel->coinJoin (). resetCachedBlocks ();
663
+ walletModel->coinJoin ()-> resetCachedBlocks ();
663
664
QMessageBox::warning (this , strCoinJoinName,
664
665
tr (" Wallet is locked and user declined to unlock. Disabling %1." ).arg (strCoinJoinName),
665
666
QMessageBox::Ok, QMessageBox::Ok);
@@ -670,15 +671,15 @@ void OverviewPage::toggleCoinJoin(){
670
671
671
672
}
672
673
673
- walletModel->coinJoin (). resetCachedBlocks ();
674
+ walletModel->coinJoin ()-> resetCachedBlocks ();
674
675
675
- if (walletModel->coinJoin (). isMixing ()) {
676
+ if (walletModel->coinJoin ()-> isMixing ()) {
676
677
ui->toggleCoinJoin ->setText (tr (" Start %1" ).arg (strCoinJoinName));
677
- walletModel->coinJoin (). resetPool ();
678
- walletModel->coinJoin (). stopMixing ();
678
+ walletModel->coinJoin ()-> resetPool ();
679
+ walletModel->coinJoin ()-> stopMixing ();
679
680
} else {
680
681
ui->toggleCoinJoin ->setText (tr (" Stop %1" ).arg (strCoinJoinName));
681
- walletModel->coinJoin (). startMixing ();
682
+ walletModel->coinJoin ()-> startMixing ();
682
683
}
683
684
}
684
685
@@ -718,5 +719,5 @@ void OverviewPage::DisableCoinJoinCompletely()
718
719
if (nWalletBackups <= 0 ) {
719
720
ui->labelCoinJoinEnabled ->setText (" <span style='" + GUIUtil::getThemedStyleQString (GUIUtil::ThemedStyle::TS_ERROR) + " '>(" + tr (" Disabled" ) + " )</span>" );
720
721
}
721
- walletModel->coinJoin (). stopMixing ();
722
+ walletModel->coinJoin ()-> stopMixing ();
722
723
}
0 commit comments