| 79 | } |
| 80 | |
| 81 | bool RemoveWalletSetting(interfaces::Chain& chain, const std::string& wallet_name) |
| 82 | { |
| 83 | util::SettingsValue setting_value = chain.getRwSetting("wallet"); |
| 84 | if (!setting_value.isArray()) return true; |
| 85 | util::SettingsValue new_value(util::SettingsValue::VARR); |
| 86 | for (const util::SettingsValue& value : setting_value.getValues()) { |
| 87 | if (!value.isStr() || value.get_str() != wallet_name) new_value.push_back(value); |
| 88 | } |
| 89 | if (new_value.size() == setting_value.size()) return true; |
| 90 | return chain.updateRwSetting("wallet", new_value); |
| 91 | } |
| 92 | |
| 93 | static void UpdateWalletSetting(interfaces::Chain& chain, |
| 94 | const std::string& wallet_name, |
no test coverage detected