File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -361,10 +361,10 @@ class Chain
361
361
virtual bool updateRwSetting (const std::string& name, const SettingsUpdate& update_function) = 0;
362
362
363
363
// ! Replace a setting in <datadir>/settings.json with a new value.
364
- virtual bool overwriteRwSetting (const std::string& name, common::SettingsValue value, bool write = true ) = 0;
364
+ virtual bool overwriteRwSetting (const std::string& name, common::SettingsValue value, SettingsAction action = SettingsAction::WRITE ) = 0;
365
365
366
366
// ! Delete a given setting in <datadir>/settings.json.
367
- virtual bool deleteRwSettings (const std::string& name, bool write = true ) = 0;
367
+ virtual bool deleteRwSettings (const std::string& name, SettingsAction action = SettingsAction::WRITE ) = 0;
368
368
369
369
// ! Synchronously send transactionAddedToMempool notifications about all
370
370
// ! current mempool transactions to the specified handler and return after
Original file line number Diff line number Diff line change @@ -826,22 +826,22 @@ class ChainImpl : public Chain
826
826
});
827
827
if (!action) return false ;
828
828
// Now dump value to disk if requested
829
- return *action == interfaces::SettingsAction::SKIP_WRITE || args ().WriteSettingsFile ();
829
+ return *action != interfaces::SettingsAction::WRITE || args ().WriteSettingsFile ();
830
830
}
831
- bool overwriteRwSetting (const std::string& name, common::SettingsValue value, bool write ) override
831
+ bool overwriteRwSetting (const std::string& name, common::SettingsValue value, interfaces::SettingsAction action ) override
832
832
{
833
- if (value.isNull ()) return deleteRwSettings (name, write );
833
+ if (value.isNull ()) return deleteRwSettings (name, action );
834
834
return updateRwSetting (name, [&](common::SettingsValue& settings) {
835
835
settings = std::move (value);
836
- return write ? interfaces::SettingsAction::WRITE : interfaces::SettingsAction::SKIP_WRITE ;
836
+ return action ;
837
837
});
838
838
}
839
- bool deleteRwSettings (const std::string& name, bool write ) override
839
+ bool deleteRwSettings (const std::string& name, interfaces::SettingsAction action ) override
840
840
{
841
841
args ().LockSettings ([&](common::Settings& settings) {
842
842
settings.rw_settings .erase (name);
843
843
});
844
- return !write || args ().WriteSettingsFile ();
844
+ return action != interfaces::SettingsAction::WRITE || args ().WriteSettingsFile ();
845
845
}
846
846
void requestMempoolTransactions (Notifications& notifications) override
847
847
{
Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ bool VerifyWallets(WalletContext& context)
69
69
// Pass write=false because no need to write file and probably
70
70
// better not to. If unnamed wallet needs to be added next startup
71
71
// and the setting is empty, this code will just run again.
72
- chain.overwriteRwSetting (" wallet" , std::move (wallets), /* write= */ false );
72
+ chain.overwriteRwSetting (" wallet" , std::move (wallets), interfaces::SettingsAction::SKIP_WRITE );
73
73
}
74
74
}
75
75
You can’t perform that action at this time.
0 commit comments