Allow default asset name to be set via param

This commit is contained in:
wintercooled 2018-07-12 18:51:49 +01:00
parent 5cea189932
commit dd39cc4f80
6 changed files with 13 additions and 11 deletions

View file

@ -514,6 +514,7 @@ std::string HelpMessage(HelpMessageMode mode)
" " + _(" This creates a new chain with a different genesis block."));
strUsage += HelpMessageOpt("-peginconfirmationdepth", strprintf(_("Pegin claims must be this deep to be considered valid. (default: %d)"), DEFAULT_PEGIN_CONFIRMATION_DEPTH));
strUsage += HelpMessageOpt("-initialfreecoins", strprintf(_("The amount of OP_TRUE coins created in the genesis block. Primarily for testing. (default: %d)"), 0));
strUsage += HelpMessageOpt("-defaultpeggedassetname", strprintf("The name of the default asset created in the genesis block. (default: bitcoin)"));
strUsage += HelpMessageOpt("-parentpubkeyprefix", strprintf(_("The byte prefix, in decimal, of the parent chain's base58 pubkey address. (default: %d)"), 111));
strUsage += HelpMessageOpt("-parentscriptprefix", strprintf(_("The byte prefix, in decimal, of the parent chain's base58 script address. (default: %d)"), 196));
@ -1090,7 +1091,8 @@ bool AppInitParameterInteraction()
nMaxTipAge = GetArg("-maxtipage", DEFAULT_MAX_TIP_AGE);
try {
InitGlobalAssetDir(mapMultiArgs.count("-assetdir") > 0 ? mapMultiArgs.at("-assetdir") : std::vector<std::string>());
const std::string default_asset_name = GetArg("-defaultpeggedassetname", "bitcoin");
InitGlobalAssetDir(mapMultiArgs.count("-assetdir") > 0 ? mapMultiArgs.at("-assetdir") : std::vector<std::string>(), default_asset_name);
} catch (const std::exception& e) {
return InitError(strprintf("Error in -assetdir: %s\n", e.what()));
}