Merge branch 'master' into master
This commit is contained in:
commit
1387d7d2c8
|
@ -245,7 +245,7 @@ endif
|
|||
dist_bin_SCRIPTS = scripts/fetch-zcash-params.sh
|
||||
dist_noinst_SCRIPTS = autogen.sh
|
||||
|
||||
EXTRA_DIST = $(DIST_SHARE) test/functional/test_runner.py test/functional test/zcash $(DIST_CONTRIB) $(DIST_DOCS) $(WINDOWS_PACKAGING) $(OSX_PACKAGING) $(BIN_CHECKS)
|
||||
EXTRA_DIST = $(DIST_SHARE) test/functional/test_runner.py test/functional $(DIST_CONTRIB) $(DIST_DOCS) $(WINDOWS_PACKAGING) $(OSX_PACKAGING) $(BIN_CHECKS)
|
||||
|
||||
EXTRA_DIST += \
|
||||
test/util/bitcoin-util-test.py \
|
||||
|
|
|
@ -15,6 +15,11 @@ Build Instructions
|
|||
-------
|
||||
|
||||
#### Linux (>= Ubuntu 16.04):
|
||||
|
||||
```
|
||||
sudo apt-get install build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils python3 libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-test-dev libboost-thread-dev
|
||||
```
|
||||
|
||||
```
|
||||
cd scripts
|
||||
./build.sh
|
||||
|
|
|
@ -19,13 +19,13 @@ gprefix READLINK readlink
|
|||
cd "$(dirname "$("$READLINK" -f "$0")")/.."
|
||||
|
||||
# Allow user overrides to $MAKE. Typical usage for users who need it:
|
||||
# MAKE=gmake ./zcutil/build.sh -j$(nproc)
|
||||
# MAKE=gmake ./scripts/build.sh -j$(nproc)
|
||||
if [[ -z "${MAKE-}" ]]; then
|
||||
MAKE=make
|
||||
fi
|
||||
|
||||
# Allow overrides to $BUILD and $HOST for porters. Most users will not need it.
|
||||
# BUILD=i686-pc-linux-gnu ./zcutil/build.sh
|
||||
# BUILD=i686-pc-linux-gnu ./scripts/build.sh
|
||||
if [[ -z "${BUILD-}" ]]; then
|
||||
BUILD="$(./depends/config.guess)"
|
||||
fi
|
||||
|
|
|
@ -19,13 +19,13 @@ gprefix READLINK readlink
|
|||
cd "$(dirname "$("$READLINK" -f "$0")")/.."
|
||||
|
||||
# Allow user overrides to $MAKE. Typical usage for users who need it:
|
||||
# MAKE=gmake ./zcutil/build.sh -j$(nproc)
|
||||
# MAKE=gmake ./scripts/build.sh -j$(nproc)
|
||||
if [[ -z "${MAKE-}" ]]; then
|
||||
MAKE=make
|
||||
fi
|
||||
|
||||
# Allow overrides to $BUILD and $HOST for porters. Most users will not need it.
|
||||
# BUILD=i686-pc-linux-gnu ./zcutil/build.sh
|
||||
# BUILD=i686-pc-linux-gnu ./scripts/build.sh
|
||||
if [[ -z "${BUILD-}" ]]; then
|
||||
BUILD="$(./depends/config.guess)"
|
||||
fi
|
||||
|
|
|
@ -334,18 +334,6 @@ if USE_ASM
|
|||
crypto_libbitcoin_crypto_a_SOURCES += crypto/sha256_sse4.cpp
|
||||
endif
|
||||
|
||||
if ENABLE_MINING
|
||||
EQUIHASH_TROMP_SOURCES = \
|
||||
pow/tromp/equi_miner.h \
|
||||
pow/tromp/equi.h \
|
||||
pow/tromp/osx_barrier.h
|
||||
|
||||
crypto_libbitcoin_crypto_a_CPPFLAGS += \
|
||||
-DEQUIHASH_TROMP_ATOMIC
|
||||
crypto_libbitcoin_crypto_a_SOURCES += \
|
||||
${EQUIHASH_TROMP_SOURCES}
|
||||
endif
|
||||
|
||||
# consensus: shared between all executables that validate any consensus rules.
|
||||
libbitcoin_consensus_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
|
||||
libbitcoin_consensus_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
|
||||
|
|
|
@ -104,6 +104,11 @@ static bool AppInit(int argc, char* argv[])
|
|||
}
|
||||
// Check for -testnet or -regtest parameter (Params() calls are only valid after this clause)
|
||||
try {
|
||||
std::string strChainName = gArgs.GetChainName();
|
||||
if (strChainName == CBaseChainParams::MAIN) {
|
||||
fprintf(stderr, "Please use -testnet or -regtest for now; mainnet is not yet ready.\n");
|
||||
return false;
|
||||
}
|
||||
SelectParams(gArgs.GetChainName());
|
||||
} catch (const std::exception& e) {
|
||||
fprintf(stderr, "Error: %s\n", e.what());
|
||||
|
|
|
@ -213,7 +213,7 @@ public:
|
|||
consensus.nSubsidyHalvingInterval = 840000;
|
||||
|
||||
// P2SH, height in coinbase, CLTV and DERSIG all enforced from genesis
|
||||
consensus.BIP34Height = 0;
|
||||
consensus.BIP34Height = 17;
|
||||
consensus.BIP65Height = 0;
|
||||
consensus.BIP66Height = 0;
|
||||
|
||||
|
@ -260,10 +260,12 @@ public:
|
|||
assert(genesis.hashMerkleRoot == uint256S("0x19612bcf00ea7611d315d7f43554fa983c6e8c30cba17e52c679e0e80abf7d42"));
|
||||
assert(consensus.hashGenesisBlock == uint256S("0x03e1c4bb705c871bf9bfda3e74b7f8f86bff267993c215a89d5795e3708e5e1f"));
|
||||
|
||||
|
||||
vSeeds.emplace_back("rebase-testnet1.btcprivate.co");
|
||||
vSeeds.emplace_back("rebase-testnet2.btcprivate.co");
|
||||
vSeeds.emplace_back("rebase-testnet3.btcprivate.co");
|
||||
|
||||
|
||||
// guarantees the first 2 characters, when base58 encoded, are "n1"
|
||||
base58Prefixes[PUBKEY_ADDRESS] = {0x19,0x57};
|
||||
// guarantees the first 2 characters, when base58 encoded, are "nx"
|
||||
|
@ -319,7 +321,7 @@ public:
|
|||
consensus.nSubsidyHalvingInterval = 840000;
|
||||
|
||||
// P2SH, height in coinbase, CLTV and DERSIG all enforced from genesis
|
||||
consensus.BIP34Height = 0;
|
||||
consensus.BIP34Height = 17;
|
||||
consensus.BIP65Height = 0;
|
||||
consensus.BIP66Height = 0;
|
||||
|
||||
|
|
|
@ -125,6 +125,7 @@ static const CRPCConvertParam vRPCConvertParams[] =
|
|||
{ "verifychain", 1, "nblocks" },
|
||||
{ "getblockstats", 0, "hash_or_height" },
|
||||
{ "getblockstats", 1, "stats" },
|
||||
{ "getblocksubsidy", 0, "height" },
|
||||
{ "pruneblockchain", 0, "height" },
|
||||
{ "keypoolrefill", 0, "newsize" },
|
||||
{ "getrawmempool", 0, "verbose" },
|
||||
|
|
|
@ -973,6 +973,46 @@ static UniValue estimaterawfee(const JSONRPCRequest& request)
|
|||
return result;
|
||||
}
|
||||
|
||||
UniValue getblocksubsidy(const JSONRPCRequest& request)
|
||||
{
|
||||
if (request.params.size() > 1)
|
||||
throw std::runtime_error(
|
||||
"getblocksubsidy height\n"
|
||||
"\nReturns block subsidy reward, taking into account the mining slow start and the founders reward, of block at index provided.\n"
|
||||
"\nArguments:\n"
|
||||
"1. height (numeric, optional) The block height. If not provided, defaults to the current height of the chain.\n"
|
||||
"\nResult:\n"
|
||||
"{\n"
|
||||
" \"miner\" : x.xxx (numeric) The mining reward amount in " + CURRENCY_UNIT + ".\n"
|
||||
" \"founders\" : x.xxx (numeric) The founders reward amount in " + CURRENCY_UNIT + ".\n"
|
||||
"}\n"
|
||||
"\nExamples:\n"
|
||||
+ HelpExampleCli("getblocksubsidy", "1000")
|
||||
+ HelpExampleRpc("getblocksubsidy", "1000")
|
||||
);
|
||||
|
||||
LOCK(cs_main);
|
||||
|
||||
int nHeight = (request.params.size() == 1) ? request.params[0].get_int() : chainActive.Height();
|
||||
if (nHeight < 0)
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Block height out of range");
|
||||
|
||||
CAmount nReward = GetBlockSubsidy(nHeight, Params().GetConsensus());
|
||||
CAmount nFoundersReward = 0;
|
||||
/*
|
||||
int nLastFoundersRewardBlockHeight = 0;
|
||||
if ((nHeight > 0) && (nHeight <= nLastFoundersRewardBlockHeight)) {
|
||||
nFoundersReward = nReward/5;
|
||||
nReward -= nFoundersReward;
|
||||
}
|
||||
*/
|
||||
UniValue result(UniValue::VOBJ);
|
||||
result.pushKV("miner", ValueFromAmount(nReward));
|
||||
result.pushKV("founders", ValueFromAmount(nFoundersReward));
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
static const CRPCCommand commands[] =
|
||||
{ // category name actor (function) argNames
|
||||
// --------------------- ------------------------ ----------------------- ----------
|
||||
|
@ -982,6 +1022,7 @@ static const CRPCCommand commands[] =
|
|||
{ "mining", "getblocktemplate", &getblocktemplate, {"template_request"} },
|
||||
{ "mining", "submitblock", &submitblock, {"hexdata","dummy"} },
|
||||
|
||||
{ "mining", "getblocksubsidy", &getblocksubsidy, {"height"} },
|
||||
|
||||
{ "generating", "generatetoaddress", &generatetoaddress, {"nblocks","address","maxtries"} },
|
||||
|
||||
|
|
Loading…
Reference in New Issue