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

@ -37,7 +37,7 @@ void CAssetsDir::SetHex(const std::string& assetHex, const std::string& label)
Set(CAsset(uint256S(assetHex)), AssetMetadata(label));
}
void CAssetsDir::InitFromStrings(const std::vector<std::string>& assetsToInit)
void CAssetsDir::InitFromStrings(const std::vector<std::string>& assetsToInit, const std::string& pegged_asset_name)
{
for (std::string strToSplit : assetsToInit) {
std::vector<std::string> vAssets;
@ -48,7 +48,7 @@ void CAssetsDir::InitFromStrings(const std::vector<std::string>& assetsToInit)
SetHex(vAssets[0], vAssets[1]);
}
// Set "bitcoin" to the pegged asset for tests
Set(Params().GetConsensus().pegged_asset, AssetMetadata("bitcoin"));
Set(Params().GetConsensus().pegged_asset, AssetMetadata(pegged_asset_name));
}
CAsset CAssetsDir::GetAsset(const std::string& label) const