This commit is contained in:
jl777
2017-07-13 14:09:52 +02:00
parent 231bcedcf1
commit eb23a64220

View File

@@ -450,6 +450,8 @@ void jumblr_opidupdate(struct jumblr_item *ptr)
void jumblr_prune(struct jumblr_item *ptr)
{
struct jumblr_item *tmp; char oldsrc[128]; int32_t flag = 1;
if ( is_hexstr(ptr->opid,0) == 64 )
return;
printf("jumblr_prune %s\n",ptr->opid);
strcpy(oldsrc,ptr->src);
free(jumblr_zgetoperationresult(ptr->opid));
@@ -459,6 +461,8 @@ void jumblr_prune(struct jumblr_item *ptr)
HASH_ITER(hh,Jumblrs,ptr,tmp)
{
if ( strcmp(oldsrc,ptr->dest) == 0 )
{
if ( is_hexstr(ptr->opid,0) != 64 )
{
printf("jumblr_prune %s (%s -> %s) matched oldsrc\n",ptr->opid,ptr->src,ptr->dest);
free(jumblr_zgetoperationresult(ptr->opid));
@@ -469,6 +473,7 @@ void jumblr_prune(struct jumblr_item *ptr)
}
}
}
}
void jumblr_zaddrinit(char *zaddr)
{
@@ -500,6 +505,9 @@ void jumblr_zaddrinit(char *zaddr)
{
z_z = 1;
strcpy(ptr->src,zaddr);
ptr->src[3] = '0';
ptr->src[4] = '0';
ptr->src[5] = '0';
if ( jumblr_addresstype(ptr->src) != 'z' )
printf("error setting address type to Z: %s\n",jprint(item,0));
}
@@ -585,7 +593,7 @@ void jumblr_iteration()
s = 2;
switch ( s )
{
case 0: // public -> z, need to importprivkey
case 0: // t -> z
if ( Jumblr_deposit[0] != 0 && (total= jumblr_balance(Jumblr_deposit)) >= (JUMBLR_INCR + 3*(fee+JUMBLR_TXFEE))*SATOSHIDEN )
{
if ( (zaddr= jumblr_zgetnewaddress()) != 0 )
@@ -660,18 +668,17 @@ void jumblr_iteration()
}
}
break;
case 2: // z -> public
case 2: // z -> t
if ( Jumblr_numsecretaddrs > 0 )
{
jumblr_opidsupdate();
chosen_one = -1;
printf("Jumblr_numsecretaddrs.%d\n",Jumblr_numsecretaddrs);
for (iter=0; iter<2; iter++)
{
counter = n = 0;
HASH_ITER(hh,Jumblrs,ptr,tmp)
{
printf("status.%d %c %c %.8f\n",ptr->status,jumblr_addresstype(ptr->src),jumblr_addresstype(ptr->dest),dstr(ptr->amount));
//printf("status.%d %c %c %.8f\n",ptr->status,jumblr_addresstype(ptr->src),jumblr_addresstype(ptr->dest),dstr(ptr->amount));
if ( ptr->status > 0 && jumblr_addresstype(ptr->src) == 'z' && jumblr_addresstype(ptr->dest) == 'z' )
{
if ( ptr->spent == 0 && (total= jumblr_balance(ptr->dest)) >= (fee + JUMBLR_FEE)*SATOSHIDEN )