diff --git a/configure.ac b/configure.ac index 50545ede35c7..3b57ba101775 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ AC_PREREQ([2.69]) define(_CLIENT_VERSION_MAJOR, 3) define(_CLIENT_VERSION_MINOR, 3) -define(_CLIENT_VERSION_REVISION, 0) +define(_CLIENT_VERSION_REVISION, 1) define(_CLIENT_VERSION_BUILD, 0) define(_CLIENT_VERSION_RC, 0) define(_CLIENT_VERSION_IS_RELEASE, true) diff --git a/src/miner.cpp b/src/miner.cpp index ba85ed7a4430..b07e70a4ce64 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -218,7 +218,11 @@ std::unique_ptr BlockAssembler::CreateNewBlock(const CScript& sc // Fill in header pblock->hashPrevBlock = pindexPrev->GetBlockHash(); UpdateTime(pblock, chainparams.GetConsensus(), pindexPrev); - pblock->nBits = GetNextWorkRequired(pindexPrev, pblock, chainparams.GetConsensus()); + if (nHeight == 491409) { + pblock->nBits = chainparams.GetConsensus().nInitialPPDifficulty; + } else { + pblock->nBits = GetNextWorkRequired(pindexPrev, pblock, chainparams.GetConsensus()); + } pblock->nNonce = 0; pblock->nNonce64 = 0; pblock->nHeight = nHeight; diff --git a/src/primitives/block.cpp b/src/primitives/block.cpp index 6a2f8a3b13b5..2698a7d98559 100644 --- a/src/primitives/block.cpp +++ b/src/primitives/block.cpp @@ -22,17 +22,14 @@ uint256 CBlockHeader::GetHashFull(uint256& mix_hash) const { uint256 CBlockHeader::GetPoWHash(int nHeight) const { - uint256 powHash, mix_hash; + uint256 powHash; std::vector vch(80); CVectorWriter ss(SER_GETHASH, PROTOCOL_VERSION, vch, 0); ss << *this; if(nHeight == 0) { return HashX11((const char *)vch.data(), (const char *)vch.data() + vch.size()); } - if (IsFirstProgPow()) { - powHash = progpow_hash_full(GetProgPowHeader(), mix_hash); - return powHash; - } else if (IsProgPow()) { + if (IsProgPow()) { powHash = progpow_hash_light(GetProgPowHeader()); return powHash; } else { @@ -47,7 +44,7 @@ bool CBlockHeader::IsProgPow() const { } bool CBlockHeader::IsFirstProgPow() const { - return (IsProgPow() && nTime <= (Params().GetConsensus().nPPSwitchTime + 432000)); //1 hr 45 mins ish + return (IsProgPow() && nTime <= (Params().GetConsensus().nPPSwitchTime + 432000)); //5 days } CProgPowHeader CBlockHeader::GetProgPowHeader() const { @@ -79,13 +76,8 @@ uint256 CBlockHeader::GetProgPowHashLight() const { uint256 CBlockHeader::GetHash() const { uint256 powHash; if (IsProgPow()) { - if(IsFirstProgPow()) { - uint256 mix_hash = Params().GetConsensus().powLimit; - powHash = progpow_hash_full(GetProgPowHeader(), mix_hash); - } else { - powHash = progpow_hash_light(GetProgPowHeader()); - } - return powHash; + powHash = progpow_hash_light(GetProgPowHeader()); + return powHash; } else { std::vector vch(80); CVectorWriter ss(SER_GETHASH, PROTOCOL_VERSION, vch, 0); diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index 0db8a7566453..47e60aad5ece 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -2736,7 +2736,7 @@ static const CRPCCommand commands[] = { "blockchain", "getbestblockhash", &getbestblockhash, {} }, { "blockchain", "getbestchainlock", &getbestchainlock, {} }, { "blockchain", "getblockcount", &getblockcount, {} }, - { "blockchain", "getblock", &getblock, {"blockhash","verbosity|verbose"} }, + { "blockchain", "getblock", &getblock, {"blockhash","verbosity"} }, { "blockchain", "getblockhashes", &getblockhashes, {"high","low"} }, { "blockchain", "getblockhash", &getblockhash, {"height"} }, { "blockchain", "getblockheader", &getblockheader, {"blockhash","verbose"} }, diff --git a/src/rpc/client.cpp b/src/rpc/client.cpp index aea8dca61d99..11f4627d75a5 100644 --- a/src/rpc/client.cpp +++ b/src/rpc/client.cpp @@ -41,7 +41,8 @@ static const CRPCConvertParam vRPCConvertParams[] = { "sendtoaddress", 6, "use_cj" }, { "sendtoaddress", 7, "conf_target" }, { "settxfee", 0, "amount" }, - { "burn", 0 }, + { "burn", 0, "amount" }, + { "burn", 1, "data" }, { "getreceivedbyaddress", 1, "minconf" }, { "getreceivedbyaddress", 2, "addlocked" }, { "getreceivedbylabel", 1, "minconf" }, @@ -72,6 +73,7 @@ static const CRPCConvertParam vRPCConvertParams[] = { "walletpassphrase", 1, "timeout" }, { "walletpassphrase", 2, "mixingonly" }, { "getblocktemplate", 0, "template_request" }, + { "getblocktemplate", 1, "reward_address" }, { "listsinceblock", 1, "target_confirmations" }, { "listsinceblock", 2, "include_watchonly" }, { "listsinceblock", 3, "include_removed" }, diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index 243e9261db33..6a6cb3bff15b 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -352,7 +352,7 @@ static UniValue getblocktemplate(const JSONRPCRequest& request) }, }, "\"template_request\""}, - {"reward_address", RPCArg::Type::STR, "", "Address to place into Coinbase", + {"reward_address", RPCArg::Type::OBJ, "", "Address to place into Coinbase", { {"address", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "address for reward in coinbase (meaningful only if block solution is later submitted with pprpcsb)\n}"} }, @@ -422,7 +422,9 @@ static UniValue getblocktemplate(const JSONRPCRequest& request) }, RPCExamples{ HelpExampleCli("getblocktemplate", "") + + HelpExampleCli("getblocktemplate", "\"template\", \"sfWnK8nQQFodqEuqoVN2e9AK8GoAEU2nHN\"") + HelpExampleRpc("getblocktemplate", "") + + HelpExampleRpc("getblocktemplate", "\"template\", \"sfWnK8nQQFodqEuqoVN2e9AK8GoAEU2nHN\"") }, }.ToString()); @@ -1180,7 +1182,7 @@ static const CRPCCommand commands[] = { "mining", "getnetworkhashps", &getnetworkhashps, {"nblocks","height"} }, { "mining", "getmininginfo", &getmininginfo, {} }, { "mining", "prioritisetransaction", &prioritisetransaction, {"txid","fee_delta"} }, - { "mining", "getblocktemplate", &getblocktemplate, {"template_request"} }, + { "mining", "getblocktemplate", &getblocktemplate, {"template_request", "reward_address"} }, { "mining", "pprpcsb", &pprpcsb, {"header_hash","mix_hash", "nonce"} }, { "mining", "submitblock", &submitblock, {"hexdata","dummy"} }, { "mining", "submitheader", &submitheader, {"hexdata"} }, diff --git a/src/validation.cpp b/src/validation.cpp index 85bd5d528477..98da0b11a150 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -1942,11 +1942,6 @@ bool CChainState::ConnectBlock(const CBlock& block, CValidationState& state, CBl if (block.IsProgPow() && !fJustCheck) { if (block.nHeight >= progpow::epoch_length*2000) return state.DoS(50, false, REJECT_INVALID, "invalid-progpow-epoch", false, "invalid epoch number"); - - uint256 exp_mix_hash; - if (exp_mix_hash != block.mix_hash) { - return state.DoS(50, false, REJECT_INVALID, "invalid-mixhash", false, "mix_hash validity failed"); - } } // verify that the view's current state corresponds to the previous block @@ -3779,10 +3774,10 @@ static bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationSta // check for version 2, 3 and 4 upgrades if((block.nVersion < 2 && nHeight >= consensusParams.BIP34Height) || - (block.nVersion < 3 && nHeight >= consensusParams.BIP66Height) || - (block.nVersion < 4 && nHeight >= consensusParams.BIP65Height)) + (block.nVersion < 3 && nHeight >= consensusParams.BIP66Height) || + (block.nVersion < 4 && nHeight >= consensusParams.BIP65Height)) return state.Invalid(false, REJECT_OBSOLETE, strprintf("bad-version(0x%08x)", block.nVersion), - strprintf("rejected nVersion=0x%08x block", block.nVersion)); + strprintf("rejected nVersion=0x%08x block", block.nVersion)); return true; } diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 20ca9bafc584..06098aeb52f3 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -4284,10 +4284,10 @@ static const CRPCCommand commands[] = { "hidden", "generate", &generate, {"nblocks","maxtries"} }, // Hidden as it isn't functional, just an error to let people know if miner isn't compiled #endif //ENABLE_MINER { "hidden", "instantsendtoaddress", &instantsendtoaddress, {} }, + { "hidden", "burn", &burn, {"amount","text"} }, { "rawtransactions", "fundrawtransaction", &fundrawtransaction, {"hexstring","options"} }, { "wallet", "abandontransaction", &abandontransaction, {"txid"} }, { "wallet", "abortrescan", &abortrescan, {} }, - { "wallet", "burn", &burn, {"amount","text"} }, { "wallet", "addmultisigaddress", &addmultisigaddress, {"nrequired","keys","label"} }, { "wallet", "backupwallet", &backupwallet, {"destination"} }, { "wallet", "createwallet", &createwallet, {"wallet_name", "disable_private_keys", "blank", "passphrase"} },