From 071418e3d6fe56f949f850a5f4447f6fea4b44bb Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 21 Sep 2016 15:53:35 -0300 Subject: [PATCH] test --- basilisk/basilisk_MSG.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/basilisk/basilisk_MSG.c b/basilisk/basilisk_MSG.c index 07b9b551c..302ff14b1 100755 --- a/basilisk/basilisk_MSG.c +++ b/basilisk/basilisk_MSG.c @@ -141,23 +141,26 @@ int32_t basilisk_msgcmp(struct basilisk_message *msg,int32_t width,uint32_t chan char *basilisk_iterate_MSG(struct supernet_info *myinfo,uint32_t channel,uint32_t msgid,bits256 srchash,bits256 desthash,int32_t origwidth) { - struct basilisk_message *msg,*tmpmsg; uint8_t key[BASILISK_KEYSIZE]; int32_t i,keylen,width; cJSON *item,*retjson,*array; bits256 zero; + struct basilisk_message *msg,*tmpmsg; uint8_t key[BASILISK_KEYSIZE]; int32_t allflag,i,keylen,width; cJSON *item,*retjson,*array; bits256 zero; memset(zero.bytes,0,sizeof(zero)); array = cJSON_CreateArray(); if ( (width= origwidth) > 3600 ) width = 3600; else if ( width < 1 ) width = 1; + allflag = (bits256_nonz(srchash) == 0 && bits256_nonz(desthash) == 0); portable_mutex_lock(&myinfo->messagemutex); HASH_ITER(hh,myinfo->messagetable,msg,tmpmsg) { - if ( msg->broadcast != 0 && basilisk_msgcmp(msg,origwidth,channel,msgid,zero,zero) == 0 ) + if ( allflag != 0 || (msg->broadcast != 0 && basilisk_msgcmp(msg,origwidth,channel,msgid,zero,zero) == 0) ) jaddi(array,basilisk_msgjson(msg,msg->key,msg->keylen)); } portable_mutex_unlock(&myinfo->messagemutex); //printf("iterate_MSG width.%d channel.%d msgid.%d src.%llx -> %llx\n",origwidth,channel,msgid,(long long)srchash.txid,(long long)desthash.txid); for (i=0; i