Skip to content

Commit 1e9e735

Browse files
committed
chain: move new settings safely in overwriteRwSetting
1 parent 1c40900 commit 1e9e735

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/interfaces/chain.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ class Chain
361361
virtual bool updateRwSetting(const std::string& name, const SettingsUpdate& update_function) = 0;
362362

363363
//! 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, bool write = true) = 0;
365365

366366
//! Delete a given setting in <datadir>/settings.json.
367367
virtual bool deleteRwSettings(const std::string& name, bool write = true) = 0;

src/node/interfaces.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,7 @@ class ChainImpl : public Chain
828828
// Now dump value to disk if requested
829829
return *action == interfaces::SettingsAction::SKIP_WRITE || args().WriteSettingsFile();
830830
}
831-
bool overwriteRwSetting(const std::string& name, common::SettingsValue& value, bool write) override
831+
bool overwriteRwSetting(const std::string& name, common::SettingsValue value, bool write) override
832832
{
833833
if (value.isNull()) return deleteRwSettings(name, write);
834834
return updateRwSetting(name, [&](common::SettingsValue& settings) {

src/wallet/load.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ bool VerifyWallets(WalletContext& context)
6969
// Pass write=false because no need to write file and probably
7070
// better not to. If unnamed wallet needs to be added next startup
7171
// and the setting is empty, this code will just run again.
72-
chain.overwriteRwSetting("wallet", wallets, /*write=*/false);
72+
chain.overwriteRwSetting("wallet", std::move(wallets), /*write=*/false);
7373
}
7474
}
7575

0 commit comments

Comments
 (0)