Merge pull request 'Mac changes' (#227) from dev-mac into dev

Reviewed-on: https://git.hush.is/hush/hush3/pulls/227
This commit is contained in:
Duke Leto
2022-10-29 11:49:51 +00:00
11 changed files with 186 additions and 23 deletions

View File

@@ -38,7 +38,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <TargetConditionals.h>
#include <AvailabilityMacros.h>
# if TARGET_OS_OSX
# define USE_PTHREAD_JIT_WP 1
# if TARGET_CPU_ARM64
# define USE_PTHREAD_JIT_WP 1
# else
# undef USE_PTHREAD_JIT_WP
# endif
# include <pthread.h>
# endif
#endif

View File

@@ -1137,9 +1137,16 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
if(fs::exists(asmap_path)) {
printf("%s: found asmap file at %s\n", __func__, asmap_path.c_str() );
} else {
// Shit is fucked up, die an honorable death
InitError(strprintf(_("Could not find any asmap file! Please report this bug to Hush Developers")));
return false;
// Mac SD
asmap_path = fs::path("/Applications/SilentDragon.app/Contents/MacOS/") / DEFAULT_ASMAP_FILENAME;
printf("%s: looking for asmap file at %s\n", __func__, asmap_path.c_str() );
if(fs::exists(asmap_path)) {
printf("%s: found asmap file at %s\n", __func__, asmap_path.c_str() );
} else {
// Shit is fucked up, die an honorable death
InitError(strprintf(_("Could not find any asmap file! Please report this bug to Hush Developers")));
return false;
}
}
}
}

View File

@@ -453,8 +453,10 @@ UniValue getrawtransaction(const UniValue& params, bool fHelp, const CPubKey& my
return strHex;
UniValue result(UniValue::VOBJ);
int serializeSize = GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION);
result.push_back(Pair("hex", strHex));
result.push_back(Pair("size", GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION) ));
result.push_back(Pair("size", serializeSize));
TxToJSONExpanded(tx, hashBlock, result, nHeight, nConfirmations, nBlockTime);
return result;
}

View File

@@ -1997,10 +1997,13 @@ UniValue rpc_stratum_updatework(const UniValue& params, bool fHelp, const CPubKe
// throw JSONRPCError(RPC_INTERNAL_ERROR, "Something went wrong, plz try again!");
// }
uint64_t clientsSize = json_clients.size();
uint64_t subscriptionsSize = subscriptions.size();
obj.push_back(Pair("clients", json_clients));
obj.push_back(Pair("updated", json_clients.size()));
obj.push_back(Pair("updated", clientsSize));
obj.push_back(Pair("skipped", skipped));
obj.push_back(Pair("total", subscriptions.size()));
obj.push_back(Pair("total", subscriptionsSize));
return obj;
}
@@ -2126,9 +2129,9 @@ UniValue rpc_stratum_getclientscount (const UniValue& params, bool fHelp, const
+ HelpExampleCli("stratum_getclientscount", "")
+ HelpExampleRpc("stratum_getclientscount", "")
);
UniValue obj(UniValue::VOBJ);
obj.push_back(Pair("total", subscriptions.size()));
uint64_t subscriptionsSize = subscriptions.size();
obj.push_back(Pair("total", subscriptionsSize));
return obj;
};

View File

@@ -527,7 +527,7 @@ boost::filesystem::path GetDefaultDataDir()
// existing legacy directory, use that for backward compat
return pathRet;
} else {
// For new clones, use Hush/HUSH3
// For new clones, use Hush/ACNAME
pathRet = GetSpecialFolderPath(CSIDL_APPDATA) / "Hush" / symbol;
return pathRet;
}
@@ -558,12 +558,12 @@ boost::filesystem::path GetDefaultDataDir()
tmppath = pathRet;
tmppath /= "Komodo";
//TryCreateDirectory(tmppath);
if(fs::is_directory( tmppath / symbol) {
if(fs::is_directory( tmppath / symbol)) {
// Found legacy dir, use that
return tmppath / symbol;
} else {
// For new clones, use Hush/HUSH3
tmppath = pathRet / "Hush" / HUSH3;
// For new clones, use Hush/ACNAME
tmppath = pathRet / "Hush" / symbol;
}
return tmppath;
}
@@ -581,7 +581,7 @@ boost::filesystem::path GetDefaultDataDir()
// existing legacy directory, use that for backward compat
return tmppath;
} else {
// For new clones, use .hush/HUSH3
// For new clones, use .hush/ACNAME
tmppath = pathRet / ".hush" / symbol;
}
return tmppath;