@@ -244,7 +244,9 @@ bool RewardsValidate(struct CCcontract_info *cp,Eval* eval,const CTransaction &t
|
||||
//vout.0: funding CC change or recover normal payout
|
||||
//vout.1: normal output to unlock address
|
||||
//vout.n-1: opreturn 'U' sbits fundingtxid
|
||||
if ( eval->GetTxUnconfirmed(tx.vin[0].prevout.hash,vinTx,hashBlock) == 0 )
|
||||
if ( fundingtxid == txid )
|
||||
return eval->Invalid("cant unlock fundingtxid");
|
||||
else if ( eval->GetTxUnconfirmed(tx.vin[0].prevout.hash,vinTx,hashBlock) == 0 )
|
||||
return eval->Invalid("always should find vin.0, but didnt");
|
||||
for (i=0; i<numvins; i++)
|
||||
{
|
||||
@@ -609,6 +611,12 @@ std::string RewardsUnlock(uint64_t txfee,char *planstr,uint256 fundingtxid,uint2
|
||||
rewardspk = GetUnspendable(cp,0);
|
||||
mypk = pubkey2pk(Mypubkey());
|
||||
sbits = stringbits(planstr);
|
||||
if ( locktxid == fundingtxid )
|
||||
{
|
||||
fprintf(stderr,"Rewards plan cant unlock fundingtxid\n");
|
||||
CCerror = "Rewards plan cant unlock fundingtxid";
|
||||
return("");
|
||||
}
|
||||
if ( RewardsPlanExists(cp,sbits,rewardspk,APR,minseconds,maxseconds,mindeposit) == 0 )
|
||||
{
|
||||
fprintf(stderr,"Rewards plan %s doesnt exist\n",planstr);
|
||||
|
||||
@@ -311,7 +311,7 @@ int32_t komodo_parsestatefiledata(struct komodo_state *sp,uint8_t *filedata,long
|
||||
{
|
||||
if ( memread(opret,olen,filedata,&fpos,datalen) != olen )
|
||||
errs++;
|
||||
if ( 1 && ASSETCHAINS_SYMBOL[0] != 0 && matched != 0 )
|
||||
if ( 0 && ASSETCHAINS_SYMBOL[0] != 0 && matched != 0 )
|
||||
{
|
||||
int32_t i; for (i=0; i<olen; i++)
|
||||
printf("%02x",opret[i]);
|
||||
@@ -600,7 +600,7 @@ int32_t komodo_voutupdate(int32_t *isratificationp,int32_t notaryid,uint8_t *scr
|
||||
{
|
||||
if ( scriptbuf[len] == 'K' )
|
||||
{
|
||||
fprintf(stderr,"i.%d j.%d KV OPRET len.%d %.8f\n",i,j,opretlen,dstr(value));
|
||||
//fprintf(stderr,"i.%d j.%d KV OPRET len.%d %.8f\n",i,j,opretlen,dstr(value));
|
||||
komodo_stateupdate(height,0,0,0,txhash,0,0,0,0,0,0,value,&scriptbuf[len],opretlen,j,zero,0);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ int32_t komodo_kvsearch(uint256 *pubkeyp,int32_t current_height,uint32_t *flagsp
|
||||
if ( ptr != 0 )
|
||||
{
|
||||
duration = komodo_kvduration(ptr->flags);
|
||||
fprintf(stderr,"duration.%d flags.%d current.%d ht.%d keylen.%d valuesize.%d\n",duration,ptr->flags,current_height,ptr->height,ptr->keylen,ptr->valuesize);
|
||||
//fprintf(stderr,"duration.%d flags.%d current.%d ht.%d keylen.%d valuesize.%d\n",duration,ptr->flags,current_height,ptr->height,ptr->keylen,ptr->valuesize);
|
||||
if ( current_height > (ptr->height + duration) )
|
||||
{
|
||||
HASH_DELETE(hh,KOMODO_KV,ptr);
|
||||
@@ -117,7 +117,7 @@ void komodo_kvupdate(uint8_t *opretbuf,int32_t opretlen,uint64_t value)
|
||||
}
|
||||
valueptr = &key[keylen];
|
||||
fee = komodo_kvfee(flags,opretlen,keylen);
|
||||
printf("fee %.8f vs %.8f flags.%d keylen.%d valuesize.%d height.%d (%02x %02x %02x) (%02x %02x %02x)\n",(double)fee/COIN,(double)value/COIN,flags,keylen,valuesize,height,key[0],key[1],key[2],valueptr[0],valueptr[1],valueptr[2]);
|
||||
//printf("fee %.8f vs %.8f flags.%d keylen.%d valuesize.%d height.%d (%02x %02x %02x) (%02x %02x %02x)\n",(double)fee/COIN,(double)value/COIN,flags,keylen,valuesize,height,key[0],key[1],key[2],valueptr[0],valueptr[1],valueptr[2]);
|
||||
if ( value >= fee )
|
||||
{
|
||||
coresize = (int32_t)(sizeof(flags)+sizeof(height)+sizeof(keylen)+sizeof(valuesize)+keylen+valuesize+1);
|
||||
@@ -142,7 +142,7 @@ void komodo_kvupdate(uint8_t *opretbuf,int32_t opretlen,uint64_t value)
|
||||
{
|
||||
if ( komodo_kvsigverify(keyvalue,keylen+refvaluesize,refpubkey,sig) < 0 )
|
||||
{
|
||||
fprintf(stderr,"komodo_kvsigverify error [%d]\n",coresize-13);
|
||||
//fprintf(stderr,"komodo_kvsigverify error [%d]\n",coresize-13);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -151,7 +151,7 @@ void komodo_kvupdate(uint8_t *opretbuf,int32_t opretlen,uint64_t value)
|
||||
HASH_FIND(hh,KOMODO_KV,key,keylen,ptr);
|
||||
if ( ptr != 0 )
|
||||
{
|
||||
fprintf(stderr,"(%s) already there\n",(char *)key);
|
||||
//fprintf(stderr,"(%s) already there\n",(char *)key);
|
||||
//if ( (ptr->flags & KOMODO_KVPROTECTED) != 0 )
|
||||
{
|
||||
tstr = (char *)"transfer:";
|
||||
|
||||
@@ -736,7 +736,7 @@ bool IsStandardTx(const CTransaction& tx, string& reason, const int nHeight)
|
||||
if (!::IsStandard(txout.scriptPubKey, whichType))
|
||||
{
|
||||
reason = "scriptpubkey";
|
||||
fprintf(stderr,">>>>>>>>>>>>>>> vout.%d nDataout.%d\n",v,nDataOut);
|
||||
//fprintf(stderr,">>>>>>>>>>>>>>> vout.%d nDataout.%d\n",v,nDataOut);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1306,7 +1306,7 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa
|
||||
string reason;
|
||||
if (Params().RequireStandard() && !IsStandardTx(tx, reason, nextBlockHeight))
|
||||
{
|
||||
fprintf(stderr,"AcceptToMemoryPool reject nonstandard transaction: %s\n",reason.c_str());
|
||||
//fprintf(stderr,"AcceptToMemoryPool reject nonstandard transaction: %s\n",reason.c_str());
|
||||
return state.DoS(0,error("AcceptToMemoryPool: nonstandard transaction: %s", reason),REJECT_NONSTANDARD, reason);
|
||||
}
|
||||
// Only accept nLockTime-using transactions that can be mined in the next
|
||||
@@ -4187,11 +4187,11 @@ bool CheckBlock(int32_t *futureblockp,int32_t height,CBlockIndex *pindex,const C
|
||||
}
|
||||
if ( rejects == 0 || rejects == lastrejects )
|
||||
{
|
||||
if ( lastrejects != 0 )
|
||||
if ( 0 && lastrejects != 0 )
|
||||
fprintf(stderr,"lastrejects.%d -> all tx in mempool\n",lastrejects);
|
||||
break;
|
||||
}
|
||||
fprintf(stderr,"addtomempool ht.%d for CC checking: n.%d rejects.%d last.%d\n",height,(int32_t)block.vtx.size(),rejects,lastrejects);
|
||||
//fprintf(stderr,"addtomempool ht.%d for CC checking: n.%d rejects.%d last.%d\n",height,(int32_t)block.vtx.size(),rejects,lastrejects);
|
||||
lastrejects = rejects;
|
||||
rejects = 0;
|
||||
}
|
||||
|
||||
@@ -167,7 +167,7 @@ bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, vector<vector<unsi
|
||||
// small pushdata, <= nMaxDatacarrierBytes
|
||||
if (vch1.size() > nMaxDatacarrierBytes)
|
||||
{
|
||||
fprintf(stderr,"size.%d > nMaxDatacarrier.%d\n",(int32_t)vch1.size(),(int32_t)nMaxDatacarrierBytes);
|
||||
//fprintf(stderr,"size.%d > nMaxDatacarrier.%d\n",(int32_t)vch1.size(),(int32_t)nMaxDatacarrierBytes);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user