Browse Source

test

etomic
jl777 8 years ago
parent
commit
29cc54aae7
  1. 8
      iguana/iguana_notary.c

8
iguana/iguana_notary.c

@ -433,7 +433,7 @@ STRING_AND_INT(dpow,fundnotaries,symbol,numblocks)
"REVS", "SUPERNET", "DEX", "PANGEA", "JUMBLR", "BET", "CRYPTO", "HODL", "SHARK", "BOTS", "MGW" };
uint8_t pubkeys[64][33]; cJSON *infojson; char coinaddr[64],cmd[1024]; uint64_t signedmask; int32_t i,j,sendflag=0,current=0,height; FILE *fp; double vals[64],sum,val = 0.01;
int32_t n = komodo_notaries("KMD",pubkeys,114000);
if ( symbol != 0 && strcmp(symbol,"BTC") == 0 && (coin= iguana_coinfind("BTC")) != 0 )
if ( symbol != 0 && strcmp(symbol,"BTC") == 0 && (coin= iguana_coinfind("KMD")) != 0 )
{
if ( numblocks == 0 )
numblocks = 10000;
@ -444,15 +444,17 @@ STRING_AND_INT(dpow,fundnotaries,symbol,numblocks)
current = jint(infojson,"blocks");
free_json(infojson);
} else return(clonestr("{\"error\":\"cant get current height\"}"));
if ( (coin= iguana_coinfind("BTC")) != 0 )
{
if ( (fp= fopen("signedmasks","rb")) != 0 )
{
while ( 1 )
{
if ( fread(&height,1,sizeof(height),fp) == sizeof(height) && fread(&signedmask,1,sizeof(signedmask),fp) == sizeof(signedmask) )
{
printf("ht.%d %llx vs current.%d - %d\n",height,(long long)signedmask,current,numblocks);
if ( height > current - numblocks )
{
printf("ht.%d %llx vs current.%d - %d\n",height,(long long)signedmask,current,numblocks);
for (j=0; j<64; j++)
if ( ((1LL << j) & signedmask) != 0 )
vals[j] += (double)DPOW_UTXOSIZE / SATOSHIDEN;
@ -479,6 +481,8 @@ STRING_AND_INT(dpow,fundnotaries,symbol,numblocks)
printf("%s sent %.8f BTC\n",sendflag!=0?"":"would have",sum);
return(clonestr("{\"result\":\"success\"}"));
}
else return(clonestr("{\"error\":\"cant find BTC\"}"));
}
for (i=0; i<sizeof(CURRENCIES)/sizeof(*CURRENCIES); i++)
{
if ( symbol == 0 || symbol[0] == 0 || strcmp(symbol,CURRENCIES[i]) == 0 )

Loading…
Cancel
Save