MCPcopy Create free account
hub / github.com/ElementsProject/elements / AddWalletSetting

Function AddWalletSetting

src/wallet/wallet.cpp:70–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68};
69
70bool AddWalletSetting(interfaces::Chain& chain, const std::string& wallet_name)
71{
72 util::SettingsValue setting_value = chain.getRwSetting("wallet");
73 if (!setting_value.isArray()) setting_value.setArray();
74 for (const util::SettingsValue& value : setting_value.getValues()) {
75 if (value.isStr() && value.get_str() == wallet_name) return true;
76 }
77 setting_value.push_back(wallet_name);
78 return chain.updateRwSetting("wallet", setting_value);
79}
80
81bool RemoveWalletSetting(interfaces::Chain& chain, const std::string& wallet_name)
82{

Callers 1

UpdateWalletSettingFunction · 0.85

Calls 6

getRwSettingMethod · 0.80
isArrayMethod · 0.80
setArrayMethod · 0.80
isStrMethod · 0.80
updateRwSettingMethod · 0.80
push_backMethod · 0.45

Tested by

no test coverage detected