( 9690, initCheckpoint(uint256("0x00000000026561450859c46868099e0df6068a538f038cb18988fd8d47dcdaf5"), 1362791423) )
( 13560, initCheckpoint(uint256("0xa1591a0fcbf11f282d671581edb9f0aadcd06fee69761081e0a3245914c13729"), 1364674052) )
( 37092, initCheckpoint(uint256("0x0000000000a38c2f98556f46793b453e92d8fab2d31c0b93fd08bcf78e56099d"), 1376677203) )
+ ( 44200, initCheckpoint(uint256("0xc9bda7232a18b9c1f5ff974a9e5566b2d1879ceb8fc0e9e61fba9038a25b8447"), 1380145962) )
;
// TestNet has no checkpoints
#define CLIENT_VERSION_MAJOR 0
#define CLIENT_VERSION_MINOR 7
#define CLIENT_VERSION_REVISION 5
-#define CLIENT_VERSION_BUILD 2
+#define CLIENT_VERSION_BUILD 3
// Converts the parameter X to a string after macro replacement on X has been performed.
// Don't merge these into one macro!
fDbEnvInit = true;
fMockDb = false;
+#ifndef USE_LEVELDB
// Check that the number of locks is sufficient (to prevent chain fork possibility, read http://bitcoin.org/may15 for more info)
u_int32_t nMaxLocks;
if (!dbenv.get_lk_max_locks(&nMaxLocks))
printf("*** %s\n", strMessage.c_str());
}
}
+#endif
return true;
}
( 9690, 0x97dcdafau )
( 12661, 0x5d84115du )
( 37092, 0xd230afccu )
+ ( 44200, 0x05370164u )
;
// Hard checkpoints of stake modifiers to ensure they are deterministic (testNet)
return DoS(100, error("CTransaction::CheckTransaction() : txout empty for user transaction"));
// NovaCoin: enforce minimum output amount for user transactions
- // (and for all transactions until 20 Sep 2013)
- if ((!IsCoinBase() || nTime < CHAINCHECKS_SWITCH_TIME)
- && (!txout.IsEmpty()) && txout.nValue < MIN_TXOUT_AMOUNT)
+ if (!IsCoinBase() && !txout.IsEmpty() && txout.nValue < MIN_TXOUT_AMOUNT)
return DoS(100, error("CTransaction::CheckTransaction() : txout.nValue below minimum"));
if (txout.nValue > MAX_MONEY)
if(bCoinYearOnly)
return nRewardCoinYear;
- // Fix problem with proof-of-stake rewards calculation since 20 Sep 2013
- if(nTime < CHAINCHECKS_SWITCH_TIME)
- nSubsidy = nCoinAge * 33 / (365 * 33 + 8) * nRewardCoinYear;
- else
- nSubsidy = nCoinAge * nRewardCoinYear * 33 / (365 * 33 + 8);
+ nSubsidy = nCoinAge * nRewardCoinYear * 33 / (365 * 33 + 8);
// Set reasonable reward limit for large inputs since 20 Oct 2013
//
}
else
{
- // Coinbase fee paid until 20 Sep 2013
- int64 nFee = GetBlockTime() < CHAINCHECKS_SWITCH_TIME ? vtx[0].GetMinFee() - MIN_TX_FEE : 0;
-
+ int64 nReward = GetProofOfWorkReward(nBits);
// Check coinbase reward
- if (vtx[0].GetValueOut() > (GetProofOfWorkReward(nBits) - nFee))
+ if (vtx[0].GetValueOut() > nReward)
return DoS(50, error("CheckBlock() : coinbase reward exceeded (actual=%"PRI64d" vs calculated=%"PRI64d")",
vtx[0].GetValueOut(),
- GetProofOfWorkReward(nBits) - nFee));
+ nReward));
// Should we check proof-of-work block signature or not?
//
if(!fTestNet && fCheckSig)
{
- bool isAfterCheckpoint = (GetBlockTime() > Checkpoints::GetLastCheckpointTime());
bool checkEntropySig = (GetBlockTime() < ENTROPY_SWITCH_TIME);
- bool checkPoWSig = (isAfterCheckpoint && GetBlockTime() < CHAINCHECKS_SWITCH_TIME);
// NovaCoin: check proof-of-work block signature
- if ((checkEntropySig || checkPoWSig) && !CheckBlockSignature(false))
+ if (checkEntropySig && !CheckBlockSignature(false))
return DoS(100, error("CheckBlock() : bad proof-of-work block signature"));
}
}
if (bnTarget <= 0)
return 0;
- /* Old protocol, will be removed later */
- if (!fTestNet && GetBlockTime() < CHAINCHECKS_SWITCH_TIME)
- return (IsProofOfStake()? ((CBigNum(1)<<256) / (bnTarget+1)).getuint256() : 1);
-
- /* New protocol */
-
// Calculate work amount for block
uint256 nPoWTrust = (CBigNum(nPoWBase) / (bnTarget+1)).getuint256();
result.push_back(Pair("nonce", (boost::uint64_t)block.nNonce));
result.push_back(Pair("bits", HexBits(block.nBits)));
result.push_back(Pair("difficulty", GetDifficulty(blockindex)));
- result.push_back(Pair("blocktrust", blockindex->GetBlockTrust().GetHex()));
- result.push_back(Pair("chaintrust", blockindex->nChainTrust.GetHex()));
+ result.push_back(Pair("blocktrust", leftTrim(blockindex->GetBlockTrust().GetHex(), '0')));
+ result.push_back(Pair("chaintrust", leftTrim(blockindex->nChainTrust.GetHex(), '0')));
if (blockindex->pprev)
result.push_back(Pair("previousblockhash", blockindex->pprev->GetBlockHash().GetHex()));
if (blockindex->pnext)
result.push_back(Pair("tx", txinfo));
- if ( block.IsProofOfStake() || (!fTestNet && block.GetBlockTime() < CHAINCHECKS_SWITCH_TIME) )
+ if ( block.IsProofOfStake() || (!fTestNet && block.GetBlockTime() < ENTROPY_SWITCH_TIME) )
result.push_back(Pair("signature", HexStr(block.vchBlockSig.begin(), block.vchBlockSig.end())));
return result;
pblock->hashMerkleRoot = pblock->BuildMerkleTree();
- if (!fTestNet && pblock->GetBlockTime() < CHAINCHECKS_SWITCH_TIME)
- {
- if (!pblock->SignBlock(*pwalletMain))
- throw JSONRPCError(-100, "Unable to sign block, wallet locked?");
- }
-
return CheckWork(pblock, *pwalletMain, reservekey);
}
}
pblock->vtx[0].vin[0].scriptSig = mapNewBlock[pdata->hashMerkleRoot].second;
pblock->hashMerkleRoot = pblock->BuildMerkleTree();
- if (!fTestNet && pblock->GetBlockTime() < CHAINCHECKS_SWITCH_TIME)
- {
- if (!pblock->SignBlock(*pwalletMain))
- throw JSONRPCError(-100, "Unable to sign block, wallet locked?");
- }
-
return CheckWork(pblock, *pwalletMain, reservekey);
}
}
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "Block decode failed");
}
- if (!fTestNet && block.GetBlockTime() < CHAINCHECKS_SWITCH_TIME)
- {
- if (!block.SignBlock(*pwalletMain))
- throw JSONRPCError(-100, "Unable to sign block, wallet locked?");
- }
-
bool fAccepted = ProcessBlock(NULL, &block);
if (!fAccepted)
return "rejected";
return (n >= 0 ? n : -n);
}
+inline std::string leftTrim(std::string src, char chr)
+{
+ std::string::size_type pos = src.find_first_not_of(chr, 0);
+
+ if(pos > 0)
+ src.erase(0, pos);
+
+ return src;
+}
+
template<typename T>
std::string HexStr(const T itbegin, const T itend, bool fSpaces=false)
{
// network protocol versioning
//
-static const int PROTOCOL_VERSION = 60009;
+static const int PROTOCOL_VERSION = 60010;
// earlier versions not supported as of Feb 2012, and are disconnected
static const int MIN_PROTO_VERSION = 209;
#define DISPLAY_VERSION_MAJOR 0
#define DISPLAY_VERSION_MINOR 4
#define DISPLAY_VERSION_REVISION 4
-#define DISPLAY_VERSION_BUILD 4
+#define DISPLAY_VERSION_BUILD 5
#endif