fix extremely rare bug!
This commit is contained in:
@@ -630,6 +630,9 @@ int32_t komodo_voutupdate(bool fJustCheck,int32_t *isratificationp,int32_t notar
|
|||||||
if ( matched != 0 )
|
if ( matched != 0 )
|
||||||
validated = komodo_validate_chain(srchash,*notarizedheightp);
|
validated = komodo_validate_chain(srchash,*notarizedheightp);
|
||||||
else validated = 1;
|
else validated = 1;
|
||||||
|
// Any notarization that is matched and has a decodable op_return is enough to pay notaries. Otherwise bugs!
|
||||||
|
if ( fJustCheck && matched != 0 )
|
||||||
|
return(-2);
|
||||||
if ( notarized != 0 && validated != 0 )
|
if ( notarized != 0 && validated != 0 )
|
||||||
{
|
{
|
||||||
//sp->NOTARIZED_HEIGHT = *notarizedheightp;
|
//sp->NOTARIZED_HEIGHT = *notarizedheightp;
|
||||||
@@ -697,10 +700,6 @@ int32_t komodo_voutupdate(bool fJustCheck,int32_t *isratificationp,int32_t notar
|
|||||||
else if ( ASSETCHAINS_SYMBOL[0] == 0 && matched != 0 && notarized != 0 && validated != 0 )
|
else if ( ASSETCHAINS_SYMBOL[0] == 0 && matched != 0 && notarized != 0 && validated != 0 )
|
||||||
komodo_rwccdata((char *)"KMD",1,&ccdata,0);
|
komodo_rwccdata((char *)"KMD",1,&ccdata,0);
|
||||||
|
|
||||||
// Because of reorgs its not possible to use notarizations that are in order. If its validated pay the notaries!
|
|
||||||
if ( fJustCheck )
|
|
||||||
return(-2);
|
|
||||||
|
|
||||||
if ( matched != 0 && *notarizedheightp > sp->NOTARIZED_HEIGHT && *notarizedheightp < height )
|
if ( matched != 0 && *notarizedheightp > sp->NOTARIZED_HEIGHT && *notarizedheightp < height )
|
||||||
{
|
{
|
||||||
sp->NOTARIZED_HEIGHT = *notarizedheightp;
|
sp->NOTARIZED_HEIGHT = *notarizedheightp;
|
||||||
|
|||||||
@@ -154,6 +154,7 @@ CScript Marmara_scriptPubKey(int32_t height,CPubKey pk);
|
|||||||
CScript MarmaraCoinbaseOpret(uint8_t funcid,int32_t height,CPubKey pk);
|
CScript MarmaraCoinbaseOpret(uint8_t funcid,int32_t height,CPubKey pk);
|
||||||
uint64_t komodo_notarypay(CMutableTransaction &txNew, std::vector<int8_t> &NotarisationNotaries, uint32_t timestamp, int32_t height, uint8_t *script, int32_t len);
|
uint64_t komodo_notarypay(CMutableTransaction &txNew, std::vector<int8_t> &NotarisationNotaries, uint32_t timestamp, int32_t height, uint8_t *script, int32_t len);
|
||||||
int32_t komodo_notaries(uint8_t pubkeys[64][33],int32_t height,uint32_t timestamp);
|
int32_t komodo_notaries(uint8_t pubkeys[64][33],int32_t height,uint32_t timestamp);
|
||||||
|
int32_t komodo_getnotarizedheight(uint32_t timestamp,int32_t height, uint8_t *script, int32_t len);
|
||||||
|
|
||||||
CBlockTemplate* CreateNewBlock(CPubKey _pk,const CScript& _scriptPubKeyIn, int32_t gpucount, bool isStake)
|
CBlockTemplate* CreateNewBlock(CPubKey _pk,const CScript& _scriptPubKeyIn, int32_t gpucount, bool isStake)
|
||||||
{
|
{
|
||||||
@@ -403,11 +404,15 @@ CBlockTemplate* CreateNewBlock(CPubKey _pk,const CScript& _scriptPubKeyIn, int32
|
|||||||
// Any attempted notarization needs to be in its own block!
|
// Any attempted notarization needs to be in its own block!
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// this is the first one we see, add it to the block as TX1
|
int32_t notarizedheight = komodo_getnotarizedheight(pblock->nTime, nHeight, script, scriptlen);
|
||||||
NotarisationNotaries = TMP_NotarisationNotaries;
|
if ( notarizedheight != 0 )
|
||||||
dPriority = 1e16;
|
{
|
||||||
fNotarisationBlock = true;
|
// this is the first one we see, add it to the block as TX1
|
||||||
fprintf(stderr, "Notarisation %s set to maximum priority\n",hash.ToString().c_str());
|
NotarisationNotaries = TMP_NotarisationNotaries;
|
||||||
|
dPriority = 1e16;
|
||||||
|
fNotarisationBlock = true;
|
||||||
|
fprintf(stderr, "Notarisation %s set to maximum priority\n",hash.ToString().c_str());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user