Skip to content

Commit

Permalink
Don't set policy asset when No Coin is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
JBetz committed Apr 4, 2024
1 parent c5442ec commit 69bc2eb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1329,8 +1329,9 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
#endif

// ELEMENTS:
policyAsset = CAsset(uint256S(gArgs.GetArg("-feeasset", chainparams.GetConsensus().pegged_asset.GetHex())));
if (g_con_any_asset_fees) {
// If fees can be paid in any asset, node operators need to be able to specify asset exchange
// reates using either the static config file and/or the exchange rates RPCs.
RegisterExchangeRatesRPCCommands(tableRPC);
std::string file_path_string = gArgs.GetArg("-exchangeratesjsonfile", "");
if (!file_path_string.empty()) {
Expand All @@ -1340,7 +1341,11 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
return InitError(strprintf(_("Unable to load exchange rates from JSON file %s: %s"), file_path_string, error));
};
}
} else {
// Otherwise, all fees must be paid using the policy asset.
policyAsset = CAsset(uint256S(gArgs.GetArg("-feeasset", chainparams.GetConsensus().pegged_asset.GetHex())));
}

/* Start the RPC server already. It will be started in "warmup" mode
* and not really process calls already (but it will signify connections
* that the server is there and will be ready later). Warmup mode will
Expand Down

0 comments on commit 69bc2eb

Please sign in to comment.