From e7433b08e5dfec2592ef2c5207918179c596d2ab Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 27 Jun 2018 08:43:08 -1100 Subject: [PATCH 1/2] Reject height 1 reorganization --- src/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 2d83ac89d..c22b93fae 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4060,7 +4060,9 @@ bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& sta // Don't accept any forks from the main chain prior to last checkpoint CBlockIndex* pcheckpoint = Checkpoints::GetLastCheckpoint(chainParams.Checkpoints()); int32_t notarized_height; - if ( nHeight > 1 ) + if ( nHeight == 1 && chainActive.Tip() != 0 && chainActive.Tip()->nHeight > 1 ) + return(false) + if ( nHeight != 0 ) { 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)); From 9710a28a54684545eb549f61688301caa4d0474a Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 27 Jun 2018 08:59:05 -1100 Subject: [PATCH 2/2] Use entire magic in height 1 reward --- src/main.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index c22b93fae..c67974971 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1753,7 +1753,11 @@ CAmount GetBlockSubsidy(int nHeight, const Consensus::Params& consensusParams) else { 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 ) { if ( ASSETCHAINS_REWARD == 0 )