This commit is contained in:
jl777
2016-11-07 14:21:35 -03:00
parent 581c5dedb3
commit f846a85733
3 changed files with 11 additions and 9 deletions

View File

@@ -43,7 +43,11 @@ uint64_t komodo_paxtotal()
while ( PAX != 0 && (pax= (struct pax_transaction *)PAX->hh.next) != 0 && pax != tmp )
{
if ( pax->marked == 0 )
total += pax->fiatoshis;
{
if ( ASSETCHAINS_SYMBOL[0] == 0 )
total += pax->fiatoshis;
else total += pax->komodoshis;
}
tmp = pax;
pax = (struct pax_transaction *)pax->hh.next;
}
@@ -471,8 +475,6 @@ void komodo_gateway_iteration(char *symbol)
printf("error from %s\n",symbol);
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)

View File

@@ -31,4 +31,4 @@ uint256 NOTARIZED_HASH,NOTARIZED_DESTTXID;
pthread_mutex_t komodo_mutex;
uint32_t KOMODO_INITDONE,KOMODO_REALTIME;
char KMDUSERPASS[1024]; uint16_t BITCOIND_PORT = 7771;
uint64_t KOMODO_DEPOSIT,PENDING_KOMODO_TX;
uint64_t PENDING_KOMODO_TX;

View File

@@ -102,29 +102,29 @@ void UpdateTime(CBlockHeader* pblock, const Consensus::Params& consensusParams,
int32_t komodo_pax_opreturn(uint8_t *opret,int32_t maxsize);
void komodo_gateway_deposits(CMutableTransaction *txNew,int32_t shortflag,char *symbol);
extern int32_t KOMODO_INITDONE,ASSETCHAINS_SHORTFLAG;
extern uint64_t KOMODO_DEPOSIT;
extern char ASSETCHAINS_SYMBOL[16];
CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn)
{
const CChainParams& chainparams = Params();
uint64_t deposits; const CChainParams& chainparams = Params();
// Create new block
unique_ptr<CBlockTemplate> pblocktemplate(new CBlockTemplate());
if(!pblocktemplate.get())
return NULL;
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 )
{
deposit = komodo_paxtotal();
fprintf(stderr,"CreateNewBlock initdone.%d deposit %.8f mempool.%d\n",KOMODO_INITDONE,(double)deposits/COIN,(int32_t)mempool.GetTotalTxSize());
sleep(10);
if ( KOMODO_INITDONE == 0 || time(NULL) < KOMODO_INITDONE+60 )
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;
}
}
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
// -blockversion=N to test forking scenarios