jl777 8 years ago
parent
commit
9345a88509
  1. 8
      basilisk/basilisk_MSG.c

8
basilisk/basilisk_MSG.c

@ -256,7 +256,7 @@ char *basilisk_respond_MSG(struct supernet_info *myinfo,char *CMD,void *addr,cha
width = juint(valsobj,"width"); width = juint(valsobj,"width");
msgid = juint(valsobj,"msgid"); msgid = juint(valsobj,"msgid");
channel = juint(valsobj,"channel"); channel = juint(valsobj,"channel");
char str[65],str2[65]; printf("%s -> %s channel.%u msgid.%x width.%d from.%s\n",bits256_str(str,jbits256(valsobj,"sender")),bits256_str(str2,jbits256(valsobj,"desthash")),juint(valsobj,"channel"),msgid,width,remoteaddr); //char str[65],str2[65]; printf("%s -> %s channel.%u msgid.%x width.%d from.%s\n",bits256_str(str,jbits256(valsobj,"sender")),bits256_str(str2,jbits256(valsobj,"desthash")),juint(valsobj,"channel"),msgid,width,remoteaddr);
retstr = basilisk_iterate_MSG(myinfo,channel,msgid,jbits256(valsobj,"srchash"),jbits256(valsobj,"desthash"),width); retstr = basilisk_iterate_MSG(myinfo,channel,msgid,jbits256(valsobj,"srchash"),jbits256(valsobj,"desthash"),width);
} }
return(retstr); return(retstr);
@ -285,7 +285,7 @@ HASH_ARRAY_STRING(basilisk,getmessage,hash,vals,hexstr)
retstr = basilisk_iterate_MSG(myinfo,channel,msgid,jbits256(vals,"srchash"),jbits256(vals,"desthash"),width); retstr = basilisk_iterate_MSG(myinfo,channel,msgid,jbits256(vals,"srchash"),jbits256(vals,"desthash"),width);
return(retstr); return(retstr);
} }
printf("getmessage not relay.%d\n",myinfo->NOTARY.RELAYID); //printf("getmessage not relay.%d\n",myinfo->NOTARY.RELAYID);
return(basilisk_standardservice("MSG",myinfo,0,jbits256(vals,"desthash"),vals,hexstr,1)); return(basilisk_standardservice("MSG",myinfo,0,jbits256(vals,"desthash"),vals,hexstr,1));
} }
@ -324,7 +324,7 @@ int32_t basilisk_channelsend(struct supernet_info *myinfo,bits256 srchash,bits25
jaddnum(valsobj,"duration",duration); jaddnum(valsobj,"duration",duration);
jaddbits256(valsobj,"srchash",srchash); jaddbits256(valsobj,"srchash",srchash);
jaddbits256(valsobj,"desthash",desthash); jaddbits256(valsobj,"desthash",desthash);
char str[65]; printf("sendmessage.[%d] channel.%u msgid.%x -> %s numrelays.%d\n",datalen,channel,msgid,bits256_str(str,desthash),myinfo->NOTARY.NUMRELAYS); //char str[65]; printf("sendmessage.[%d] channel.%u msgid.%x -> %s numrelays.%d\n",datalen,channel,msgid,bits256_str(str,desthash),myinfo->NOTARY.NUMRELAYS);
if ( (retstr= basilisk_sendmessage(myinfo,0,0,0,desthash,valsobj,hexstr)) != 0 ) if ( (retstr= basilisk_sendmessage(myinfo,0,0,0,desthash,valsobj,hexstr)) != 0 )
free(retstr); free(retstr);
free_json(valsobj); free_json(valsobj);
@ -375,7 +375,7 @@ cJSON *basilisk_channelget(struct supernet_info *myinfo,bits256 srchash,bits256
jaddbits256(valsobj,"desthash",desthash); jaddbits256(valsobj,"desthash",desthash);
if ( (retstr= basilisk_getmessage(myinfo,0,0,0,desthash,valsobj,0)) != 0 ) if ( (retstr= basilisk_getmessage(myinfo,0,0,0,desthash,valsobj,0)) != 0 )
{ {
printf("channel.%u msgid.%u gotmessage.(%d)\n",channel,msgid,(int32_t)strlen(retstr)); //printf("channel.%u msgid.%u gotmessage.(%d)\n",channel,msgid,(int32_t)strlen(retstr));
if ( (retarray= cJSON_Parse(retstr)) != 0 ) if ( (retarray= cJSON_Parse(retstr)) != 0 )
{ {
if ( is_cJSON_Array(retarray) == 0 ) if ( is_cJSON_Array(retarray) == 0 )

Loading…
Cancel
Save