Browse Source

test

pull/4/head
jl777 8 years ago
parent
commit
1938746c00
  1. 10
      src/komodo.h
  2. 18
      src/komodo_gateway.h

10
src/komodo.h

@ -191,7 +191,7 @@ void komodo_stateupdate(int32_t height,uint8_t notarypubs[][33],uint8_t numnotar
errs++;
if ( fwrite(opretbuf,1,olen,fp) != olen )
errs++;
printf("ht.%d R opret[%d]\n",height,olen);
//printf("ht.%d R opret[%d]\n",height,olen);
komodo_opreturn(height,opretvalue,opretbuf,olen,txhash,vout);
}
else if ( notarypubs != 0 && numnotaries > 0 )
@ -322,9 +322,9 @@ int32_t komodo_voutupdate(int32_t notaryid,uint8_t *scriptbuf,int32_t scriptlen,
komodo_paxpricefeed(height,&scriptbuf[len],opretlen);
else
{
int32_t k; for (k=0; k<scriptlen; k++)
printf("%02x",scriptbuf[k]);
printf(" <- script ht.%d i.%d j.%d value %.8f\n",height,i,j,dstr(value));
//int32_t k; for (k=0; k<scriptlen; k++)
// printf("%02x",scriptbuf[k]);
//printf(" <- script ht.%d i.%d j.%d value %.8f\n",height,i,j,dstr(value));
komodo_stateupdate(height,0,0,0,txhash,0,0,0,0,0,value,&scriptbuf[len],opretlen,j);
}
}
@ -371,7 +371,7 @@ void komodo_connectblock(CBlockIndex *pindex,CBlock& block)
{
height = pindex->nHeight;
txn_count = block.vtx.size();
if ( ASSETCHAINS_SYMBOL[0] != 0 )
if ( 0 && ASSETCHAINS_SYMBOL[0] != 0 )
printf("%s ht.%d connect txn_count.%d\n",ASSETCHAINS_SYMBOL,height,txn_count);
for (i=0; i<txn_count; i++)
{

18
src/komodo_gateway.h

@ -149,11 +149,11 @@ int32_t komodo_issued_opreturn(uint8_t *shortflagp,char *base,uint256 *txids,uin
for (j=0; j<32; j++)
{
((uint8_t *)&txids[n])[j] = opretbuf[len++];
printf("%02x",((uint8_t *)&txids[n])[j]);
//printf("%02x",((uint8_t *)&txids[n])[j]);
}
vouts[n] = opretbuf[len++];
vouts[n] = (opretbuf[len++] << 8) | vouts[n];
printf(" issuedtxid v%d i.%d opretlen.%d\n",vouts[n],n,opretlen);
//printf(" issuedtxid v%d i.%d opretlen.%d\n",vouts[n],n,opretlen);
}
}
return(n);
@ -184,7 +184,7 @@ void komodo_gateway_deposits(CMutableTransaction *txNew,int32_t shortflag,char *
*script++ = 0xac;
for (i=0; i<32; i++)
{
printf("%02x",((uint8_t *)&pax->txid)[i]);
//printf("%02x",((uint8_t *)&pax->txid)[i]);
data[len++] = ((uint8_t *)&pax->txid)[i];
}
data[len++] = pax->vout & 0xff;
@ -192,7 +192,7 @@ void komodo_gateway_deposits(CMutableTransaction *txNew,int32_t shortflag,char *
if ( strcmp(symbol,"KMD") != 0 )
PENDING_KOMODO_TX += pax->fiatoshis;
else PENDING_KOMODO_TX += pax->komodoshis;
printf(" vout.%u DEPOSIT %.8f <- paxdeposit.%s pending %.8f\n",pax->vout,(double)txNew->vout[numvouts].nValue/COIN,symbol,dstr(PENDING_KOMODO_TX));
//printf(" vout.%u DEPOSIT %.8f <- paxdeposit.%s pending %.8f\n",pax->vout,(double)txNew->vout[numvouts].nValue/COIN,symbol,dstr(PENDING_KOMODO_TX));
if ( numvouts++ >= 64 )
break;
}
@ -245,7 +245,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above
if ( pax->marked != 0 )
errs++;
else matched++;
printf("errs.%d i.%d match %.8f == %.8f\n",errs,i,dstr(pax != 0 ? pax->fiatoshis:-1),dstr(block.vtx[0].vout[i].nValue));
//printf("errs.%d i.%d match %.8f == %.8f\n",errs,i,dstr(pax != 0 ? pax->fiatoshis:-1),dstr(block.vtx[0].vout[i].nValue));
}
else
{
@ -279,7 +279,7 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3
{
uint8_t rmd160[20],addrtype,shortflag,pubkey33[33]; int32_t i,j,n,len,tokomodo,kmdheight; char base[4],coinaddr[64],destaddr[64]; struct pax_transaction space; uint256 txids[64]; uint16_t vouts[64]; double diff; uint64_t seed; int64_t fiatoshis,checktoshis; const char *typestr = "unknown";
tokomodo = (komodo_is_issuer() == 0);
if ( ASSETCHAINS_SYMBOL[0] != 0 )
if ( 0 && ASSETCHAINS_SYMBOL[0] != 0 )
{
for (i=0; i<opretlen; i++)
printf("%02x",opretbuf[i]);
@ -343,15 +343,15 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3
{
for (i=0; i<n; i++)
{
for (j=0; j<32; j++)
printf("%02x",((uint8_t *)&txids[i])[j]);
//for (j=0; j<32; j++)
// printf("%02x",((uint8_t *)&txids[i])[j]);
if ( komodo_paxmark(height,&space,txids[i],vouts[i],height) == 0 )
{
komodo_gateway_deposit(0,0,0,0,0,0,txids[i],vouts[i],height);
}
else
{
printf(" duplicate issuedtxid v%d i.%d of n.%d opretlen.%d\n",vouts[i],i,n,opretlen);
//printf(" duplicate issuedtxid v%d i.%d of n.%d opretlen.%d\n",vouts[i],i,n,opretlen);
}
}
}

Loading…
Cancel
Save