Browse Source

test

etomic
jl777 8 years ago
parent
commit
4f66144354
  1. 16
      basilisk/basilisk_MSG.c

16
basilisk/basilisk_MSG.c

@ -216,9 +216,17 @@ char *basilisk_respond_addmessage(struct supernet_info *myinfo,uint8_t *key,int3
msg->expiration = (uint32_t)time(NULL) + duration; msg->expiration = (uint32_t)time(NULL) + duration;
HASH_ADD_KEYPTR(hh,myinfo->messagetable,msg->key,msg->keylen,msg); HASH_ADD_KEYPTR(hh,myinfo->messagetable,msg->key,msg->keylen,msg);
QUEUEITEMS++; QUEUEITEMS++;
int32_t i; for (i=0; i<BASILISK_KEYSIZE; i++) {
printf("%02x",key[i]); struct basilisk_request R;
printf(" <- ADDMSG.[%d] exp %u %p (%p %p)\n",QUEUEITEMS,msg->expiration,msg,msg->hh.next,msg->hh.prev); int32_t i; for (i=0; i<BASILISK_KEYSIZE; i++)
printf("%02x",key[i]);
printf(" key, ");
for (i=0; i<datalen; i++)
printf("%02x",data[i]);
basilisk_rwDEXquote(0,data,&R);
printf(" %s <- ADDMSG.[%d] exp %u %p (%p %p)\n",jprint(basilisk_requestjson(&R),1),QUEUEITEMS,msg->expiration,msg,msg->hh.next,msg->hh.prev);
}
portable_mutex_unlock(&myinfo->messagemutex); portable_mutex_unlock(&myinfo->messagemutex);
//if ( myinfo->NOTARY.RELAYID >= 0 ) //if ( myinfo->NOTARY.RELAYID >= 0 )
// dpow_handler(myinfo,msg); // dpow_handler(myinfo,msg);
@ -292,7 +300,7 @@ HASH_ARRAY_STRING(basilisk,sendmessage,hash,vals,hexstr)
{ {
int32_t keylen,datalen; uint8_t key[BASILISK_KEYSIZE],space[16384],*data,*ptr = 0; char *retstr=0; int32_t keylen,datalen; uint8_t key[BASILISK_KEYSIZE],space[16384],*data,*ptr = 0; char *retstr=0;
data = get_dataptr(BASILISK_HDROFFSET,&ptr,&datalen,&space[BASILISK_KEYSIZE],sizeof(space)-BASILISK_KEYSIZE,hexstr); data = get_dataptr(BASILISK_HDROFFSET,&ptr,&datalen,&space[BASILISK_KEYSIZE],sizeof(space)-BASILISK_KEYSIZE,hexstr);
//if ( myinfo->IAMNOTARY != 0 && myinfo->NOTARY.RELAYID >= 0 ) if ( myinfo->dexsock >= 0 || (myinfo->IAMNOTARY != 0 && myinfo->NOTARY.RELAYID >= 0) )
{ {
keylen = basilisk_messagekey(key,juint(vals,"channel"),juint(vals,"msgid"),jbits256(vals,"srchash"),jbits256(vals,"desthash")); keylen = basilisk_messagekey(key,juint(vals,"channel"),juint(vals,"msgid"),jbits256(vals,"srchash"),jbits256(vals,"desthash"));
memcpy(space,key,BASILISK_KEYSIZE); memcpy(space,key,BASILISK_KEYSIZE);

Loading…
Cancel
Save