This commit is contained in:
jl777
2019-01-19 20:18:36 -11:00
parent 66198b83f0
commit 0139e3eedf
2 changed files with 12 additions and 7 deletions

View File

@@ -947,12 +947,15 @@ void komodo_connectblock(CBlockIndex *pindex,CBlock& block)
} }
} }
} }
if ( ((signedmask & 1) != 0 && numvalid >= KOMODO_MINRATIFY) || bitweight(signedmask) > (numnotaries/3) ) if ( ASSETCHAINS_SYMBOL[0] != 0 || height < 100000 )
{ {
memset(&txhash,0,sizeof(txhash)); if ( ((signedmask & 1) != 0 && numvalid >= KOMODO_MINRATIFY) || bitweight(signedmask) > (numnotaries/3) )
komodo_stateupdate(height,pubkeys,numvalid,0,txhash,0,0,0,0,0,0,0,0,0,0,zero,0); {
printf("RATIFIED! >>>>>>>>>> new notaries.%d newheight.%d from height.%d\n",numvalid,(((height+KOMODO_ELECTION_GAP/2)/KOMODO_ELECTION_GAP)+1)*KOMODO_ELECTION_GAP,height); memset(&txhash,0,sizeof(txhash));
} else printf("signedmask.%llx numvalid.%d wt.%d numnotaries.%d\n",(long long)signedmask,numvalid,bitweight(signedmask),numnotaries); komodo_stateupdate(height,pubkeys,numvalid,0,txhash,0,0,0,0,0,0,0,0,0,0,zero,0);
printf("RATIFIED! >>>>>>>>>> new notaries.%d newheight.%d from height.%d\n",numvalid,(((height+KOMODO_ELECTION_GAP/2)/KOMODO_ELECTION_GAP)+1)*KOMODO_ELECTION_GAP,height);
} else printf("signedmask.%llx numvalid.%d wt.%d numnotaries.%d\n",(long long)signedmask,numvalid,bitweight(signedmask),numnotaries);
}
} }
} }
} }

View File

@@ -645,6 +645,7 @@ int32_t komodo_isPoS(CBlock *pblock)
vout = pblock->vtx[n-1].vin[0].prevout.n; vout = pblock->vtx[n-1].vin[0].prevout.n;
if ( ASSETCHAINS_MARMARA != 0 ) if ( ASSETCHAINS_MARMARA != 0 )
{ {
fprintf(stderr,"validate proper signature and unlockht preservation\n");
// need to verify it was signed by the non-Marmarapk of the 1of2 // need to verify it was signed by the non-Marmarapk of the 1of2
} }
txtime = komodo_txtime(&value,txid,vout,destaddr); txtime = komodo_txtime(&value,txid,vout,destaddr);
@@ -2116,7 +2117,7 @@ int32_t komodo_staked(CMutableTransaction &txNew,uint32_t nBits,uint32_t *blockt
maxkp = numkp = 0; maxkp = numkp = 0;
lasttime = 0; lasttime = 0;
} }
if ( ASSETCHAINS_MARMARA == 0 || 1 ) if ( ASSETCHAINS_MARMARA == 0 )
{ {
BOOST_FOREACH(const COutput& out, vecOutputs) BOOST_FOREACH(const COutput& out, vecOutputs)
{ {
@@ -2248,12 +2249,13 @@ int32_t komodo_staked(CMutableTransaction &txNew,uint32_t nBits,uint32_t *blockt
txNew.vout[0].nValue = *utxovaluep - txfee; txNew.vout[0].nValue = *utxovaluep - txfee;
txNew.nLockTime = earliest; txNew.nLockTime = earliest;
CTransaction txNewConst(txNew); CTransaction txNewConst(txNew);
if ( ASSETCHAINS_MARMARA == 0 || 1 ) if ( ASSETCHAINS_MARMARA == 0 )
{ {
signSuccess = ProduceSignature(TransactionSignatureCreator(&keystore, &txNewConst, 0, *utxovaluep, SIGHASH_ALL), best_scriptPubKey, sigdata, consensusBranchId); signSuccess = ProduceSignature(TransactionSignatureCreator(&keystore, &txNewConst, 0, *utxovaluep, SIGHASH_ALL), best_scriptPubKey, sigdata, consensusBranchId);
} }
else else
{ {
fprintf(stderr,"add opreturn and CCFinalizetx\n");
// add opreturn // add opreturn
// signSuccess = CCFinalizetx(...) // signSuccess = CCFinalizetx(...)
} }