Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
e4729219df
  1. 12
      basilisk/basilisk.c
  2. 9
      basilisk/basilisk_bitcoin.c

12
basilisk/basilisk.c

@ -231,6 +231,7 @@ char *basilisk_block(struct supernet_info *myinfo,struct iguana_info *coin,char
{
if ( (retstr= Lptr->retstr) == 0 )
retstr = clonestr("{\"result\":\"null return from local basilisk_issuecmd\"}");
printf("block got local.(%s)\n",retstr);
}
else
{
@ -254,7 +255,13 @@ char *basilisk_block(struct supernet_info *myinfo,struct iguana_info *coin,char
if ( ptr->uniqueflag == 0 && ptr->numexact <= (ptr->numresults >> 1) )
besti = -1, errstr = "{\"error\":\"basilisk non-consensus results\"}";
else besti = basilisk_besti(ptr), errstr = "{\"error\":\"basilisk no valid results\"}";
if ( (retstr= basilisk_finish(ptr,besti,errstr)) != 0 && remoteaddr != 0 && remoteaddr[0] != 0 && strcmp(remoteaddr,"127.0.0.1") != 0 )
retstr = basilisk_finish(ptr,besti,errstr);
break;
}
if ( retstr == 0 )
retstr = basilisk_finish(ptr,-1,"{\"error\":\"basilisk timeout\"}");
}
if ( retstr != 0 && remoteaddr != 0 && remoteaddr[0] != 0 && strcmp(remoteaddr,"127.0.0.1") != 0 )
{
for (j=0; j<IGUANA_MAXCOINS; j++)
{
@ -276,9 +283,6 @@ char *basilisk_block(struct supernet_info *myinfo,struct iguana_info *coin,char
}
}
}
}
retstr = basilisk_finish(ptr,-1,"{\"error\":\"basilisk timeout\"}");
}
return(retstr);
}

9
basilisk/basilisk_bitcoin.c

@ -632,6 +632,7 @@ void *basilisk_bitcoinrawtx(struct basilisk_item *Lptr,struct supernet_info *myi
decode_hex(buf,spendlen,spendscriptstr);
bitcoin_txoutput(coin,txobj,buf,spendlen,amount);
rawtx = iguana_calcrawtx(myinfo,coin,&vins,txobj,amount,changeaddr,txfee,addresses,minconf);
printf("generated.(%s) vins.(%s)\n",rawtx,vins!=0?jprint(vins,0):"");
}
else
{
@ -651,12 +652,14 @@ void *basilisk_bitcoinrawtx(struct basilisk_item *Lptr,struct supernet_info *myi
Lptr->retstr = jprint(valsobj,1);
return(Lptr);
} else free(rawtx);
} // fall through to remote
}
if ( txobj != 0 )
free_json(txobj), txobj = 0;
free_json(txobj);
if ( vins != 0 )
free_json(vins), vins = 0;
free_json(vins);
Lptr->retstr = clonestr("{\"error\":\"couldnt create rawtx\"}");
return(Lptr);
}
return(basilisk_issueremote(myinfo,"rawtx",coin->symbol,valsobj,0,juint(valsobj,"fanout"),juint(valsobj,"minresults"),basilisktag));
}

Loading…
Cancel
Save