Skip to content

Commit 09ea936

Browse files
author
alex v
authored
Disable CFund client functionality (#623)
* disable cfund client functionality * enable vote
1 parent 1e73c05 commit 09ea936

File tree

6 files changed

+37
-0
lines changed

6 files changed

+37
-0
lines changed

src/chainparams.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ class CMainParams : public CChainParams {
126126
consensus.nStaticReward = 2 * COIN;
127127
consensus.nHeightv451Fork = 2722100;
128128
consensus.nHeightv452Fork = 2882875;
129+
consensus.fDaoClientActivated = false;
129130

130131
/** Coinbase transaction outputs can only be spent after this number of new blocks (network rule) */
131132
consensus.nCoinbaseMaturity = 50;
@@ -328,6 +329,7 @@ class CTestNetParams : public CChainParams {
328329
consensus.nStaticReward = 2 * COIN;
329330
consensus.nHeightv451Fork = 100000;
330331
consensus.nHeightv452Fork = 100000;
332+
consensus.fDaoClientActivated = true;
331333

332334
/** Coinbase transaction outputs can only be spent after this number of new blocks (network rule) */
333335
consensus.nCoinbaseMaturity = 50;
@@ -509,6 +511,7 @@ class CDevNetParams : public CChainParams {
509511
consensus.nStaticReward = 2 * COIN;
510512
consensus.nHeightv451Fork = 1000;
511513
consensus.nHeightv452Fork = 1000;
514+
consensus.fDaoClientActivated = true;
512515

513516
/** Coinbase transaction outputs can only be spent after this number of new blocks (network rule) */
514517
consensus.nCoinbaseMaturity = 5;
@@ -700,6 +703,7 @@ class CRegTestParams : public CChainParams {
700703
consensus.nStaticReward = 2 * COIN;
701704
consensus.nHeightv451Fork = 1000;
702705
consensus.nHeightv452Fork = 1000;
706+
consensus.fDaoClientActivated = true;
703707

704708
/** Coinbase transaction outputs can only be spent after this number of new blocks (network rule) */
705709
consensus.nCoinbaseMaturity = 50;

src/consensus/params.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ struct Params {
108108
int nHeightv451Fork;
109109
int nHeightv452Fork;
110110

111+
bool fDaoClientActivated;
112+
111113
/** Coinbase transaction outputs can only be spent after this number of new blocks (network rule) */
112114
int nCoinbaseMaturity;
113115

src/miner.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,9 @@ CBlockTemplate* BlockAssembler::CreateNewBlock(const CScript& scriptPubKeyIn, bo
205205
coinbaseTx.vout[0].scriptPubKey = scriptPubKeyIn;
206206
coinbaseTx.vout[0].nValue = GetBlockSubsidy(nHeight, chainparams.GetConsensus());
207207
}
208+
208209
coinbaseTx.vin[0].scriptSig = CScript() << nHeight << OP_0;
210+
209211
if(IsCommunityFundEnabled(pindexPrev, chainparams.GetConsensus()))
210212
{
211213
std::map<uint256, bool> votes;

src/qt/communityfundpage.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,17 @@ void CommunityFundPage::click_radioButtonExpired()
392392

393393
void CommunityFundPage::click_pushButtonCreateProposal()
394394
{
395+
if (!Params().GetConsensus().fDaoClientActivated)
396+
{
397+
QMessageBox msgBox(this);
398+
QString str = tr("This function is temporarily disabled");
399+
msgBox.setText(str);
400+
msgBox.addButton(tr("Ok"), QMessageBox::AcceptRole);
401+
msgBox.setIcon(QMessageBox::Information);
402+
msgBox.setWindowTitle(str);
403+
msgBox.exec();
404+
return;
405+
}
395406
CommunityFundCreateProposalDialog dlg(this);
396407
dlg.setModel(walletModel);
397408
dlg.exec();
@@ -400,6 +411,17 @@ void CommunityFundPage::click_pushButtonCreateProposal()
400411

401412
void CommunityFundPage::click_pushButtonCreatePaymentRequest()
402413
{
414+
if (!Params().GetConsensus().fDaoClientActivated)
415+
{
416+
QMessageBox msgBox(this);
417+
QString str = tr("This function is temporarily disabled");
418+
msgBox.setText(str);
419+
msgBox.addButton(tr("Ok"), QMessageBox::AcceptRole);
420+
msgBox.setIcon(QMessageBox::Information);
421+
msgBox.setWindowTitle(str);
422+
msgBox.exec();
423+
return;
424+
}
403425
CommunityFundCreatePaymentRequestDialog dlg(this);
404426
dlg.setModel(walletModel);
405427
dlg.exec();

src/qt/communityfundpage.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include <consensus/cfund.h>
66
#include <wallet/wallet.h>
77

8+
#include <QMessageBox>
89
#include <QWidget>
910
#include <QPushButton>
1011
#include <QListView>

src/wallet/rpcwallet.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,9 @@ UniValue createproposal(const UniValue& params, bool fHelp)
596596
+ HelpExampleCli("createproposal", "\"NQFqqMUD55ZV3PJEJZtaKCsQmjLT6JkjvJ\" 12000 3600 \"Promotional stickers for everyone\" 100")
597597
);
598598

599+
if (!Params().GetConsensus().fDaoClientActivated)
600+
throw JSONRPCError(RPC_WALLET_ERROR, "This command is temporarily disabled");
601+
599602
LOCK2(cs_main, pwalletMain->cs_wallet);
600603

601604
CNavCoinAddress address("NQFqqMUD55ZV3PJEJZtaKCsQmjLT6JkjvJ"); // Dummy address
@@ -691,6 +694,9 @@ UniValue createpaymentrequest(const UniValue& params, bool fHelp)
691694
+ HelpExampleCli("createpaymentrequest", "\"196a4c2115d3c1c1dce1156eb2404ad77f3c5e9f668882c60cb98d638313dbd3\" 1000 \"Invoice March 2017\"")
692695
);
693696

697+
if (!Params().GetConsensus().fDaoClientActivated)
698+
throw JSONRPCError(RPC_WALLET_ERROR, "This command is temporarily disabled");
699+
694700
LOCK2(cs_main, pwalletMain->cs_wallet);
695701

696702
CFund::CProposal proposal;

0 commit comments

Comments
 (0)