Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
6 changes: 5 additions & 1 deletion src/miner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,11 @@ std::unique_ptr<CBlockTemplate> 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;
Expand Down
18 changes: 5 additions & 13 deletions src/primitives/block.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<unsigned char> 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 {
Expand All @@ -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 {
Expand Down Expand Up @@ -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<unsigned char> vch(80);
CVectorWriter ss(SER_GETHASH, PROTOCOL_VERSION, vch, 0);
Expand Down
2 changes: 1 addition & 1 deletion src/rpc/blockchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"} },
Expand Down
4 changes: 3 additions & 1 deletion src/rpc/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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" },
Expand Down Expand Up @@ -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" },
Expand Down
6 changes: 4 additions & 2 deletions src/rpc/mining.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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}"}
},
Expand Down Expand Up @@ -422,7 +422,9 @@ static UniValue getblocktemplate(const JSONRPCRequest& request)
},
RPCExamples{
HelpExampleCli("getblocktemplate", "")
+ HelpExampleCli("getblocktemplate", "\"template\", \"sfWnK8nQQFodqEuqoVN2e9AK8GoAEU2nHN\"")
+ HelpExampleRpc("getblocktemplate", "")
+ HelpExampleRpc("getblocktemplate", "\"template\", \"sfWnK8nQQFodqEuqoVN2e9AK8GoAEU2nHN\"")
},
}.ToString());

Expand Down Expand Up @@ -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"} },
Expand Down
11 changes: 3 additions & 8 deletions src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/wallet/rpcwallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"} },
Expand Down