test
This commit is contained in:
@@ -43,7 +43,11 @@ uint64_t komodo_paxtotal()
|
|||||||
while ( PAX != 0 && (pax= (struct pax_transaction *)PAX->hh.next) != 0 && pax != tmp )
|
while ( PAX != 0 && (pax= (struct pax_transaction *)PAX->hh.next) != 0 && pax != tmp )
|
||||||
{
|
{
|
||||||
if ( pax->marked == 0 )
|
if ( pax->marked == 0 )
|
||||||
total += pax->fiatoshis;
|
{
|
||||||
|
if ( ASSETCHAINS_SYMBOL[0] == 0 )
|
||||||
|
total += pax->fiatoshis;
|
||||||
|
else total += pax->komodoshis;
|
||||||
|
}
|
||||||
tmp = pax;
|
tmp = pax;
|
||||||
pax = (struct pax_transaction *)pax->hh.next;
|
pax = (struct pax_transaction *)pax->hh.next;
|
||||||
}
|
}
|
||||||
@@ -471,8 +475,6 @@ void komodo_gateway_iteration(char *symbol)
|
|||||||
printf("error from %s\n",symbol);
|
printf("error from %s\n",symbol);
|
||||||
sleep(30);
|
sleep(30);
|
||||||
}
|
}
|
||||||
if ( (KOMODO_DEPOSIT= komodo_paxtotal()) != 0 )
|
|
||||||
printf("KOMODO_DEPOSIT %.8f RT.%u\n",dstr(KOMODO_DEPOSIT),KOMODO_REALTIME);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void komodo_iteration(char *symbol)
|
void komodo_iteration(char *symbol)
|
||||||
|
|||||||
@@ -31,4 +31,4 @@ uint256 NOTARIZED_HASH,NOTARIZED_DESTTXID;
|
|||||||
pthread_mutex_t komodo_mutex;
|
pthread_mutex_t komodo_mutex;
|
||||||
uint32_t KOMODO_INITDONE,KOMODO_REALTIME;
|
uint32_t KOMODO_INITDONE,KOMODO_REALTIME;
|
||||||
char KMDUSERPASS[1024]; uint16_t BITCOIND_PORT = 7771;
|
char KMDUSERPASS[1024]; uint16_t BITCOIND_PORT = 7771;
|
||||||
uint64_t KOMODO_DEPOSIT,PENDING_KOMODO_TX;
|
uint64_t PENDING_KOMODO_TX;
|
||||||
|
|||||||
@@ -102,29 +102,29 @@ void UpdateTime(CBlockHeader* pblock, const Consensus::Params& consensusParams,
|
|||||||
int32_t komodo_pax_opreturn(uint8_t *opret,int32_t maxsize);
|
int32_t komodo_pax_opreturn(uint8_t *opret,int32_t maxsize);
|
||||||
void komodo_gateway_deposits(CMutableTransaction *txNew,int32_t shortflag,char *symbol);
|
void komodo_gateway_deposits(CMutableTransaction *txNew,int32_t shortflag,char *symbol);
|
||||||
extern int32_t KOMODO_INITDONE,ASSETCHAINS_SHORTFLAG;
|
extern int32_t KOMODO_INITDONE,ASSETCHAINS_SHORTFLAG;
|
||||||
extern uint64_t KOMODO_DEPOSIT;
|
|
||||||
extern char ASSETCHAINS_SYMBOL[16];
|
extern char ASSETCHAINS_SYMBOL[16];
|
||||||
|
|
||||||
CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn)
|
CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn)
|
||||||
{
|
{
|
||||||
const CChainParams& chainparams = Params();
|
uint64_t deposits; const CChainParams& chainparams = Params();
|
||||||
// Create new block
|
// Create new block
|
||||||
unique_ptr<CBlockTemplate> pblocktemplate(new CBlockTemplate());
|
unique_ptr<CBlockTemplate> pblocktemplate(new CBlockTemplate());
|
||||||
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,"CreateNewBlock initdone.%d deposit %.8f\n",KOMODO_INITDONE,(double)KOMODO_DEPOSIT/COIN);
|
|
||||||
while ( chainActive.Tip()->nHeight > ASSETCHAINS_MINHEIGHT && mempool.GetTotalTxSize() <= 0 )
|
while ( chainActive.Tip()->nHeight > ASSETCHAINS_MINHEIGHT && mempool.GetTotalTxSize() <= 0 )
|
||||||
{
|
{
|
||||||
|
deposit = komodo_paxtotal();
|
||||||
|
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;
|
||||||
if ( KOMODO_DEPOSIT != 0 )
|
if ( deposit != 0 )
|
||||||
{
|
{
|
||||||
printf("miner KOMODO_DEPOSIT %llu pblock->nHeight %d mempool.GetTotalTxSize(%d)\n",(long long)KOMODO_DEPOSIT,(int32_t)chainActive.Tip()->nHeight,(int32_t)mempool.GetTotalTxSize());
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
printf("miner KOMODO_DEPOSIT %llu pblock->nHeight %d mempool.GetTotalTxSize(%d)\n",(long long)deposit,(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
|
||||||
|
|||||||
Reference in New Issue
Block a user