mirror of
https://github.com/dashpay/dash.git
synced 2024-12-24 19:42:46 +01:00
Disable in-wallet miner for win/macos Travis/Gitian builds (#2778)
* Add new configure option to disable in-wallet miner * Use new option to disable in-wallet miner for win/macos Travis/Gitian builds
This commit is contained in:
parent
4570079e53
commit
46d875100b
@ -41,7 +41,7 @@ elif [ "$BUILD_TARGET" = "win32" ]; then
|
|||||||
export DPKG_ADD_ARCH="i386"
|
export DPKG_ADD_ARCH="i386"
|
||||||
export DEP_OPTS="NO_QT=1"
|
export DEP_OPTS="NO_QT=1"
|
||||||
export PACKAGES="python3 nsis g++-mingw-w64-i686 wine-stable wine32 bc"
|
export PACKAGES="python3 nsis g++-mingw-w64-i686 wine-stable wine32 bc"
|
||||||
export BITCOIN_CONFIG="--enable-gui --enable-reduce-exports"
|
export BITCOIN_CONFIG="--enable-gui --enable-reduce-exports --disable-miner"
|
||||||
export DIRECT_WINE_EXEC_TESTS=true
|
export DIRECT_WINE_EXEC_TESTS=true
|
||||||
export RUN_TESTS=true
|
export RUN_TESTS=true
|
||||||
elif [ "$BUILD_TARGET" = "win64" ]; then
|
elif [ "$BUILD_TARGET" = "win64" ]; then
|
||||||
@ -49,7 +49,7 @@ elif [ "$BUILD_TARGET" = "win64" ]; then
|
|||||||
export DPKG_ADD_ARCH="i386"
|
export DPKG_ADD_ARCH="i386"
|
||||||
export DEP_OPTS="NO_QT=1"
|
export DEP_OPTS="NO_QT=1"
|
||||||
export PACKAGES="python3 nsis g++-mingw-w64-x86-64 wine-stable wine64 bc"
|
export PACKAGES="python3 nsis g++-mingw-w64-x86-64 wine-stable wine64 bc"
|
||||||
export BITCOIN_CONFIG="--enable-gui --enable-reduce-exports"
|
export BITCOIN_CONFIG="--enable-gui --enable-reduce-exports --disable-miner"
|
||||||
export DIRECT_WINE_EXEC_TESTS=true
|
export DIRECT_WINE_EXEC_TESTS=true
|
||||||
export RUN_TESTS=true
|
export RUN_TESTS=true
|
||||||
elif [ "$BUILD_TARGET" = "linux32" ]; then
|
elif [ "$BUILD_TARGET" = "linux32" ]; then
|
||||||
@ -82,7 +82,7 @@ elif [ "$BUILD_TARGET" = "linux64_release" ]; then
|
|||||||
elif [ "$BUILD_TARGET" = "mac" ]; then
|
elif [ "$BUILD_TARGET" = "mac" ]; then
|
||||||
export HOST=x86_64-apple-darwin11
|
export HOST=x86_64-apple-darwin11
|
||||||
export PACKAGES="cmake imagemagick libcap-dev librsvg2-bin libz-dev libbz2-dev libtiff-tools"
|
export PACKAGES="cmake imagemagick libcap-dev librsvg2-bin libz-dev libbz2-dev libtiff-tools"
|
||||||
export BITCOIN_CONFIG="--enable-gui --enable-reduce-exports"
|
export BITCOIN_CONFIG="--enable-gui --enable-reduce-exports --disable-miner"
|
||||||
export OSX_SDK=10.11
|
export OSX_SDK=10.11
|
||||||
export GOAL="deploy"
|
export GOAL="deploy"
|
||||||
fi
|
fi
|
||||||
|
12
configure.ac
12
configure.ac
@ -192,6 +192,17 @@ AC_ARG_ENABLE([debug],
|
|||||||
[enable_debug=$enableval],
|
[enable_debug=$enableval],
|
||||||
[enable_debug=no])
|
[enable_debug=no])
|
||||||
|
|
||||||
|
# Enable in-wallet miner
|
||||||
|
AC_ARG_ENABLE([miner],
|
||||||
|
[AS_HELP_STRING([--enable-miner],
|
||||||
|
[enable in-wallet miner (default is yes)])],
|
||||||
|
[enable_miner=$enableval],
|
||||||
|
[enable_miner=yes])
|
||||||
|
AM_CONDITIONAL([ENABLE_MINER], [test x$enable_miner = xyes])
|
||||||
|
if test "x$enable_miner" = xyes; then
|
||||||
|
AC_DEFINE(ENABLE_MINER, 1, [Define this symbol if in-wallet miner should be enabled])
|
||||||
|
fi
|
||||||
|
|
||||||
# Turn warnings into errors
|
# Turn warnings into errors
|
||||||
AC_ARG_ENABLE([werror],
|
AC_ARG_ENABLE([werror],
|
||||||
[AS_HELP_STRING([--enable-werror],
|
[AS_HELP_STRING([--enable-werror],
|
||||||
@ -1181,6 +1192,7 @@ echo " with test = $use_tests"
|
|||||||
echo " with bench = $use_bench"
|
echo " with bench = $use_bench"
|
||||||
echo " with upnp = $use_upnp"
|
echo " with upnp = $use_upnp"
|
||||||
echo " debug enabled = $enable_debug"
|
echo " debug enabled = $enable_debug"
|
||||||
|
echo " miner enabled = $enable_miner"
|
||||||
echo " werror = $enable_werror"
|
echo " werror = $enable_werror"
|
||||||
echo
|
echo
|
||||||
echo " target os = $TARGET_OS"
|
echo " target os = $TARGET_OS"
|
||||||
|
@ -37,7 +37,7 @@ files:
|
|||||||
script: |
|
script: |
|
||||||
WRAP_DIR=$HOME/wrapped
|
WRAP_DIR=$HOME/wrapped
|
||||||
HOSTS="x86_64-apple-darwin11"
|
HOSTS="x86_64-apple-darwin11"
|
||||||
CONFIGFLAGS="--enable-reduce-exports --disable-bench --disable-gui-tests GENISOIMAGE=$WRAP_DIR/genisoimage"
|
CONFIGFLAGS="--enable-reduce-exports --disable-miner --disable-bench --disable-gui-tests GENISOIMAGE=$WRAP_DIR/genisoimage"
|
||||||
FAKETIME_HOST_PROGS=""
|
FAKETIME_HOST_PROGS=""
|
||||||
FAKETIME_PROGS="ar ranlib date dmg genisoimage"
|
FAKETIME_PROGS="ar ranlib date dmg genisoimage"
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ files: []
|
|||||||
script: |
|
script: |
|
||||||
WRAP_DIR=$HOME/wrapped
|
WRAP_DIR=$HOME/wrapped
|
||||||
HOSTS="i686-w64-mingw32 x86_64-w64-mingw32"
|
HOSTS="i686-w64-mingw32 x86_64-w64-mingw32"
|
||||||
CONFIGFLAGS="--enable-reduce-exports --disable-bench --disable-gui-tests"
|
CONFIGFLAGS="--enable-reduce-exports --disable-miner --disable-bench --disable-gui-tests"
|
||||||
FAKETIME_HOST_PROGS="ar ranlib nm windres strip objcopy"
|
FAKETIME_HOST_PROGS="ar ranlib nm windres strip objcopy"
|
||||||
FAKETIME_PROGS="date makensis zip"
|
FAKETIME_PROGS="date makensis zip"
|
||||||
HOST_CFLAGS="-O2 -g"
|
HOST_CFLAGS="-O2 -g"
|
||||||
|
@ -30,10 +30,12 @@ public:
|
|||||||
static const CRPCConvertParam vRPCConvertParams[] =
|
static const CRPCConvertParam vRPCConvertParams[] =
|
||||||
{
|
{
|
||||||
{ "setmocktime", 0, "timestamp" },
|
{ "setmocktime", 0, "timestamp" },
|
||||||
|
#if ENABLE_MINER
|
||||||
{ "generate", 0, "nblocks" },
|
{ "generate", 0, "nblocks" },
|
||||||
{ "generate", 1, "maxtries" },
|
{ "generate", 1, "maxtries" },
|
||||||
{ "generatetoaddress", 0, "nblocks" },
|
{ "generatetoaddress", 0, "nblocks" },
|
||||||
{ "generatetoaddress", 2, "maxtries" },
|
{ "generatetoaddress", 2, "maxtries" },
|
||||||
|
#endif // ENABLE_MINER
|
||||||
{ "getnetworkhashps", 0, "nblocks" },
|
{ "getnetworkhashps", 0, "nblocks" },
|
||||||
{ "getnetworkhashps", 1, "height" },
|
{ "getnetworkhashps", 1, "height" },
|
||||||
{ "sendtoaddress", 1, "amount" },
|
{ "sendtoaddress", 1, "amount" },
|
||||||
|
@ -104,6 +104,7 @@ UniValue getnetworkhashps(const JSONRPCRequest& request)
|
|||||||
return GetNetworkHashPS(request.params.size() > 0 ? request.params[0].get_int() : 120, request.params.size() > 1 ? request.params[1].get_int() : -1);
|
return GetNetworkHashPS(request.params.size() > 0 ? request.params[0].get_int() : 120, request.params.size() > 1 ? request.params[1].get_int() : -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if ENABLE_MINER
|
||||||
UniValue generateBlocks(boost::shared_ptr<CReserveScript> coinbaseScript, int nGenerate, uint64_t nMaxTries, bool keepScript)
|
UniValue generateBlocks(boost::shared_ptr<CReserveScript> coinbaseScript, int nGenerate, uint64_t nMaxTries, bool keepScript)
|
||||||
{
|
{
|
||||||
static const int nInnerLoopCount = 0x10000;
|
static const int nInnerLoopCount = 0x10000;
|
||||||
@ -222,6 +223,7 @@ UniValue generatetoaddress(const JSONRPCRequest& request)
|
|||||||
|
|
||||||
return generateBlocks(coinbaseScript, nGenerate, nMaxTries, false);
|
return generateBlocks(coinbaseScript, nGenerate, nMaxTries, false);
|
||||||
}
|
}
|
||||||
|
#endif // ENABLE_MINER
|
||||||
|
|
||||||
UniValue getmininginfo(const JSONRPCRequest& request)
|
UniValue getmininginfo(const JSONRPCRequest& request)
|
||||||
{
|
{
|
||||||
@ -971,9 +973,10 @@ static const CRPCCommand commands[] =
|
|||||||
{ "mining", "getblocktemplate", &getblocktemplate, true, {"template_request"} },
|
{ "mining", "getblocktemplate", &getblocktemplate, true, {"template_request"} },
|
||||||
{ "mining", "submitblock", &submitblock, true, {"hexdata","parameters"} },
|
{ "mining", "submitblock", &submitblock, true, {"hexdata","parameters"} },
|
||||||
|
|
||||||
|
#if ENABLE_MINER
|
||||||
{ "generating", "generate", &generate, true, {"nblocks","maxtries"} },
|
{ "generating", "generate", &generate, true, {"nblocks","maxtries"} },
|
||||||
{ "generating", "generatetoaddress", &generatetoaddress, true, {"nblocks","address","maxtries"} },
|
{ "generating", "generatetoaddress", &generatetoaddress, true, {"nblocks","address","maxtries"} },
|
||||||
|
#endif // ENABLE_MINER
|
||||||
{ "util", "estimatefee", &estimatefee, true, {"nblocks"} },
|
{ "util", "estimatefee", &estimatefee, true, {"nblocks"} },
|
||||||
{ "util", "estimatepriority", &estimatepriority, true, {"nblocks"} },
|
{ "util", "estimatepriority", &estimatepriority, true, {"nblocks"} },
|
||||||
{ "util", "estimatesmartfee", &estimatesmartfee, true, {"nblocks"} },
|
{ "util", "estimatesmartfee", &estimatesmartfee, true, {"nblocks"} },
|
||||||
|
@ -320,6 +320,7 @@ BOOST_AUTO_TEST_CASE(rpc_ban)
|
|||||||
BOOST_CHECK_EQUAL(adr.get_str(), "2001:4d48:ac57:400:cacf:e9ff:fe1d:9c63/128");
|
BOOST_CHECK_EQUAL(adr.get_str(), "2001:4d48:ac57:400:cacf:e9ff:fe1d:9c63/128");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if ENABLE_MINER
|
||||||
BOOST_AUTO_TEST_CASE(rpc_convert_values_generatetoaddress)
|
BOOST_AUTO_TEST_CASE(rpc_convert_values_generatetoaddress)
|
||||||
{
|
{
|
||||||
UniValue result;
|
UniValue result;
|
||||||
@ -342,6 +343,7 @@ BOOST_AUTO_TEST_CASE(rpc_convert_values_generatetoaddress)
|
|||||||
BOOST_CHECK_EQUAL(result[1].get_str(), "yTG8jLL3MvteKXgbEcHyaN7JvTPCejQpSh");
|
BOOST_CHECK_EQUAL(result[1].get_str(), "yTG8jLL3MvteKXgbEcHyaN7JvTPCejQpSh");
|
||||||
BOOST_CHECK_EQUAL(result[2].get_int(), 9);
|
BOOST_CHECK_EQUAL(result[2].get_int(), 9);
|
||||||
}
|
}
|
||||||
|
#endif // ENABLE_MINER
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(rpc_sentinel_ping)
|
BOOST_AUTO_TEST_CASE(rpc_sentinel_ping)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user