mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 03:52:49 +01:00
Allow compilation with --disable-wallet
(#1733)
* Allow compilation with `--disable-wallet`
* fix remaining references
* Drop wallet references/include in CActiveMasternode and fix other files affected by this change
* Wrap privatesend-client.h include with ifdef/endif and fix other files affected by this change
* Re-enable Travis build with no wallet
reverts 267e57877b
This commit is contained in:
parent
865b61b503
commit
c166ed39b0
@ -46,7 +46,7 @@ env:
|
|||||||
# dashd
|
# dashd
|
||||||
- HOST=x86_64-unknown-linux-gnu PPA="ppa:bitcoin/bitcoin" PACKAGES="bc python3-zmq" DEP_OPTS="NO_QT=1 NO_UPNP=1 DEBUG=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-zmq --enable-glibc-back-compat --enable-reduce-exports" CPPFLAGS="-DDEBUG_LOCKORDER -DENABLE_DASH_DEBUG" PYZMQ=true
|
- HOST=x86_64-unknown-linux-gnu PPA="ppa:bitcoin/bitcoin" PACKAGES="bc python3-zmq" DEP_OPTS="NO_QT=1 NO_UPNP=1 DEBUG=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-zmq --enable-glibc-back-compat --enable-reduce-exports" CPPFLAGS="-DDEBUG_LOCKORDER -DENABLE_DASH_DEBUG" PYZMQ=true
|
||||||
# No wallet
|
# No wallet
|
||||||
# - HOST=x86_64-unknown-linux-gnu PPA="ppa:bitcoin/bitcoin" PACKAGES="python3" DEP_OPTS="NO_WALLET=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat --enable-reduce-exports"
|
- HOST=x86_64-unknown-linux-gnu PPA="ppa:bitcoin/bitcoin" PACKAGES="python3" DEP_OPTS="NO_WALLET=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat --enable-reduce-exports"
|
||||||
# Cross-Mac
|
# Cross-Mac
|
||||||
- HOST=x86_64-apple-darwin11 PPA="ppa:bitcoin/bitcoin" PACKAGES="cmake imagemagick libcap-dev librsvg2-bin libz-dev libbz2-dev libtiff-tools python-dev" BITCOIN_CONFIG="--enable-gui --enable-reduce-exports" OSX_SDK=10.9 GOAL="deploy"
|
- HOST=x86_64-apple-darwin11 PPA="ppa:bitcoin/bitcoin" PACKAGES="cmake imagemagick libcap-dev librsvg2-bin libz-dev libbz2-dev libtiff-tools python-dev" BITCOIN_CONFIG="--enable-gui --enable-reduce-exports" OSX_SDK=10.9 GOAL="deploy"
|
||||||
|
|
||||||
|
@ -211,15 +211,18 @@ libbitcoin_util_a-clientversion.$(OBJEXT): obj/build.h
|
|||||||
libbitcoin_server_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(MINIUPNPC_CPPFLAGS) $(EVENT_CFLAGS) $(EVENT_PTHREADS_CFLAGS)
|
libbitcoin_server_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(MINIUPNPC_CPPFLAGS) $(EVENT_CFLAGS) $(EVENT_PTHREADS_CFLAGS)
|
||||||
libbitcoin_server_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
|
libbitcoin_server_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
|
||||||
libbitcoin_server_a_SOURCES = \
|
libbitcoin_server_a_SOURCES = \
|
||||||
|
activemasternode.cpp \
|
||||||
addrman.cpp \
|
addrman.cpp \
|
||||||
addrdb.cpp \
|
addrdb.cpp \
|
||||||
alert.cpp \
|
alert.cpp \
|
||||||
bloom.cpp \
|
bloom.cpp \
|
||||||
chain.cpp \
|
chain.cpp \
|
||||||
checkpoints.cpp \
|
checkpoints.cpp \
|
||||||
|
dsnotificationinterface.cpp \
|
||||||
httprpc.cpp \
|
httprpc.cpp \
|
||||||
httpserver.cpp \
|
httpserver.cpp \
|
||||||
init.cpp \
|
init.cpp \
|
||||||
|
instantx.cpp \
|
||||||
dbwrapper.cpp \
|
dbwrapper.cpp \
|
||||||
governance.cpp \
|
governance.cpp \
|
||||||
governance-classes.cpp \
|
governance-classes.cpp \
|
||||||
@ -227,6 +230,11 @@ libbitcoin_server_a_SOURCES = \
|
|||||||
governance-validators.cpp \
|
governance-validators.cpp \
|
||||||
governance-vote.cpp \
|
governance-vote.cpp \
|
||||||
governance-votedb.cpp \
|
governance-votedb.cpp \
|
||||||
|
masternode.cpp \
|
||||||
|
masternode-payments.cpp \
|
||||||
|
masternode-sync.cpp \
|
||||||
|
masternodeconfig.cpp \
|
||||||
|
masternodeman.cpp \
|
||||||
merkleblock.cpp \
|
merkleblock.cpp \
|
||||||
messagesigner.cpp \
|
messagesigner.cpp \
|
||||||
miner.cpp \
|
miner.cpp \
|
||||||
@ -250,6 +258,7 @@ libbitcoin_server_a_SOURCES = \
|
|||||||
rpc/server.cpp \
|
rpc/server.cpp \
|
||||||
script/sigcache.cpp \
|
script/sigcache.cpp \
|
||||||
sendalert.cpp \
|
sendalert.cpp \
|
||||||
|
spork.cpp \
|
||||||
timedata.cpp \
|
timedata.cpp \
|
||||||
torcontrol.cpp \
|
torcontrol.cpp \
|
||||||
txdb.cpp \
|
txdb.cpp \
|
||||||
@ -276,14 +285,6 @@ endif
|
|||||||
libbitcoin_wallet_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
|
libbitcoin_wallet_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
|
||||||
libbitcoin_wallet_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
|
libbitcoin_wallet_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
|
||||||
libbitcoin_wallet_a_SOURCES = \
|
libbitcoin_wallet_a_SOURCES = \
|
||||||
activemasternode.cpp \
|
|
||||||
dsnotificationinterface.cpp \
|
|
||||||
instantx.cpp \
|
|
||||||
masternode.cpp \
|
|
||||||
masternode-payments.cpp \
|
|
||||||
masternode-sync.cpp \
|
|
||||||
masternodeconfig.cpp \
|
|
||||||
masternodeman.cpp \
|
|
||||||
keepass.cpp \
|
keepass.cpp \
|
||||||
privatesend-client.cpp \
|
privatesend-client.cpp \
|
||||||
privatesend-util.cpp \
|
privatesend-util.cpp \
|
||||||
@ -372,7 +373,6 @@ libbitcoin_common_a_SOURCES = \
|
|||||||
script/script_error.cpp \
|
script/script_error.cpp \
|
||||||
script/sign.cpp \
|
script/sign.cpp \
|
||||||
script/standard.cpp \
|
script/standard.cpp \
|
||||||
spork.cpp \
|
|
||||||
$(BITCOIN_CORE_H)
|
$(BITCOIN_CORE_H)
|
||||||
|
|
||||||
# util: shared between all executables.
|
# util: shared between all executables.
|
||||||
|
@ -8,8 +8,6 @@
|
|||||||
#include "masternodeman.h"
|
#include "masternodeman.h"
|
||||||
#include "protocol.h"
|
#include "protocol.h"
|
||||||
|
|
||||||
extern CWallet* pwalletMain;
|
|
||||||
|
|
||||||
// Keep track of the active Masternode
|
// Keep track of the active Masternode
|
||||||
CActiveMasternode activeMasternode;
|
CActiveMasternode activeMasternode;
|
||||||
|
|
||||||
|
@ -5,9 +5,10 @@
|
|||||||
#ifndef ACTIVEMASTERNODE_H
|
#ifndef ACTIVEMASTERNODE_H
|
||||||
#define ACTIVEMASTERNODE_H
|
#define ACTIVEMASTERNODE_H
|
||||||
|
|
||||||
#include "net.h"
|
#include "chainparams.h"
|
||||||
#include "key.h"
|
#include "key.h"
|
||||||
#include "wallet/wallet.h"
|
#include "net.h"
|
||||||
|
#include "primitives/transaction.h"
|
||||||
|
|
||||||
class CActiveMasternode;
|
class CActiveMasternode;
|
||||||
|
|
||||||
|
@ -2,13 +2,17 @@
|
|||||||
// Distributed under the MIT software license, see the accompanying
|
// Distributed under the MIT software license, see the accompanying
|
||||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
|
||||||
|
#include "chainparams.h"
|
||||||
#include "dsnotificationinterface.h"
|
#include "dsnotificationinterface.h"
|
||||||
#include "instantx.h"
|
#include "instantx.h"
|
||||||
#include "governance.h"
|
#include "governance.h"
|
||||||
#include "masternodeman.h"
|
#include "masternodeman.h"
|
||||||
#include "masternode-payments.h"
|
#include "masternode-payments.h"
|
||||||
#include "masternode-sync.h"
|
#include "masternode-sync.h"
|
||||||
|
#include "privatesend.h"
|
||||||
|
#ifdef ENABLE_WALLET
|
||||||
#include "privatesend-client.h"
|
#include "privatesend-client.h"
|
||||||
|
#endif // ENABLE_WALLET
|
||||||
#include "txmempool.h"
|
#include "txmempool.h"
|
||||||
|
|
||||||
void CDSNotificationInterface::InitializeCurrentBlockTip()
|
void CDSNotificationInterface::InitializeCurrentBlockTip()
|
||||||
@ -47,19 +51,23 @@ void CDSNotificationInterface::UpdatedBlockTip(const CBlockIndex *pindexNew, con
|
|||||||
::minRelayTxFee = CFeeRate(fDIP0001ActiveAtTip ? DEFAULT_DIP0001_MIN_RELAY_TX_FEE : DEFAULT_LEGACY_MIN_RELAY_TX_FEE);
|
::minRelayTxFee = CFeeRate(fDIP0001ActiveAtTip ? DEFAULT_DIP0001_MIN_RELAY_TX_FEE : DEFAULT_LEGACY_MIN_RELAY_TX_FEE);
|
||||||
mempool.UpdateMinFee(::minRelayTxFee);
|
mempool.UpdateMinFee(::minRelayTxFee);
|
||||||
}
|
}
|
||||||
|
#ifdef ENABLE_WALLET
|
||||||
if (!mapArgs.count("-mintxfee")) {
|
if (!mapArgs.count("-mintxfee")) {
|
||||||
CWallet::minTxFee = CFeeRate(fDIP0001ActiveAtTip ? DEFAULT_DIP0001_TRANSACTION_MINFEE : DEFAULT_LEGACY_TRANSACTION_MINFEE);
|
CWallet::minTxFee = CFeeRate(fDIP0001ActiveAtTip ? DEFAULT_DIP0001_TRANSACTION_MINFEE : DEFAULT_LEGACY_TRANSACTION_MINFEE);
|
||||||
}
|
}
|
||||||
if (!mapArgs.count("-fallbackfee")) {
|
if (!mapArgs.count("-fallbackfee")) {
|
||||||
CWallet::fallbackFee = CFeeRate(fDIP0001ActiveAtTip ? DEFAULT_DIP0001_FALLBACK_FEE : DEFAULT_LEGACY_FALLBACK_FEE);
|
CWallet::fallbackFee = CFeeRate(fDIP0001ActiveAtTip ? DEFAULT_DIP0001_FALLBACK_FEE : DEFAULT_LEGACY_FALLBACK_FEE);
|
||||||
}
|
}
|
||||||
|
#endif // ENABLE_WALLET
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fInitialDownload)
|
if (fInitialDownload)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
mnodeman.UpdatedBlockTip(pindexNew);
|
mnodeman.UpdatedBlockTip(pindexNew);
|
||||||
|
#ifdef ENABLE_WALLET
|
||||||
privateSendClient.UpdatedBlockTip(pindexNew);
|
privateSendClient.UpdatedBlockTip(pindexNew);
|
||||||
|
#endif // ENABLE_WALLET
|
||||||
instantsend.UpdatedBlockTip(pindexNew);
|
instantsend.UpdatedBlockTip(pindexNew);
|
||||||
mnpayments.UpdatedBlockTip(pindexNew, connman);
|
mnpayments.UpdatedBlockTip(pindexNew, connman);
|
||||||
governance.UpdatedBlockTip(pindexNew, connman);
|
governance.UpdatedBlockTip(pindexNew, connman);
|
||||||
|
14
src/init.cpp
14
src/init.cpp
@ -12,6 +12,7 @@
|
|||||||
|
|
||||||
#include "addrman.h"
|
#include "addrman.h"
|
||||||
#include "amount.h"
|
#include "amount.h"
|
||||||
|
#include "base58.h"
|
||||||
#include "chain.h"
|
#include "chain.h"
|
||||||
#include "chainparams.h"
|
#include "chainparams.h"
|
||||||
#include "checkpoints.h"
|
#include "checkpoints.h"
|
||||||
@ -59,7 +60,9 @@
|
|||||||
#include "masternodeconfig.h"
|
#include "masternodeconfig.h"
|
||||||
#include "messagesigner.h"
|
#include "messagesigner.h"
|
||||||
#include "netfulfilledman.h"
|
#include "netfulfilledman.h"
|
||||||
|
#ifdef ENABLE_WALLET
|
||||||
#include "privatesend-client.h"
|
#include "privatesend-client.h"
|
||||||
|
#endif // ENABLE_WALLET
|
||||||
#include "privatesend-server.h"
|
#include "privatesend-server.h"
|
||||||
#include "spork.h"
|
#include "spork.h"
|
||||||
|
|
||||||
@ -586,12 +589,14 @@ std::string HelpMessage(HelpMessageMode mode)
|
|||||||
strUsage += HelpMessageOpt("-mnconflock=<n>", strprintf(_("Lock masternodes from masternode configuration file (default: %u)"), 1));
|
strUsage += HelpMessageOpt("-mnconflock=<n>", strprintf(_("Lock masternodes from masternode configuration file (default: %u)"), 1));
|
||||||
strUsage += HelpMessageOpt("-masternodeprivkey=<n>", _("Set the masternode private key"));
|
strUsage += HelpMessageOpt("-masternodeprivkey=<n>", _("Set the masternode private key"));
|
||||||
|
|
||||||
|
#ifdef ENABLE_WALLET
|
||||||
strUsage += HelpMessageGroup(_("PrivateSend options:"));
|
strUsage += HelpMessageGroup(_("PrivateSend options:"));
|
||||||
strUsage += HelpMessageOpt("-enableprivatesend=<n>", strprintf(_("Enable use of automated PrivateSend for funds stored in this wallet (0-1, default: %u)"), 0));
|
strUsage += HelpMessageOpt("-enableprivatesend=<n>", strprintf(_("Enable use of automated PrivateSend for funds stored in this wallet (0-1, default: %u)"), 0));
|
||||||
strUsage += HelpMessageOpt("-privatesendmultisession=<n>", strprintf(_("Enable multiple PrivateSend mixing sessions per block, experimental (0-1, default: %u)"), DEFAULT_PRIVATESEND_MULTISESSION));
|
strUsage += HelpMessageOpt("-privatesendmultisession=<n>", strprintf(_("Enable multiple PrivateSend mixing sessions per block, experimental (0-1, default: %u)"), DEFAULT_PRIVATESEND_MULTISESSION));
|
||||||
strUsage += HelpMessageOpt("-privatesendrounds=<n>", strprintf(_("Use N separate masternodes for each denominated input to mix funds (2-16, default: %u)"), DEFAULT_PRIVATESEND_ROUNDS));
|
strUsage += HelpMessageOpt("-privatesendrounds=<n>", strprintf(_("Use N separate masternodes for each denominated input to mix funds (2-16, default: %u)"), DEFAULT_PRIVATESEND_ROUNDS));
|
||||||
strUsage += HelpMessageOpt("-privatesendamount=<n>", strprintf(_("Keep N DASH anonymized (default: %u)"), DEFAULT_PRIVATESEND_AMOUNT));
|
strUsage += HelpMessageOpt("-privatesendamount=<n>", strprintf(_("Keep N DASH anonymized (default: %u)"), DEFAULT_PRIVATESEND_AMOUNT));
|
||||||
strUsage += HelpMessageOpt("-liquidityprovider=<n>", strprintf(_("Provide liquidity to PrivateSend by infrequently mixing coins on a continual basis (0-100, default: %u, 1=very frequent, high fees, 100=very infrequent, low fees)"), DEFAULT_PRIVATESEND_LIQUIDITY));
|
strUsage += HelpMessageOpt("-liquidityprovider=<n>", strprintf(_("Provide liquidity to PrivateSend by infrequently mixing coins on a continual basis (0-100, default: %u, 1=very frequent, high fees, 100=very infrequent, low fees)"), DEFAULT_PRIVATESEND_LIQUIDITY));
|
||||||
|
#endif // ENABLE_WALLET
|
||||||
|
|
||||||
strUsage += HelpMessageGroup(_("InstantSend options:"));
|
strUsage += HelpMessageGroup(_("InstantSend options:"));
|
||||||
strUsage += HelpMessageOpt("-enableinstantsend=<n>", strprintf(_("Enable InstantSend, show confirmations for locked transactions (0-1, default: %u)"), 1));
|
strUsage += HelpMessageOpt("-enableinstantsend=<n>", strprintf(_("Enable InstantSend, show confirmations for locked transactions (0-1, default: %u)"), 1));
|
||||||
@ -903,6 +908,7 @@ void InitParameterInteraction()
|
|||||||
LogPrintf("%s: parameter interaction: -enableinstantsend=false -> setting -nInstantSendDepth=0\n", __func__);
|
LogPrintf("%s: parameter interaction: -enableinstantsend=false -> setting -nInstantSendDepth=0\n", __func__);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef ENABLE_WALLET
|
||||||
int nLiqProvTmp = GetArg("-liquidityprovider", DEFAULT_PRIVATESEND_LIQUIDITY);
|
int nLiqProvTmp = GetArg("-liquidityprovider", DEFAULT_PRIVATESEND_LIQUIDITY);
|
||||||
if (nLiqProvTmp > 0) {
|
if (nLiqProvTmp > 0) {
|
||||||
mapArgs["-enableprivatesend"] = "1";
|
mapArgs["-enableprivatesend"] = "1";
|
||||||
@ -920,6 +926,7 @@ void InitParameterInteraction()
|
|||||||
mapArgs.erase("-mnemonicpassphrase");
|
mapArgs.erase("-mnemonicpassphrase");
|
||||||
LogPrintf("%s: parameter interaction: can't use -hdseed and -mnemonic/-mnemonicpassphrase together, will prefer -seed\n", __func__);
|
LogPrintf("%s: parameter interaction: can't use -hdseed and -mnemonic/-mnemonicpassphrase together, will prefer -seed\n", __func__);
|
||||||
}
|
}
|
||||||
|
#endif // ENABLE_WALLET
|
||||||
}
|
}
|
||||||
|
|
||||||
void InitLogging()
|
void InitLogging()
|
||||||
@ -1894,6 +1901,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef ENABLE_WALLET
|
||||||
LogPrintf("Using masternode config file %s\n", GetMasternodeConfigFile().string());
|
LogPrintf("Using masternode config file %s\n", GetMasternodeConfigFile().string());
|
||||||
|
|
||||||
if(GetBoolArg("-mnconflock", true) && pwalletMain && (masternodeConfig.getCount() > 0)) {
|
if(GetBoolArg("-mnconflock", true) && pwalletMain && (masternodeConfig.getCount() > 0)) {
|
||||||
@ -1915,7 +1923,6 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
privateSendClient.nLiquidityProvider = std::min(std::max((int)GetArg("-liquidityprovider", DEFAULT_PRIVATESEND_LIQUIDITY), 0), 100);
|
privateSendClient.nLiquidityProvider = std::min(std::max((int)GetArg("-liquidityprovider", DEFAULT_PRIVATESEND_LIQUIDITY), 0), 100);
|
||||||
if(privateSendClient.nLiquidityProvider) {
|
if(privateSendClient.nLiquidityProvider) {
|
||||||
// special case for liquidity providers only, normal clients should use default value
|
// special case for liquidity providers only, normal clients should use default value
|
||||||
@ -1926,6 +1933,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
|||||||
privateSendClient.fPrivateSendMultiSession = GetBoolArg("-privatesendmultisession", DEFAULT_PRIVATESEND_MULTISESSION);
|
privateSendClient.fPrivateSendMultiSession = GetBoolArg("-privatesendmultisession", DEFAULT_PRIVATESEND_MULTISESSION);
|
||||||
privateSendClient.nPrivateSendRounds = std::min(std::max((int)GetArg("-privatesendrounds", DEFAULT_PRIVATESEND_ROUNDS), 2), privateSendClient.nLiquidityProvider ? 99999 : 16);
|
privateSendClient.nPrivateSendRounds = std::min(std::max((int)GetArg("-privatesendrounds", DEFAULT_PRIVATESEND_ROUNDS), 2), privateSendClient.nLiquidityProvider ? 99999 : 16);
|
||||||
privateSendClient.nPrivateSendAmount = std::min(std::max((int)GetArg("-privatesendamount", DEFAULT_PRIVATESEND_AMOUNT), 2), 999999);
|
privateSendClient.nPrivateSendAmount = std::min(std::max((int)GetArg("-privatesendamount", DEFAULT_PRIVATESEND_AMOUNT), 2), 999999);
|
||||||
|
#endif // ENABLE_WALLET
|
||||||
|
|
||||||
fEnableInstantSend = GetBoolArg("-enableinstantsend", 1);
|
fEnableInstantSend = GetBoolArg("-enableinstantsend", 1);
|
||||||
nInstantSendDepth = GetArg("-instantsenddepth", DEFAULT_INSTANTSEND_DEPTH);
|
nInstantSendDepth = GetArg("-instantsenddepth", DEFAULT_INSTANTSEND_DEPTH);
|
||||||
@ -1939,8 +1947,10 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
|||||||
|
|
||||||
LogPrintf("fLiteMode %d\n", fLiteMode);
|
LogPrintf("fLiteMode %d\n", fLiteMode);
|
||||||
LogPrintf("nInstantSendDepth %d\n", nInstantSendDepth);
|
LogPrintf("nInstantSendDepth %d\n", nInstantSendDepth);
|
||||||
|
#ifdef ENABLE_WALLET
|
||||||
LogPrintf("PrivateSend rounds %d\n", privateSendClient.nPrivateSendRounds);
|
LogPrintf("PrivateSend rounds %d\n", privateSendClient.nPrivateSendRounds);
|
||||||
LogPrintf("PrivateSend amount %d\n", privateSendClient.nPrivateSendAmount);
|
LogPrintf("PrivateSend amount %d\n", privateSendClient.nPrivateSendAmount);
|
||||||
|
#endif // ENABLE_WALLET
|
||||||
|
|
||||||
CPrivateSend::InitStandardDenominations();
|
CPrivateSend::InitStandardDenominations();
|
||||||
|
|
||||||
@ -1996,8 +2006,10 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
|||||||
threadGroup.create_thread(boost::bind(&ThreadCheckPrivateSend, boost::ref(*g_connman)));
|
threadGroup.create_thread(boost::bind(&ThreadCheckPrivateSend, boost::ref(*g_connman)));
|
||||||
if (fMasterNode)
|
if (fMasterNode)
|
||||||
threadGroup.create_thread(boost::bind(&ThreadCheckPrivateSendServer, boost::ref(*g_connman)));
|
threadGroup.create_thread(boost::bind(&ThreadCheckPrivateSendServer, boost::ref(*g_connman)));
|
||||||
|
#ifdef ENABLE_WALLET
|
||||||
else
|
else
|
||||||
threadGroup.create_thread(boost::bind(&ThreadCheckPrivateSendClient, boost::ref(*g_connman)));
|
threadGroup.create_thread(boost::bind(&ThreadCheckPrivateSendClient, boost::ref(*g_connman)));
|
||||||
|
#endif // ENABLE_WALLET
|
||||||
|
|
||||||
// ********************************************************* Step 12: start node
|
// ********************************************************* Step 12: start node
|
||||||
|
|
||||||
|
@ -16,11 +16,17 @@
|
|||||||
#include "txmempool.h"
|
#include "txmempool.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "consensus/validation.h"
|
#include "consensus/validation.h"
|
||||||
|
#include "validationinterface.h"
|
||||||
|
#ifdef ENABLE_WALLET
|
||||||
|
#include "wallet/wallet.h"
|
||||||
|
#endif // ENABLE_WALLET
|
||||||
|
|
||||||
#include <boost/algorithm/string/replace.hpp>
|
#include <boost/algorithm/string/replace.hpp>
|
||||||
#include <boost/thread.hpp>
|
#include <boost/thread.hpp>
|
||||||
|
|
||||||
|
#ifdef ENABLE_WALLET
|
||||||
extern CWallet* pwalletMain;
|
extern CWallet* pwalletMain;
|
||||||
|
#endif // ENABLE_WALLET
|
||||||
extern CTxMemPool mempool;
|
extern CTxMemPool mempool;
|
||||||
|
|
||||||
bool fEnableInstantSend = true;
|
bool fEnableInstantSend = true;
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
#include "masternodeman.h"
|
#include "masternodeman.h"
|
||||||
#include "netfulfilledman.h"
|
#include "netfulfilledman.h"
|
||||||
#include "spork.h"
|
#include "spork.h"
|
||||||
|
#include "ui_interface.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
class CMasternodeSync;
|
class CMasternodeSync;
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
|
||||||
#include "activemasternode.h"
|
#include "activemasternode.h"
|
||||||
|
#include "base58.h"
|
||||||
#include "init.h"
|
#include "init.h"
|
||||||
#include "netbase.h"
|
#include "netbase.h"
|
||||||
#include "masternode.h"
|
#include "masternode.h"
|
||||||
@ -10,7 +11,11 @@
|
|||||||
#include "masternode-sync.h"
|
#include "masternode-sync.h"
|
||||||
#include "masternodeman.h"
|
#include "masternodeman.h"
|
||||||
#include "messagesigner.h"
|
#include "messagesigner.h"
|
||||||
|
#include "script/standard.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
#ifdef ENABLE_WALLET
|
||||||
|
#include "wallet/wallet.h"
|
||||||
|
#endif // ENABLE_WALLET
|
||||||
|
|
||||||
#include <boost/lexical_cast.hpp>
|
#include <boost/lexical_cast.hpp>
|
||||||
|
|
||||||
@ -356,6 +361,7 @@ void CMasternode::UpdateLastPaid(const CBlockIndex *pindex, int nMaxBlocksToScan
|
|||||||
// LogPrint("masternode", "CMasternode::UpdateLastPaidBlock -- searching for block with payment to %s -- keeping old %d\n", vin.prevout.ToStringShort(), nBlockLastPaid);
|
// LogPrint("masternode", "CMasternode::UpdateLastPaidBlock -- searching for block with payment to %s -- keeping old %d\n", vin.prevout.ToStringShort(), nBlockLastPaid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef ENABLE_WALLET
|
||||||
bool CMasternodeBroadcast::Create(std::string strService, std::string strKeyMasternode, std::string strTxHash, std::string strOutputIndex, std::string& strErrorRet, CMasternodeBroadcast &mnbRet, bool fOffline)
|
bool CMasternodeBroadcast::Create(std::string strService, std::string strKeyMasternode, std::string strTxHash, std::string strOutputIndex, std::string& strErrorRet, CMasternodeBroadcast &mnbRet, bool fOffline)
|
||||||
{
|
{
|
||||||
COutPoint outpoint;
|
COutPoint outpoint;
|
||||||
@ -426,6 +432,7 @@ bool CMasternodeBroadcast::Create(const COutPoint& outpoint, const CService& ser
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
#endif // ENABLE_WALLET
|
||||||
|
|
||||||
bool CMasternodeBroadcast::SimpleCheck(int& nDos)
|
bool CMasternodeBroadcast::SimpleCheck(int& nDos)
|
||||||
{
|
{
|
||||||
|
@ -10,7 +10,10 @@
|
|||||||
#include "masternodeman.h"
|
#include "masternodeman.h"
|
||||||
#include "messagesigner.h"
|
#include "messagesigner.h"
|
||||||
#include "netfulfilledman.h"
|
#include "netfulfilledman.h"
|
||||||
|
#ifdef ENABLE_WALLET
|
||||||
#include "privatesend-client.h"
|
#include "privatesend-client.h"
|
||||||
|
#endif // ENABLE_WALLET
|
||||||
|
#include "script/standard.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
/** Masternode manager */
|
/** Masternode manager */
|
||||||
@ -732,8 +735,10 @@ void CMasternodeMan::ProcessMasternodeConnections(CConnman& connman)
|
|||||||
|
|
||||||
connman.ForEachNode(CConnman::AllNodes, [](CNode* pnode) {
|
connman.ForEachNode(CConnman::AllNodes, [](CNode* pnode) {
|
||||||
if(pnode->fMasternode) {
|
if(pnode->fMasternode) {
|
||||||
if(privateSendClient.infoMixingMasternode.fInfoValid && pnode->addr == privateSendClient.infoMixingMasternode.addr)
|
#ifdef ENABLE_WALLET
|
||||||
|
if(privateSendClient.infoMixingMasternode.fInfoValid && pnode->addr == privateSendClient.infoMixingMasternode.addr)
|
||||||
return;
|
return;
|
||||||
|
#endif // ENABLE_WALLET
|
||||||
LogPrintf("Closing Masternode connection: peer=%d, addr=%s\n", pnode->id, pnode->addr.ToString());
|
LogPrintf("Closing Masternode connection: peer=%d, addr=%s\n", pnode->id, pnode->addr.ToString());
|
||||||
pnode->fDisconnect = true;
|
pnode->fDisconnect = true;
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
#include "netbase.h"
|
#include "netbase.h"
|
||||||
#include "scheduler.h"
|
#include "scheduler.h"
|
||||||
#include "ui_interface.h"
|
#include "ui_interface.h"
|
||||||
#include "wallet/wallet.h"
|
|
||||||
#include "utilstrencodings.h"
|
#include "utilstrencodings.h"
|
||||||
|
|
||||||
#include "instantx.h"
|
#include "instantx.h"
|
||||||
|
@ -35,7 +35,9 @@
|
|||||||
#include "masternode-payments.h"
|
#include "masternode-payments.h"
|
||||||
#include "masternode-sync.h"
|
#include "masternode-sync.h"
|
||||||
#include "masternodeman.h"
|
#include "masternodeman.h"
|
||||||
|
#ifdef ENABLE_WALLET
|
||||||
#include "privatesend-client.h"
|
#include "privatesend-client.h"
|
||||||
|
#endif // ENABLE_WALLET
|
||||||
#include "privatesend-server.h"
|
#include "privatesend-server.h"
|
||||||
|
|
||||||
#include <boost/thread.hpp>
|
#include <boost/thread.hpp>
|
||||||
@ -2163,7 +2165,9 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
|
|||||||
if (found)
|
if (found)
|
||||||
{
|
{
|
||||||
//probably one the extensions
|
//probably one the extensions
|
||||||
|
#ifdef ENABLE_WALLET
|
||||||
privateSendClient.ProcessMessage(pfrom, strCommand, vRecv, connman);
|
privateSendClient.ProcessMessage(pfrom, strCommand, vRecv, connman);
|
||||||
|
#endif // ENABLE_WALLET
|
||||||
privateSendServer.ProcessMessage(pfrom, strCommand, vRecv, connman);
|
privateSendServer.ProcessMessage(pfrom, strCommand, vRecv, connman);
|
||||||
mnodeman.ProcessMessage(pfrom, strCommand, vRecv, connman);
|
mnodeman.ProcessMessage(pfrom, strCommand, vRecv, connman);
|
||||||
mnpayments.ProcessMessage(pfrom, strCommand, vRecv, connman);
|
mnpayments.ProcessMessage(pfrom, strCommand, vRecv, connman);
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
#include "init.h"
|
#include "init.h"
|
||||||
#include "masternode-sync.h"
|
#include "masternode-sync.h"
|
||||||
#include "masternodeman.h"
|
#include "masternodeman.h"
|
||||||
|
#include "script/interpreter.h"
|
||||||
#include "txmempool.h"
|
#include "txmempool.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "utilmoneystr.h"
|
#include "utilmoneystr.h"
|
||||||
|
@ -551,6 +551,7 @@ void BitcoinGUI::createMenuBar()
|
|||||||
|
|
||||||
void BitcoinGUI::createToolBars()
|
void BitcoinGUI::createToolBars()
|
||||||
{
|
{
|
||||||
|
#ifdef ENABLE_WALLET
|
||||||
if(walletFrame)
|
if(walletFrame)
|
||||||
{
|
{
|
||||||
QToolBar *toolbar = new QToolBar(tr("Tabs toolbar"));
|
QToolBar *toolbar = new QToolBar(tr("Tabs toolbar"));
|
||||||
@ -579,6 +580,7 @@ void BitcoinGUI::createToolBars()
|
|||||||
containerWidget->setLayout(layout);
|
containerWidget->setLayout(layout);
|
||||||
setCentralWidget(containerWidget);
|
setCentralWidget(containerWidget);
|
||||||
}
|
}
|
||||||
|
#endif // ENABLE_WALLET
|
||||||
}
|
}
|
||||||
|
|
||||||
void BitcoinGUI::setClientModel(ClientModel *clientModel)
|
void BitcoinGUI::setClientModel(ClientModel *clientModel)
|
||||||
|
@ -19,9 +19,9 @@
|
|||||||
|
|
||||||
#ifdef ENABLE_WALLET
|
#ifdef ENABLE_WALLET
|
||||||
#include "wallet/wallet.h" // for CWallet::GetRequiredFee()
|
#include "wallet/wallet.h" // for CWallet::GetRequiredFee()
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "privatesend-client.h"
|
#include "privatesend-client.h"
|
||||||
|
#endif // ENABLE_WALLET
|
||||||
|
|
||||||
#include <boost/thread.hpp>
|
#include <boost/thread.hpp>
|
||||||
|
|
||||||
@ -32,7 +32,9 @@
|
|||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
|
||||||
|
#ifdef ENABLE_WALLET
|
||||||
extern CWallet* pwalletMain;
|
extern CWallet* pwalletMain;
|
||||||
|
#endif // ENABLE_WALLET
|
||||||
|
|
||||||
OptionsDialog::OptionsDialog(QWidget *parent, bool enableWallet) :
|
OptionsDialog::OptionsDialog(QWidget *parent, bool enableWallet) :
|
||||||
QDialog(parent),
|
QDialog(parent),
|
||||||
@ -262,8 +264,11 @@ void OptionsDialog::on_resetButton_clicked()
|
|||||||
void OptionsDialog::on_okButton_clicked()
|
void OptionsDialog::on_okButton_clicked()
|
||||||
{
|
{
|
||||||
mapper->submit();
|
mapper->submit();
|
||||||
|
#ifdef ENABLE_WALLET
|
||||||
privateSendClient.nCachedNumBlocks = std::numeric_limits<int>::max();
|
privateSendClient.nCachedNumBlocks = std::numeric_limits<int>::max();
|
||||||
pwalletMain->MarkDirty();
|
if(pwalletMain)
|
||||||
|
pwalletMain->MarkDirty();
|
||||||
|
#endif // ENABLE_WALLET
|
||||||
accept();
|
accept();
|
||||||
updateDefaultProxyNets();
|
updateDefaultProxyNets();
|
||||||
}
|
}
|
||||||
|
@ -22,12 +22,10 @@
|
|||||||
#ifdef ENABLE_WALLET
|
#ifdef ENABLE_WALLET
|
||||||
#include "wallet/wallet.h"
|
#include "wallet/wallet.h"
|
||||||
#include "wallet/walletdb.h"
|
#include "wallet/walletdb.h"
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef ENABLE_WALLET
|
|
||||||
#include "masternodeconfig.h"
|
#include "masternodeconfig.h"
|
||||||
#endif
|
|
||||||
#include "privatesend-client.h"
|
#include "privatesend-client.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <QNetworkProxy>
|
#include <QNetworkProxy>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
@ -82,14 +80,16 @@ void OptionsModel::Init(bool resetSettings)
|
|||||||
settings.setValue("strThirdPartyTxUrls", "");
|
settings.setValue("strThirdPartyTxUrls", "");
|
||||||
strThirdPartyTxUrls = settings.value("strThirdPartyTxUrls", "").toString();
|
strThirdPartyTxUrls = settings.value("strThirdPartyTxUrls", "").toString();
|
||||||
|
|
||||||
|
if (!settings.contains("theme"))
|
||||||
|
settings.setValue("theme", "");
|
||||||
|
|
||||||
|
#ifdef ENABLE_WALLET
|
||||||
if (!settings.contains("fCoinControlFeatures"))
|
if (!settings.contains("fCoinControlFeatures"))
|
||||||
settings.setValue("fCoinControlFeatures", false);
|
settings.setValue("fCoinControlFeatures", false);
|
||||||
fCoinControlFeatures = settings.value("fCoinControlFeatures", false).toBool();
|
fCoinControlFeatures = settings.value("fCoinControlFeatures", false).toBool();
|
||||||
|
|
||||||
if (!settings.contains("digits"))
|
if (!settings.contains("digits"))
|
||||||
settings.setValue("digits", "2");
|
settings.setValue("digits", "2");
|
||||||
if (!settings.contains("theme"))
|
|
||||||
settings.setValue("theme", "");
|
|
||||||
|
|
||||||
if (!settings.contains("fShowMasternodesTab"))
|
if (!settings.contains("fShowMasternodesTab"))
|
||||||
settings.setValue("fShowMasternodesTab", masternodeConfig.getCount());
|
settings.setValue("fShowMasternodesTab", masternodeConfig.getCount());
|
||||||
@ -100,6 +100,7 @@ void OptionsModel::Init(bool resetSettings)
|
|||||||
|
|
||||||
if (!settings.contains("fLowKeysWarning"))
|
if (!settings.contains("fLowKeysWarning"))
|
||||||
settings.setValue("fLowKeysWarning", true);
|
settings.setValue("fLowKeysWarning", true);
|
||||||
|
#endif // ENABLE_WALLET
|
||||||
|
|
||||||
// These are shared with the core or have a command-line parameter
|
// These are shared with the core or have a command-line parameter
|
||||||
// and we want command-line parameters to overwrite the GUI settings.
|
// and we want command-line parameters to overwrite the GUI settings.
|
||||||
@ -281,14 +282,18 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const
|
|||||||
return nDisplayUnit;
|
return nDisplayUnit;
|
||||||
case ThirdPartyTxUrls:
|
case ThirdPartyTxUrls:
|
||||||
return strThirdPartyTxUrls;
|
return strThirdPartyTxUrls;
|
||||||
|
#ifdef ENABLE_WALLET
|
||||||
case Digits:
|
case Digits:
|
||||||
return settings.value("digits");
|
return settings.value("digits");
|
||||||
|
#endif // ENABLE_WALLET
|
||||||
case Theme:
|
case Theme:
|
||||||
return settings.value("theme");
|
return settings.value("theme");
|
||||||
case Language:
|
case Language:
|
||||||
return settings.value("language");
|
return settings.value("language");
|
||||||
|
#ifdef ENABLE_WALLET
|
||||||
case CoinControlFeatures:
|
case CoinControlFeatures:
|
||||||
return fCoinControlFeatures;
|
return fCoinControlFeatures;
|
||||||
|
#endif // ENABLE_WALLET
|
||||||
case DatabaseCache:
|
case DatabaseCache:
|
||||||
return settings.value("nDatabaseCache");
|
return settings.value("nDatabaseCache");
|
||||||
case ThreadsScriptVerif:
|
case ThreadsScriptVerif:
|
||||||
@ -451,12 +456,14 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in
|
|||||||
setRestartRequired(true);
|
setRestartRequired(true);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
#ifdef ENABLE_WALLET
|
||||||
case Digits:
|
case Digits:
|
||||||
if (settings.value("digits") != value) {
|
if (settings.value("digits") != value) {
|
||||||
settings.setValue("digits", value);
|
settings.setValue("digits", value);
|
||||||
setRestartRequired(true);
|
setRestartRequired(true);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
#endif // ENABLE_WALLET
|
||||||
case Theme:
|
case Theme:
|
||||||
if (settings.value("theme") != value) {
|
if (settings.value("theme") != value) {
|
||||||
settings.setValue("theme", value);
|
settings.setValue("theme", value);
|
||||||
@ -469,11 +476,13 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in
|
|||||||
setRestartRequired(true);
|
setRestartRequired(true);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
#ifdef ENABLE_WALLET
|
||||||
case CoinControlFeatures:
|
case CoinControlFeatures:
|
||||||
fCoinControlFeatures = value.toBool();
|
fCoinControlFeatures = value.toBool();
|
||||||
settings.setValue("fCoinControlFeatures", fCoinControlFeatures);
|
settings.setValue("fCoinControlFeatures", fCoinControlFeatures);
|
||||||
Q_EMIT coinControlFeaturesChanged(fCoinControlFeatures);
|
Q_EMIT coinControlFeaturesChanged(fCoinControlFeatures);
|
||||||
break;
|
break;
|
||||||
|
#endif // ENABLE_WALLET
|
||||||
case DatabaseCache:
|
case DatabaseCache:
|
||||||
if (settings.value("nDatabaseCache") != value) {
|
if (settings.value("nDatabaseCache") != value) {
|
||||||
settings.setValue("nDatabaseCache", value);
|
settings.setValue("nDatabaseCache", value);
|
||||||
|
@ -8,7 +8,9 @@
|
|||||||
#include "paymentrequestplus.h"
|
#include "paymentrequestplus.h"
|
||||||
#include "walletmodeltransaction.h"
|
#include "walletmodeltransaction.h"
|
||||||
|
|
||||||
|
#ifdef ENABLE_WALLET
|
||||||
#include "wallet/wallet.h"
|
#include "wallet/wallet.h"
|
||||||
|
#endif // ENABLE_WALLET
|
||||||
#include "support/allocators/secure.h"
|
#include "support/allocators/secure.h"
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
@ -49,7 +51,9 @@ public:
|
|||||||
// Todo: This is a hack, should be replaced with a cleaner solution!
|
// Todo: This is a hack, should be replaced with a cleaner solution!
|
||||||
QString address;
|
QString address;
|
||||||
QString label;
|
QString label;
|
||||||
|
#ifdef ENABLE_WALLET
|
||||||
AvailableCoinsType inputType;
|
AvailableCoinsType inputType;
|
||||||
|
#endif // ENABLE_WALLET
|
||||||
bool fUseInstantSend;
|
bool fUseInstantSend;
|
||||||
CAmount amount;
|
CAmount amount;
|
||||||
// If from a payment request, this is used for storing the memo
|
// If from a payment request, this is used for storing the memo
|
||||||
|
@ -19,6 +19,9 @@
|
|||||||
#include "rpc/server.h"
|
#include "rpc/server.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "utilmoneystr.h"
|
#include "utilmoneystr.h"
|
||||||
|
#ifdef ENABLE_WALLET
|
||||||
|
#include "wallet/wallet.h"
|
||||||
|
#endif // ENABLE_WALLET
|
||||||
|
|
||||||
#include <boost/lexical_cast.hpp>
|
#include <boost/lexical_cast.hpp>
|
||||||
|
|
||||||
@ -29,7 +32,11 @@ UniValue gobject(const UniValue& params, bool fHelp)
|
|||||||
strCommand = params[0].get_str();
|
strCommand = params[0].get_str();
|
||||||
|
|
||||||
if (fHelp ||
|
if (fHelp ||
|
||||||
(strCommand != "vote-many" && strCommand != "vote-conf" && strCommand != "vote-alias" && strCommand != "prepare" && strCommand != "submit" && strCommand != "count" &&
|
(
|
||||||
|
#ifdef ENABLE_WALLET
|
||||||
|
strCommand != "prepare" &&
|
||||||
|
#endif // ENABLE_WALLET
|
||||||
|
strCommand != "vote-many" && strCommand != "vote-conf" && strCommand != "vote-alias" && strCommand != "submit" && strCommand != "count" &&
|
||||||
strCommand != "deserialize" && strCommand != "get" && strCommand != "getvotes" && strCommand != "getcurrentvotes" && strCommand != "list" && strCommand != "diff" &&
|
strCommand != "deserialize" && strCommand != "get" && strCommand != "getvotes" && strCommand != "getcurrentvotes" && strCommand != "list" && strCommand != "diff" &&
|
||||||
strCommand != "check" ))
|
strCommand != "check" ))
|
||||||
throw std::runtime_error(
|
throw std::runtime_error(
|
||||||
@ -37,7 +44,9 @@ UniValue gobject(const UniValue& params, bool fHelp)
|
|||||||
"Manage governance objects\n"
|
"Manage governance objects\n"
|
||||||
"\nAvailable commands:\n"
|
"\nAvailable commands:\n"
|
||||||
" check - Validate governance object data (proposal only)\n"
|
" check - Validate governance object data (proposal only)\n"
|
||||||
|
#ifdef ENABLE_WALLET
|
||||||
" prepare - Prepare governance object by signing and creating tx\n"
|
" prepare - Prepare governance object by signing and creating tx\n"
|
||||||
|
#endif // ENABLE_WALLET
|
||||||
" submit - Submit governance object to network\n"
|
" submit - Submit governance object to network\n"
|
||||||
" deserialize - Deserialize governance object from hex string to JSON\n"
|
" deserialize - Deserialize governance object from hex string to JSON\n"
|
||||||
" count - Count governance objects and votes\n"
|
" count - Count governance objects and votes\n"
|
||||||
@ -113,6 +122,7 @@ UniValue gobject(const UniValue& params, bool fHelp)
|
|||||||
return objResult;
|
return objResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef ENABLE_WALLET
|
||||||
// PREPARE THE GOVERNANCE OBJECT BY CREATING A COLLATERAL TRANSACTION
|
// PREPARE THE GOVERNANCE OBJECT BY CREATING A COLLATERAL TRANSACTION
|
||||||
if(strCommand == "prepare")
|
if(strCommand == "prepare")
|
||||||
{
|
{
|
||||||
@ -178,6 +188,7 @@ UniValue gobject(const UniValue& params, bool fHelp)
|
|||||||
|
|
||||||
return wtx.GetHash().ToString();
|
return wtx.GetHash().ToString();
|
||||||
}
|
}
|
||||||
|
#endif // ENABLE_WALLET
|
||||||
|
|
||||||
// AFTER COLLATERAL TRANSACTION HAS MATURED USER CAN SUBMIT GOVERNANCE OBJECT TO PROPAGATE NETWORK
|
// AFTER COLLATERAL TRANSACTION HAS MATURED USER CAN SUBMIT GOVERNANCE OBJECT TO PROPAGATE NETWORK
|
||||||
if(strCommand == "submit")
|
if(strCommand == "submit")
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
|
||||||
#include "activemasternode.h"
|
#include "activemasternode.h"
|
||||||
|
#include "base58.h"
|
||||||
#include "init.h"
|
#include "init.h"
|
||||||
#include "netbase.h"
|
#include "netbase.h"
|
||||||
#include "validation.h"
|
#include "validation.h"
|
||||||
@ -10,7 +11,9 @@
|
|||||||
#include "masternode-sync.h"
|
#include "masternode-sync.h"
|
||||||
#include "masternodeconfig.h"
|
#include "masternodeconfig.h"
|
||||||
#include "masternodeman.h"
|
#include "masternodeman.h"
|
||||||
|
#ifdef ENABLE_WALLET
|
||||||
#include "privatesend-client.h"
|
#include "privatesend-client.h"
|
||||||
|
#endif // ENABLE_WALLET
|
||||||
#include "privatesend-server.h"
|
#include "privatesend-server.h"
|
||||||
#include "rpc/server.h"
|
#include "rpc/server.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
@ -20,6 +23,7 @@
|
|||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
#include <univalue.h>
|
#include <univalue.h>
|
||||||
|
|
||||||
|
#ifdef ENABLE_WALLET
|
||||||
void EnsureWalletIsUnlocked();
|
void EnsureWalletIsUnlocked();
|
||||||
|
|
||||||
UniValue privatesend(const UniValue& params, bool fHelp)
|
UniValue privatesend(const UniValue& params, bool fHelp)
|
||||||
@ -61,6 +65,7 @@ UniValue privatesend(const UniValue& params, bool fHelp)
|
|||||||
|
|
||||||
return "Unknown command, please see \"help privatesend\"";
|
return "Unknown command, please see \"help privatesend\"";
|
||||||
}
|
}
|
||||||
|
#endif // ENABLE_WALLET
|
||||||
|
|
||||||
UniValue getpoolinfo(const UniValue& params, bool fHelp)
|
UniValue getpoolinfo(const UniValue& params, bool fHelp)
|
||||||
{
|
{
|
||||||
@ -69,6 +74,7 @@ UniValue getpoolinfo(const UniValue& params, bool fHelp)
|
|||||||
"getpoolinfo\n"
|
"getpoolinfo\n"
|
||||||
"Returns an object containing mixing pool related information.\n");
|
"Returns an object containing mixing pool related information.\n");
|
||||||
|
|
||||||
|
#ifdef ENABLE_WALLET
|
||||||
CPrivateSendBase privateSend = fMasterNode ? (CPrivateSendBase)privateSendServer : (CPrivateSendBase)privateSendClient;
|
CPrivateSendBase privateSend = fMasterNode ? (CPrivateSendBase)privateSendServer : (CPrivateSendBase)privateSendClient;
|
||||||
|
|
||||||
UniValue obj(UniValue::VOBJ);
|
UniValue obj(UniValue::VOBJ);
|
||||||
@ -88,6 +94,12 @@ UniValue getpoolinfo(const UniValue& params, bool fHelp)
|
|||||||
obj.push_back(Pair("warnings", pwalletMain->nKeysLeftSinceAutoBackup < PRIVATESEND_KEYS_THRESHOLD_WARNING
|
obj.push_back(Pair("warnings", pwalletMain->nKeysLeftSinceAutoBackup < PRIVATESEND_KEYS_THRESHOLD_WARNING
|
||||||
? "WARNING: keypool is almost depleted!" : ""));
|
? "WARNING: keypool is almost depleted!" : ""));
|
||||||
}
|
}
|
||||||
|
#else // ENABLE_WALLET
|
||||||
|
UniValue obj(UniValue::VOBJ);
|
||||||
|
obj.push_back(Pair("state", privateSendServer.GetStateString()));
|
||||||
|
obj.push_back(Pair("queue", privateSendServer.GetQueueSize()));
|
||||||
|
obj.push_back(Pair("entries", privateSendServer.GetEntriesCount()));
|
||||||
|
#endif // ENABLE_WALLET
|
||||||
|
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
@ -100,14 +112,20 @@ UniValue masternode(const UniValue& params, bool fHelp)
|
|||||||
strCommand = params[0].get_str();
|
strCommand = params[0].get_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef ENABLE_WALLET
|
||||||
if (strCommand == "start-many")
|
if (strCommand == "start-many")
|
||||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "DEPRECATED, please use start-all instead");
|
throw JSONRPCError(RPC_INVALID_PARAMETER, "DEPRECATED, please use start-all instead");
|
||||||
|
#endif // ENABLE_WALLET
|
||||||
|
|
||||||
if (fHelp ||
|
if (fHelp ||
|
||||||
(strCommand != "start" && strCommand != "start-alias" && strCommand != "start-all" && strCommand != "start-missing" &&
|
(
|
||||||
strCommand != "start-disabled" && strCommand != "list" && strCommand != "list-conf" && strCommand != "count" &&
|
#ifdef ENABLE_WALLET
|
||||||
|
strCommand != "start-alias" && strCommand != "start-all" && strCommand != "start-missing" &&
|
||||||
|
strCommand != "start-disabled" && strCommand != "outputs" &&
|
||||||
|
#endif // ENABLE_WALLET
|
||||||
|
strCommand != "list" && strCommand != "list-conf" && strCommand != "count" &&
|
||||||
strCommand != "debug" && strCommand != "current" && strCommand != "winner" && strCommand != "winners" && strCommand != "genkey" &&
|
strCommand != "debug" && strCommand != "current" && strCommand != "winner" && strCommand != "winners" && strCommand != "genkey" &&
|
||||||
strCommand != "connect" && strCommand != "outputs" && strCommand != "status"))
|
strCommand != "connect" && strCommand != "status"))
|
||||||
throw std::runtime_error(
|
throw std::runtime_error(
|
||||||
"masternode \"command\"...\n"
|
"masternode \"command\"...\n"
|
||||||
"Set of commands to execute masternode related actions\n"
|
"Set of commands to execute masternode related actions\n"
|
||||||
@ -117,9 +135,11 @@ UniValue masternode(const UniValue& params, bool fHelp)
|
|||||||
" count - Print number of all known masternodes (optional: 'ps', 'enabled', 'all', 'qualify')\n"
|
" count - Print number of all known masternodes (optional: 'ps', 'enabled', 'all', 'qualify')\n"
|
||||||
" current - Print info on current masternode winner to be paid the next block (calculated locally)\n"
|
" current - Print info on current masternode winner to be paid the next block (calculated locally)\n"
|
||||||
" genkey - Generate new masternodeprivkey\n"
|
" genkey - Generate new masternodeprivkey\n"
|
||||||
|
#ifdef ENABLE_WALLET
|
||||||
" outputs - Print masternode compatible outputs\n"
|
" outputs - Print masternode compatible outputs\n"
|
||||||
" start-alias - Start single remote masternode by assigned alias configured in masternode.conf\n"
|
" start-alias - Start single remote masternode by assigned alias configured in masternode.conf\n"
|
||||||
" start-<mode> - Start remote masternodes configured in masternode.conf (<mode>: 'all', 'missing', 'disabled')\n"
|
" start-<mode> - Start remote masternodes configured in masternode.conf (<mode>: 'all', 'missing', 'disabled')\n"
|
||||||
|
#endif // ENABLE_WALLET
|
||||||
" status - Print masternode status information\n"
|
" status - Print masternode status information\n"
|
||||||
" list - Print list of all known masternodes (see masternodelist for more info)\n"
|
" list - Print list of all known masternodes (see masternodelist for more info)\n"
|
||||||
" list-conf - Print masternode.conf in JSON format\n"
|
" list-conf - Print masternode.conf in JSON format\n"
|
||||||
@ -213,6 +233,7 @@ UniValue masternode(const UniValue& params, bool fHelp)
|
|||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef ENABLE_WALLET
|
||||||
if (strCommand == "start-alias")
|
if (strCommand == "start-alias")
|
||||||
{
|
{
|
||||||
if (params.size() < 2)
|
if (params.size() < 2)
|
||||||
@ -311,6 +332,7 @@ UniValue masternode(const UniValue& params, bool fHelp)
|
|||||||
|
|
||||||
return returnObj;
|
return returnObj;
|
||||||
}
|
}
|
||||||
|
#endif // ENABLE_WALLET
|
||||||
|
|
||||||
if (strCommand == "genkey")
|
if (strCommand == "genkey")
|
||||||
{
|
{
|
||||||
@ -344,6 +366,7 @@ UniValue masternode(const UniValue& params, bool fHelp)
|
|||||||
return resultObj;
|
return resultObj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef ENABLE_WALLET
|
||||||
if (strCommand == "outputs") {
|
if (strCommand == "outputs") {
|
||||||
// Find possible candidates
|
// Find possible candidates
|
||||||
std::vector<COutput> vPossibleCoins;
|
std::vector<COutput> vPossibleCoins;
|
||||||
@ -355,8 +378,8 @@ UniValue masternode(const UniValue& params, bool fHelp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
return obj;
|
return obj;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
#endif // ENABLE_WALLET
|
||||||
|
|
||||||
if (strCommand == "status")
|
if (strCommand == "status")
|
||||||
{
|
{
|
||||||
@ -576,19 +599,26 @@ UniValue masternodebroadcast(const UniValue& params, bool fHelp)
|
|||||||
strCommand = params[0].get_str();
|
strCommand = params[0].get_str();
|
||||||
|
|
||||||
if (fHelp ||
|
if (fHelp ||
|
||||||
(strCommand != "create-alias" && strCommand != "create-all" && strCommand != "decode" && strCommand != "relay"))
|
(
|
||||||
|
#ifdef ENABLE_WALLET
|
||||||
|
strCommand != "create-alias" && strCommand != "create-all" &&
|
||||||
|
#endif // ENABLE_WALLET
|
||||||
|
strCommand != "decode" && strCommand != "relay"))
|
||||||
throw std::runtime_error(
|
throw std::runtime_error(
|
||||||
"masternodebroadcast \"command\"...\n"
|
"masternodebroadcast \"command\"...\n"
|
||||||
"Set of commands to create and relay masternode broadcast messages\n"
|
"Set of commands to create and relay masternode broadcast messages\n"
|
||||||
"\nArguments:\n"
|
"\nArguments:\n"
|
||||||
"1. \"command\" (string or set of strings, required) The command to execute\n"
|
"1. \"command\" (string or set of strings, required) The command to execute\n"
|
||||||
"\nAvailable commands:\n"
|
"\nAvailable commands:\n"
|
||||||
|
#ifdef ENABLE_WALLET
|
||||||
" create-alias - Create single remote masternode broadcast message by assigned alias configured in masternode.conf\n"
|
" create-alias - Create single remote masternode broadcast message by assigned alias configured in masternode.conf\n"
|
||||||
" create-all - Create remote masternode broadcast messages for all masternodes configured in masternode.conf\n"
|
" create-all - Create remote masternode broadcast messages for all masternodes configured in masternode.conf\n"
|
||||||
|
#endif // ENABLE_WALLET
|
||||||
" decode - Decode masternode broadcast message\n"
|
" decode - Decode masternode broadcast message\n"
|
||||||
" relay - Relay masternode broadcast message to the network\n"
|
" relay - Relay masternode broadcast message to the network\n"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
#ifdef ENABLE_WALLET
|
||||||
if (strCommand == "create-alias")
|
if (strCommand == "create-alias")
|
||||||
{
|
{
|
||||||
// wait for reindex and/or import to finish
|
// wait for reindex and/or import to finish
|
||||||
@ -691,6 +721,7 @@ UniValue masternodebroadcast(const UniValue& params, bool fHelp)
|
|||||||
|
|
||||||
return returnObj;
|
return returnObj;
|
||||||
}
|
}
|
||||||
|
#endif // ENABLE_WALLET
|
||||||
|
|
||||||
if (strCommand == "decode")
|
if (strCommand == "decode")
|
||||||
{
|
{
|
||||||
|
@ -21,14 +21,12 @@
|
|||||||
#include "spork.h"
|
#include "spork.h"
|
||||||
#include "txmempool.h"
|
#include "txmempool.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#ifdef ENABLE_WALLET
|
|
||||||
#include "masternode-sync.h"
|
|
||||||
#endif
|
|
||||||
#include "utilstrencodings.h"
|
#include "utilstrencodings.h"
|
||||||
#include "validationinterface.h"
|
#include "validationinterface.h"
|
||||||
|
|
||||||
#include "masternode-payments.h"
|
|
||||||
#include "governance-classes.h"
|
#include "governance-classes.h"
|
||||||
|
#include "masternode-payments.h"
|
||||||
|
#include "masternode-sync.h"
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
@ -7,21 +7,22 @@
|
|||||||
#include "base58.h"
|
#include "base58.h"
|
||||||
#include "clientversion.h"
|
#include "clientversion.h"
|
||||||
#include "init.h"
|
#include "init.h"
|
||||||
#include "validation.h"
|
|
||||||
#include "net.h"
|
#include "net.h"
|
||||||
#include "netbase.h"
|
#include "netbase.h"
|
||||||
#include "rpc/server.h"
|
#include "rpc/server.h"
|
||||||
#include "timedata.h"
|
#include "timedata.h"
|
||||||
#include "txmempool.h"
|
#include "txmempool.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "spork.h"
|
|
||||||
#include "utilstrencodings.h"
|
#include "utilstrencodings.h"
|
||||||
|
#include "validation.h"
|
||||||
#ifdef ENABLE_WALLET
|
#ifdef ENABLE_WALLET
|
||||||
#include "masternode-sync.h"
|
|
||||||
#include "wallet/wallet.h"
|
#include "wallet/wallet.h"
|
||||||
#include "wallet/walletdb.h"
|
#include "wallet/walletdb.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "masternode-sync.h"
|
||||||
|
#include "spork.h"
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#include <boost/assign/list_of.hpp>
|
#include <boost/assign/list_of.hpp>
|
||||||
@ -238,7 +239,9 @@ UniValue spork(const UniValue& params, bool fHelp)
|
|||||||
ret.push_back(Pair(sporkManager.GetSporkNameByID(nSporkID), sporkManager.IsSporkActive(nSporkID)));
|
ret.push_back(Pair(sporkManager.GetSporkNameByID(nSporkID), sporkManager.IsSporkActive(nSporkID)));
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
} else if (params.size() == 2){
|
}
|
||||||
|
#ifdef ENABLE_WALLET
|
||||||
|
else if (params.size() == 2){
|
||||||
int nSporkID = sporkManager.GetSporkIDByName(params[0].get_str());
|
int nSporkID = sporkManager.GetSporkIDByName(params[0].get_str());
|
||||||
if(nSporkID == -1){
|
if(nSporkID == -1){
|
||||||
return "Invalid spork name";
|
return "Invalid spork name";
|
||||||
@ -262,9 +265,15 @@ UniValue spork(const UniValue& params, bool fHelp)
|
|||||||
|
|
||||||
throw runtime_error(
|
throw runtime_error(
|
||||||
"spork <name> [<value>]\n"
|
"spork <name> [<value>]\n"
|
||||||
"<name> is the corresponding spork name, or 'show' to show all current spork settings, active to show which sporks are active"
|
"<name> is the corresponding spork name, or 'show' to show all current spork settings, active to show which sporks are active\n"
|
||||||
"<value> is a epoch datetime to enable or disable spork"
|
"<value> is a epoch datetime to enable or disable spork\n"
|
||||||
+ HelpRequiringPassphrase());
|
+ HelpRequiringPassphrase());
|
||||||
|
#else // ENABLE_WALLET
|
||||||
|
throw runtime_error(
|
||||||
|
"spork <name>\n"
|
||||||
|
"<name> is the corresponding spork name, or 'show' to show all current spork settings, active to show which sporks are active\n");
|
||||||
|
#endif // ENABLE_WALLET
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
UniValue validateaddress(const UniValue& params, bool fHelp)
|
UniValue validateaddress(const UniValue& params, bool fHelp)
|
||||||
|
@ -163,6 +163,9 @@ extern CFeeRate minRelayTxFee;
|
|||||||
extern bool fAlerts;
|
extern bool fAlerts;
|
||||||
extern bool fEnableReplacement;
|
extern bool fEnableReplacement;
|
||||||
|
|
||||||
|
extern bool fLargeWorkForkFound;
|
||||||
|
extern bool fLargeWorkInvalidChainFound;
|
||||||
|
|
||||||
extern std::map<uint256, int64_t> mapRejectedBlocks;
|
extern std::map<uint256, int64_t> mapRejectedBlocks;
|
||||||
|
|
||||||
static const int DIP0001_PROTOCOL_VERSION = 70208;
|
static const int DIP0001_PROTOCOL_VERSION = 70208;
|
||||||
|
@ -39,9 +39,6 @@ extern unsigned int nTxConfirmTarget;
|
|||||||
extern bool bSpendZeroConfChange;
|
extern bool bSpendZeroConfChange;
|
||||||
extern bool fSendFreeTransactions;
|
extern bool fSendFreeTransactions;
|
||||||
|
|
||||||
extern bool fLargeWorkForkFound;
|
|
||||||
extern bool fLargeWorkInvalidChainFound;
|
|
||||||
|
|
||||||
static const unsigned int DEFAULT_KEYPOOL_SIZE = 1000;
|
static const unsigned int DEFAULT_KEYPOOL_SIZE = 1000;
|
||||||
//! -paytxfee default
|
//! -paytxfee default
|
||||||
static const CAmount DEFAULT_TRANSACTION_FEE = 0;
|
static const CAmount DEFAULT_TRANSACTION_FEE = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user