@@ -129,14 +129,16 @@ public:
|
|||||||
uint256 blockHash = uint256();
|
uint256 blockHash = uint256();
|
||||||
uint32_t height = 0;
|
uint32_t height = 0;
|
||||||
uint256 txHash = uint256();
|
uint256 txHash = uint256();
|
||||||
char symbol[64] = "\0";
|
char symbol[64];
|
||||||
uint256 MoM = uint256();
|
uint256 MoM = uint256();
|
||||||
uint16_t MoMDepth = 0;
|
uint16_t MoMDepth = 0;
|
||||||
uint16_t ccId = 0;
|
uint16_t ccId = 0;
|
||||||
uint256 MoMoM = uint256();
|
uint256 MoMoM = uint256();
|
||||||
uint32_t MoMoMDepth = 0;
|
uint32_t MoMoMDepth = 0;
|
||||||
|
|
||||||
NotarisationData(int IsBack=2) : IsBackNotarisation(IsBack) {}
|
NotarisationData(int IsBack=2) : IsBackNotarisation(IsBack) {
|
||||||
|
symbol[0] = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
ADD_SERIALIZE_METHODS;
|
ADD_SERIALIZE_METHODS;
|
||||||
|
|
||||||
@@ -171,7 +173,8 @@ public:
|
|||||||
template <typename Stream>
|
template <typename Stream>
|
||||||
void SerSymbol(Stream& s, CSerActionUnserialize act)
|
void SerSymbol(Stream& s, CSerActionUnserialize act)
|
||||||
{
|
{
|
||||||
char *nullPos = (char*) memchr(&s[0], 0, s.size());
|
size_t readlen = std::min(sizeof(symbol), s.size());
|
||||||
|
char *nullPos = (char*) memchr(&s[0], 0, readlen);
|
||||||
if (!nullPos)
|
if (!nullPos)
|
||||||
throw std::ios_base::failure("couldn't parse symbol");
|
throw std::ios_base::failure("couldn't parse symbol");
|
||||||
s.read(symbol, nullPos-&s[0]+1);
|
s.read(symbol, nullPos-&s[0]+1);
|
||||||
|
|||||||
14
src/main.cpp
14
src/main.cpp
@@ -1753,7 +1753,11 @@ CAmount GetBlockSubsidy(int nHeight, const Consensus::Params& consensusParams)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ( nHeight == 1 )
|
if ( nHeight == 1 )
|
||||||
return(ASSETCHAINS_SUPPLY * COIN + (ASSETCHAINS_MAGIC & 0xffffff));
|
{
|
||||||
|
if ( ASSETCHAINS_STAKED == 0 || strcmp("VRSC",ASSETCHAINS_SYMBOL) == 0 )
|
||||||
|
return(ASSETCHAINS_SUPPLY * COIN + (ASSETCHAINS_MAGIC & 0xffffff));
|
||||||
|
else return(ASSETCHAINS_SUPPLY * COIN + ASSETCHAINS_MAGIC);
|
||||||
|
}
|
||||||
else if ( ASSETCHAINS_ENDSUBSIDY == 0 || nHeight < ASSETCHAINS_ENDSUBSIDY )
|
else if ( ASSETCHAINS_ENDSUBSIDY == 0 || nHeight < ASSETCHAINS_ENDSUBSIDY )
|
||||||
{
|
{
|
||||||
if ( ASSETCHAINS_REWARD == 0 )
|
if ( ASSETCHAINS_REWARD == 0 )
|
||||||
@@ -4060,11 +4064,13 @@ bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& sta
|
|||||||
// Don't accept any forks from the main chain prior to last checkpoint
|
// Don't accept any forks from the main chain prior to last checkpoint
|
||||||
CBlockIndex* pcheckpoint = Checkpoints::GetLastCheckpoint(chainParams.Checkpoints());
|
CBlockIndex* pcheckpoint = Checkpoints::GetLastCheckpoint(chainParams.Checkpoints());
|
||||||
int32_t notarized_height;
|
int32_t notarized_height;
|
||||||
if ( pcheckpoint && nHeight > 1 )
|
if ( nHeight == 1 && chainActive.Tip() != 0 && chainActive.Tip()->nHeight > 1 )
|
||||||
|
return(false);
|
||||||
|
if ( nHeight != 0 )
|
||||||
{
|
{
|
||||||
if (nHeight < pcheckpoint->nHeight )
|
if ( pcheckpoint != 0 && nHeight < pcheckpoint->nHeight )
|
||||||
return state.DoS(1, error("%s: forked chain older than last checkpoint (height %d) vs %d", __func__, nHeight,pcheckpoint->nHeight));
|
return state.DoS(1, error("%s: forked chain older than last checkpoint (height %d) vs %d", __func__, nHeight,pcheckpoint->nHeight));
|
||||||
else if ( komodo_checkpoint(¬arized_height,nHeight,hash) < 0 )
|
if ( komodo_checkpoint(¬arized_height,nHeight,hash) < 0 )
|
||||||
{
|
{
|
||||||
CBlockIndex *heightblock = chainActive[nHeight];
|
CBlockIndex *heightblock = chainActive[nHeight];
|
||||||
if ( heightblock != 0 && heightblock->GetBlockHash() == hash )
|
if ( heightblock != 0 && heightblock->GetBlockHash() == hash )
|
||||||
|
|||||||
Reference in New Issue
Block a user