test
This commit is contained in:
@@ -153,7 +153,7 @@ void komodo_gateway_deposits(CMutableTransaction *txNew,int32_t shortflag,char *
|
|||||||
{
|
{
|
||||||
struct pax_transaction *pax,*tmp; uint8_t *script,opcode,opret[10000],data[10000]; int32_t i,len=0,opretlen=0,numvouts=1;
|
struct pax_transaction *pax,*tmp; uint8_t *script,opcode,opret[10000],data[10000]; int32_t i,len=0,opretlen=0,numvouts=1;
|
||||||
PENDING_KOMODO_TX = 0;
|
PENDING_KOMODO_TX = 0;
|
||||||
if ( strcmp(symbol,"KMD") != 0 )
|
if ( strcmp(symbol,"KMD") == 0 )
|
||||||
opcode = 'I';
|
opcode = 'I';
|
||||||
else opcode = 'X';
|
else opcode = 'X';
|
||||||
tmp = 0;
|
tmp = 0;
|
||||||
|
|||||||
@@ -113,11 +113,10 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn)
|
|||||||
if(!pblocktemplate.get())
|
if(!pblocktemplate.get())
|
||||||
return NULL;
|
return NULL;
|
||||||
CBlock *pblock = &pblocktemplate->block; // pointer for convenience
|
CBlock *pblock = &pblocktemplate->block; // pointer for convenience
|
||||||
|
fprintf(stderr,"start CreateNewBlock initdone.%d deposit %.8f mempool.%d\n",KOMODO_INITDONE,(double)komodo_paxtotal()/COIN,(int32_t)mempool.GetTotalTxSize());
|
||||||
while ( chainActive.Tip()->nHeight > ASSETCHAINS_MINHEIGHT && mempool.GetTotalTxSize() <= 0 )
|
while ( chainActive.Tip()->nHeight > ASSETCHAINS_MINHEIGHT && mempool.GetTotalTxSize() <= 0 )
|
||||||
{
|
{
|
||||||
deposits = komodo_paxtotal();
|
deposits = komodo_paxtotal();
|
||||||
if ( ASSETCHAINS_SYMBOL[0] != 0 )
|
|
||||||
fprintf(stderr,"CreateNewBlock initdone.%d deposit %.8f mempool.%d\n",KOMODO_INITDONE,(double)deposits/COIN,(int32_t)mempool.GetTotalTxSize());
|
|
||||||
sleep(10);
|
sleep(10);
|
||||||
if ( KOMODO_INITDONE == 0 || time(NULL) < KOMODO_INITDONE+60 )
|
if ( KOMODO_INITDONE == 0 || time(NULL) < KOMODO_INITDONE+60 )
|
||||||
continue;
|
continue;
|
||||||
@@ -127,7 +126,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( ASSETCHAINS_SYMBOL[0] != 0 )
|
if ( ASSETCHAINS_SYMBOL[0] != 0 )
|
||||||
printf("miner KOMODO_DEPOSIT %llu pblock->nHeight %d mempool.GetTotalTxSize(%d)\n",(long long)deposits,(int32_t)chainActive.Tip()->nHeight,(int32_t)mempool.GetTotalTxSize());
|
printf("miner KOMODO_DEPOSIT %llu pblock->nHeight %d mempool.GetTotalTxSize(%d)\n",(long long)komodo_paxtotal(),(int32_t)chainActive.Tip()->nHeight,(int32_t)mempool.GetTotalTxSize());
|
||||||
|
|
||||||
// -regtest only: allow overriding block.nVersion with
|
// -regtest only: allow overriding block.nVersion with
|
||||||
// -blockversion=N to test forking scenarios
|
// -blockversion=N to test forking scenarios
|
||||||
@@ -326,8 +325,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn)
|
|||||||
|
|
||||||
if (fPrintPriority)
|
if (fPrintPriority)
|
||||||
{
|
{
|
||||||
LogPrintf("priority %.1f fee %s txid %s\n",
|
LogPrintf("priority %.1f fee %s txid %s\n",dPriority, feeRate.ToString(), tx.GetHash().ToString());
|
||||||
dPriority, feeRate.ToString(), tx.GetHash().ToString());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add transactions that depend on this one to the priority queue
|
// Add transactions that depend on this one to the priority queue
|
||||||
@@ -381,7 +379,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
komodo_gateway_deposits(&txNew,0,(char *)"KMD");
|
komodo_gateway_deposits(&txNew,0,(char *)"KMD");
|
||||||
//fprintf(stderr,"txNew numvouts.%d\n",(int32_t)txNew.vout.size());
|
fprintf(stderr,"txNew numvouts.%d\n",(int32_t)txNew.vout.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
pblock->vtx[0] = txNew;
|
pblock->vtx[0] = txNew;
|
||||||
@@ -592,7 +590,7 @@ void static BitcoinMiner(CWallet *pwallet)
|
|||||||
{
|
{
|
||||||
hashTarget = arith_uint256().SetCompact(KOMODO_MINDIFF_NBITS);
|
hashTarget = arith_uint256().SetCompact(KOMODO_MINDIFF_NBITS);
|
||||||
Mining_start = (uint32_t)time(NULL);
|
Mining_start = (uint32_t)time(NULL);
|
||||||
//fprintf(stderr,"I am the chosen one for ht.%d\n",pindexPrev->nHeight+1);
|
fprintf(stderr,"I am the chosen one for %s ht.%d\n",ASSETCHAINS_SYMBOL,pindexPrev->nHeight+1);
|
||||||
} else Mining_start = 0;
|
} else Mining_start = 0;
|
||||||
Mining_height = pindexPrev->nHeight+1;
|
Mining_height = pindexPrev->nHeight+1;
|
||||||
//fprintf(stderr,"%s start mining loop\n",ASSETCHAINS_SYMBOL);
|
//fprintf(stderr,"%s start mining loop\n",ASSETCHAINS_SYMBOL);
|
||||||
|
|||||||
Reference in New Issue
Block a user