diff --git a/iguana/iguana_peers.c b/iguana/iguana_peers.c index 69194829e..75fd4006e 100755 --- a/iguana/iguana_peers.c +++ b/iguana/iguana_peers.c @@ -436,12 +436,14 @@ int32_t iguana_socket(int32_t bindflag,char *hostname,uint16_t port) return(-1); } } +#ifdef __APPLE__ timeout.tv_sec = 0; - timeout.tv_usec = 30000; - //setsockopt(sock,SOL_SOCKET,SO_RCVTIMEO,(void *)&timeout,sizeof(timeout)); + timeout.tv_usec = 1000000; + setsockopt(sock,SOL_SOCKET,SO_RCVTIMEO,(void *)&timeout,sizeof(timeout)); timeout.tv_sec = 0; - timeout.tv_usec = 10000; - //setsockopt(sock,SOL_SOCKET,SO_SNDTIMEO,(void *)&timeout,sizeof(timeout)); + timeout.tv_usec = 1000000; + setsockopt(sock,SOL_SOCKET,SO_SNDTIMEO,(void *)&timeout,sizeof(timeout)); +#endif if ( listen(sock,64) != 0 ) { printf("listen(%s) port.%d failed: %s sock.%d. errno.%d\n",hostname,port,strerror(errno),sock,errno); diff --git a/iguana/iguana_wallet.c b/iguana/iguana_wallet.c index ff8bb7842..ef1eca8a2 100755 --- a/iguana/iguana_wallet.c +++ b/iguana/iguana_wallet.c @@ -1411,6 +1411,8 @@ TWOSTRINGS_AND_INT(bitcoinrpc,importprivkey,wif,account,rescan) return(clonestr("{\"error\":\"no remote\"}")); if ( myinfo->expiration == 0 ) return(clonestr("{\"error\":\"need to unlock wallet\"}")); + if ( wif == 0 ) + return(clonestr("{\"error\":\"missing wif\"}")); myinfo->expiration++; if ( account == 0 || account[0] == 0 ) account = "default";