diff --git a/basilisk/basilisk.c b/basilisk/basilisk.c index c524d86fb..24c358ac9 100755 --- a/basilisk/basilisk.c +++ b/basilisk/basilisk.c @@ -994,7 +994,7 @@ void basilisk_msgprocess(struct supernet_info *myinfo,void *_addr,uint32_t sende // unencrypted low level functions, used by higher level protocols and virtual network funcs { (void *)"ADD", &basilisk_respond_addrelay }, // relays register with each other bus - // { (void *)"RLY", &basilisk_respond_relays }, + { (void *)"RLY", &basilisk_respond_relays }, { (void *)"DEX", &basilisk_respond_instantdex }, // encrypted data for jumblr @@ -1018,7 +1018,7 @@ void basilisk_msgprocess(struct supernet_info *myinfo,void *_addr,uint32_t sende symbol = "BTCD"; if ( (valsobj= cJSON_Parse((char *)data)) != 0 ) { - //printf("MSGVALS.(%s)\n",(char *)data); + printf("MSGVALS.(%s)\n",(char *)data); if ( jobj(valsobj,"coin") != 0 ) coin = iguana_coinfind(jstr(valsobj,"coin")); else if ( jobj(valsobj,"symbol") != 0 ) @@ -1068,7 +1068,7 @@ void basilisk_msgprocess(struct supernet_info *myinfo,void *_addr,uint32_t sende CMD[i] = toupper((int32_t)CMD[i]); cmd[i] = tolower((int32_t)CMD[i]); } - //printf("MSGPROCESS.(%s) tag.%d\n",(char *)data,basilisktag); + printf("MSGPROCESS.(%s) tag.%d\n",(char *)data,basilisktag); myinfo->basilisk_busy = 1; if ( valsobj != 0 ) { diff --git a/basilisk/basilisk_CMD.c b/basilisk/basilisk_CMD.c index d557c7c39..dc3643ae4 100755 --- a/basilisk/basilisk_CMD.c +++ b/basilisk/basilisk_CMD.c @@ -69,11 +69,11 @@ char *basilisk_respond_relays(struct supernet_info *myinfo,char *CMD,void *_addr decode_hex(sig,siglen,sigstr); vcalc_sha256(0,txhash2.bytes,data,datalen); memset(pubkey33,0,33); - if ( bitcoin_recoververify(myinfo->ctx,"BTCD",sig,txhash2,pubkey33) == 0 || 1 ) + if ( bitcoin_recoververify(myinfo->ctx,"BTCD",sig,txhash2,pubkey33) == 0 ) { // compare with existing init_hexbytes_noT(pubstr,pubkey33,33); - printf("skip verified relay data siglen.%d pub33.%s\n",siglen,pubstr); + printf(" verified relay data siglen.%d pub33.%s\n",siglen,pubstr); if ( (retstr= basilisk_addrelay_info(myinfo,pubkey33,(uint32_t)calc_ipbits(remoteaddr),hash)) != 0 ) free(retstr); n = (int32_t)(datalen / sizeof(uint32_t)); diff --git a/iguana/iguana_secp.c b/iguana/iguana_secp.c index 2d1a53242..d9588f387 100755 --- a/iguana/iguana_secp.c +++ b/iguana/iguana_secp.c @@ -160,7 +160,13 @@ int32_t bitcoin_recoververify(void *ctx,char *symbol,uint8_t *sig65,bits256 mess { secp256k1_ec_pubkey_serialize(ctx,pubkey,&plen,&PUB,plen == 65 ? SECP256K1_EC_UNCOMPRESSED : SECP256K1_EC_COMPRESSED); if ( secp256k1_ecdsa_verify(ctx,&SIG,messagehash2.bytes,&PUB) != 0 ) + { retval = 0; + if ( pubkey[0] == 4 ) // experimentally looks like 04 is set + pubkey[0] = 2; + else if ( pubkey[0] != 2 ) + pubkey[0] = 3; + } else printf("secp256k1_ecdsa_verify error\n"); } else printf("secp256k1_ecdsa_recover error\n"); ENDSECP_ENSURE_CTX