Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
97f4029ead
  1. 2
      basilisk/basilisk_bitcoin.c
  2. 3
      basilisk/basilisk_swap.c
  3. 1
      iguana/iguana_sign.c
  4. 16
      iguana/iguana_unspents.c
  5. 4
      iguana/iguana_volatiles.c

2
basilisk/basilisk_bitcoin.c

@ -345,7 +345,7 @@ void *basilisk_bitcoinvalue(struct basilisk_item *Lptr,struct supernet_info *myi
{
if ( iguana_unspentindfind(coin,coinaddr,0,0,&value,&height,txid,vout,coin->bundlescount,0) > 0 )
{
printf("bitcoinvalue found iguana\n");
//printf("bitcoinvalue found iguana\n");
Lptr->retstr = basilisk_valuestr(coin,coinaddr,value,height,txid,vout);
return(Lptr);
} else printf("unspentind couldnt find %s vout.%d\n",bits256_str(str,txid),vout);

3
basilisk/basilisk_swap.c

@ -54,6 +54,8 @@ bits256 basilisk_swap_broadcast(struct supernet_info *myinfo,struct basilisk_swa
{
bits256 txid;
memset(txid.bytes,0,sizeof(txid));
if ( data != 0 && datalen != 0 )
txid = bits256_doublesha256(0,data,datalen);
return(txid);
}
@ -532,6 +534,7 @@ uint32_t basilisk_swapdata_rawtxsend(struct supernet_info *myinfo,struct basilis
if ( basilisk_swapdata_rawtx(myinfo,swap,data,maxlen,rawtx) != 0 )
{
rawtx->actualtxid = basilisk_swap_broadcast(myinfo,swap,rawtx->coin,rawtx->txbytes,rawtx->datalen);
char str[65],str2[65]; printf("rawtxsend %s vs %s\n",bits256_str(str,rawtx->signedtxid),bits256_str(str2,rawtx->actualtxid));
if ( bits256_nonz(rawtx->actualtxid) != 0 && msgbits != 0 )
return(basilisk_swapsend(myinfo,swap,msgbits,rawtx->txbytes,rawtx->datalen,nextbits));
}

1
iguana/iguana_sign.c

@ -478,7 +478,6 @@ bits256 iguana_parsetxobj(struct supernet_info *myinfo,struct iguana_info *coin,
memset(&txid,0,sizeof(txid));
if ( txobj == 0 )
return(txid);
fprintf(stderr,"parsetxobj serialized.%p\n",serialized);
memset(msg,0,sizeof(*msg));
vpnstr[0] = 0;
if ( (msg->version= juint(txobj,"version")) == 0 )

16
iguana/iguana_unspents.c

@ -318,24 +318,24 @@ int32_t iguana_pkhasharray(struct supernet_info *myinfo,struct iguana_info *coin
lastheight = IGUANA_MAXHEIGHT;
if ( max > coin->bundlescount )
max = coin->bundlescount;
printf("minconf.%d maxconf.%d max.%d addr.%s last.%d maxunspents.%d\n",minconf,maxconf,max,coinaddr,lastheight,maxunspents);
//printf("minconf.%d maxconf.%d max.%d addr.%s last.%d maxunspents.%d\n",minconf,maxconf,max,coinaddr,lastheight,maxunspents);
for (total=n=i=0; i<max; i++)
{
if ( (bp= coin->bundles[i]) == 0 )
continue;
if ( lastheight > 0 && bp->bundleheight > lastheight )
{
printf("lastheight.%d less than %d\n",lastheight,bp->bundleheight+bp->n);
//printf("lastheight.%d less than %d\n",lastheight,bp->bundleheight+bp->n);
break;
}
if ( (coin->blocks.hwmchain.height - (bp->bundleheight + bp->n - 1)) > maxconf )
{
printf("%d more than minconf.%d\n",(coin->blocks.hwmchain.height - (bp->bundleheight + bp->n - 1)),maxconf);
//printf("%d more than minconf.%d\n",(coin->blocks.hwmchain.height - (bp->bundleheight + bp->n - 1)),maxconf);
continue;
}
if ( (coin->blocks.hwmchain.height - bp->bundleheight) < minconf )
{
printf("%d less than minconf.%d\n",(coin->blocks.hwmchain.height - bp->bundleheight),minconf);
//printf("%d less than minconf.%d\n",(coin->blocks.hwmchain.height - bp->bundleheight),minconf);
break;
}
if ( iguana_pkhashfind(coin,&ramchain,&deposits,&lastunspentind,P != 0 ? &P[n] : &_p,rmd160,i,i) != 0 )
@ -348,7 +348,7 @@ int32_t iguana_pkhasharray(struct supernet_info *myinfo,struct iguana_info *coin
}
else
{
printf("%s pkhash balance.[%d] from m.%d check %.8f vs %.8f spent %.8f [%.8f]\n",coinaddr,i,m,dstr(netbalance),dstr(deposits),dstr(spent),dstr(deposits)-dstr(spent));
//printf("%s pkhash balance.[%d] from m.%d check %.8f vs %.8f spent %.8f [%.8f]\n",coinaddr,i,m,dstr(netbalance),dstr(deposits),dstr(spent),dstr(deposits)-dstr(spent));
total += netbalance;
n++;
}
@ -390,7 +390,7 @@ int64_t iguana_unspents(struct supernet_info *myinfo,struct iguana_info *coin,cJ
bitcoin_address(coinaddr,addrtypes[i],&rmdarray[i * 20],20);
*numunspentsp = 0;
iguana_pkhasharray(myinfo,coin,array,minconf,maxconf,&total,P,coin->bundlescount,&rmdarray[i * 20],coinaddr,&pubkeys[33*i],lastheight,&unspents[numunspents << 1],numunspentsp,maxunspents);
printf("iguana_unspents: i.%d of %d: %s %.8f numunspents.%d\n",i,numrmds,coinaddr,dstr(total),*numunspentsp);
//printf("iguana_unspents: i.%d of %d: %s %.8f numunspents.%d\n",i,numrmds,coinaddr,dstr(total),*numunspentsp);
maxunspents -= *numunspentsp;
numunspents += *numunspentsp;
sum += total;
@ -447,12 +447,12 @@ int32_t iguana_unspentslists(struct supernet_info *myinfo,struct iguana_info *co
{
if ( (coinaddr= jstri(addresses,i)) != 0 )
{
printf("i.%d coinaddr.(%s) minconf.%d longest.%d diff.%d\n",i,coinaddr,minconf,coin->longestchain,coin->blocks.hwmchain.height - minconf);
//printf("i.%d coinaddr.(%s) minconf.%d longest.%d diff.%d\n",i,coinaddr,minconf,coin->longestchain,coin->blocks.hwmchain.height - minconf);
total = 0;
n = 0;
bitcoin_addr2rmd160(&addrtype,rmd160,coinaddr);
iguana_pkhasharray(myinfo,coin,0,minconf,coin->longestchain,&total,0,coin->bundlescount,rmd160,coinaddr,pubkey,coin->blocks.hwmchain.height - minconf,unspents,&n,max-1000);
printf("n.%d max.%d total %.8f\n",n,max,dstr(total));
//printf("n.%d max.%d total %.8f\n",n,max,dstr(total));
if ( n > 0 )
{
sum += total;

4
iguana/iguana_volatiles.c

@ -218,7 +218,9 @@ int32_t iguana_volatileupdate(struct iguana_info *coin,int32_t incremental,struc
}
if ( coin->current != 0 && spent_hdrsi != coin->current->hdrsi )
iguana_bundleremove(coin,spent_hdrsi,0);
exit(-1);
coin->spendvectorsaved = 0;
coin->started = 0;
coin->active = 0;
} else printf("volatileupdate error null rdata [%d]\n",spentchain->height/coin->current->bundleheight);
return(-1);
}

Loading…
Cancel
Save