diff --git a/basilisk/basilisk_DEX.c b/basilisk/basilisk_DEX.c index 47e2596bc..17762ffb4 100755 --- a/basilisk/basilisk_DEX.c +++ b/basilisk/basilisk_DEX.c @@ -450,7 +450,7 @@ STRING_ARG(InstantDEX,available,source) HASH_ARRAY_STRING(InstantDEX,request,hash,vals,hexstr) { uint8_t serialized[512]; struct basilisk_request R; cJSON *reqjson; uint32_t datalen=0,DEX_channel; - myinfo->DEXactive = (uint32_t)time(NULL) + 3*BASILISK_TIMEOUT; + myinfo->DEXactive = (uint32_t)time(NULL) + 3*BASILISK_TIMEOUT + 60; jadd64bits(vals,"minamount",jdouble(vals,"minprice") * jdouble(vals,"amount") * SATOSHIDEN); if ( jobj(vals,"srchash") == 0 ) jaddbits256(vals,"srchash",myinfo->myaddr.persistent); diff --git a/basilisk/basilisk_MSG.c b/basilisk/basilisk_MSG.c index f6c448b25..1a7a5b37a 100755 --- a/basilisk/basilisk_MSG.c +++ b/basilisk/basilisk_MSG.c @@ -94,24 +94,6 @@ char *basilisk_iterate_MSG(struct supernet_info *myinfo,uint32_t channel,uint32_ char str[65],str2[65]; printf("MSGiterate (%s) -> (%s)\n",bits256_str(str,srchash),bits256_str(str2,desthash)); array = cJSON_CreateArray(); portable_mutex_lock(&myinfo->messagemutex); - if ( bits256_nonz(srchash) == 0 ) - { - HASH_ITER(hh,myinfo->messagetable,msg,tmpmsg) - { - if ( basilisk_msgcmp(msg,origwidth,channel,msgid,zero,zero) == 0 ) - { - if ( (msgjson= basilisk_msgjson(msg,msg->key,msg->keylen)) != 0 ) - jaddi(array,msgjson); - } - if ( now > msg->expiration ) - { - printf("delete expired message.%p QUEUEITEMS.%d\n",msg,QUEUEITEMS); - HASH_DELETE(hh,myinfo->messagetable,msg); - QUEUEITEMS--; - free(msg); - } - } - } //printf("iterate_MSG allflag.%d width.%d channel.%d msgid.%d src.%llx -> %llx\n",allflag,origwidth,channel,msgid,(long long)srchash.txid,(long long)desthash.txid); for (i=0; imessagetable,msg,tmpmsg) + { + if ( basilisk_msgcmp(msg,origwidth,channel,msgid,zero,zero) == 0 ) + { + if ( (msgjson= basilisk_msgjson(msg,msg->key,msg->keylen)) != 0 ) + jaddi(array,msgjson); + } + } + } + HASH_ITER(hh,myinfo->messagetable,msg,tmpmsg) + { + if ( now > msg->expiration+60 ) + { + printf("delete expired message.%p QUEUEITEMS.%d\n",msg,QUEUEITEMS); + HASH_DELETE(hh,myinfo->messagetable,msg); + QUEUEITEMS--; + free(msg); + } + } portable_mutex_unlock(&myinfo->messagemutex); if ( cJSON_GetArraySize(array) > 0 ) {