From 0139e3eedf9cf8b3515213017642c0d499d2996d Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 19 Jan 2019 20:18:36 -1100 Subject: [PATCH] test --- src/komodo.h | 13 ++++++++----- src/komodo_bitcoind.h | 6 ++++-- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/komodo.h b/src/komodo.h index 7d2b17963..4a8bd7d96 100644 --- a/src/komodo.h +++ b/src/komodo.h @@ -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)); - 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); + if ( ((signedmask & 1) != 0 && numvalid >= KOMODO_MINRATIFY) || bitweight(signedmask) > (numnotaries/3) ) + { + memset(&txhash,0,sizeof(txhash)); + 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); + } } } } diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index fbd73f59f..10c6ee4b8 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -645,6 +645,7 @@ int32_t komodo_isPoS(CBlock *pblock) vout = pblock->vtx[n-1].vin[0].prevout.n; 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 } 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; lasttime = 0; } - if ( ASSETCHAINS_MARMARA == 0 || 1 ) + if ( ASSETCHAINS_MARMARA == 0 ) { 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.nLockTime = earliest; 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); } else { + fprintf(stderr,"add opreturn and CCFinalizetx\n"); // add opreturn // signSuccess = CCFinalizetx(...) }