This commit is contained in:
blackjok3r
2018-10-16 16:06:49 +08:00
parent 3793c63860
commit b66f366d5c
3 changed files with 7 additions and 5 deletions

View File

@@ -1577,10 +1577,8 @@ int32_t komodo_checkPOW(int32_t slowflag,CBlock *pblock,int32_t height)
{ {
if ( height == 1 ) if ( height == 1 )
{ {
fprintf(stderr, "checking override pubkey thingo \n");
script = (uint8_t *)pblock->vtx[0].vout[0].scriptPubKey.data(); script = (uint8_t *)pblock->vtx[0].vout[0].scriptPubKey.data();
if ( script[0] != 33 || script[34] != OP_CHECKSIG || memcmp(script+1,ASSETCHAINS_OVERRIDE_PUBKEY33,33) != 0 ) { if ( script[0] != 33 || script[34] != OP_CHECKSIG || memcmp(script+1,ASSETCHAINS_OVERRIDE_PUBKEY33,33) != 0 ) {
fprintf(stderr, "failed the check\n");
return(-1); return(-1);
} }
} }

View File

@@ -1895,8 +1895,13 @@ CAmount GetBlockSubsidy(int nHeight, const Consensus::Params& consensusParams)
else if ( ASSETCHAINS_ENDSUBSIDY == 0 || nHeight < ASSETCHAINS_ENDSUBSIDY ) else if ( ASSETCHAINS_ENDSUBSIDY == 0 || nHeight < ASSETCHAINS_ENDSUBSIDY )
{ {
if ( ASSETCHAINS_REWARD == 0 ) if ( ASSETCHAINS_REWARD == 0 )
return(10000); {
else if ( ( ASSETCHAINS_ENDSUBSIDY != 0 && nHeight >= ASSETCHAINS_ENDSUBSIDY )|| ASSETCHAINS_STREAM != 0) if ( ASSETCHAINS_STREAM != 0 && nHeight > 128 )
return(0);
else
return(10000);
}
else if ( ASSETCHAINS_ENDSUBSIDY != 0 && nHeight >= ASSETCHAINS_ENDSUBSIDY )
return(0); return(0);
else else
{ {

View File

@@ -609,7 +609,6 @@ CBlockTemplate* CreateNewBlockWithKey(CReserveKey& reservekey,int32_t nHeight,in
if ( (nHeight == 1 || ASSETCHAINS_STREAM != 0 ) && ASSETCHAINS_OVERRIDE_PUBKEY33[0] != 0 ) if ( (nHeight == 1 || ASSETCHAINS_STREAM != 0 ) && ASSETCHAINS_OVERRIDE_PUBKEY33[0] != 0 )
{ {
scriptPubKey = CScript() << ParseHex(ASSETCHAINS_OVERRIDE_PUBKEY) << OP_CHECKSIG; scriptPubKey = CScript() << ParseHex(ASSETCHAINS_OVERRIDE_PUBKEY) << OP_CHECKSIG;
fprintf(stderr, "assechains stream should be mining to override pubkey\n");
} }
else if ( USE_EXTERNAL_PUBKEY != 0 ) else if ( USE_EXTERNAL_PUBKEY != 0 )
{ {