aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/message_store.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/wallet/message_store.cpp')
-rw-r--r--src/wallet/message_store.cpp16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/wallet/message_store.cpp b/src/wallet/message_store.cpp
index b7b29420b..34b4f440b 100644
--- a/src/wallet/message_store.cpp
+++ b/src/wallet/message_store.cpp
@@ -193,9 +193,7 @@ void message_store::unpack_signer_config(const multisig_wallet_state &state, con
{
try
{
- std::stringstream iss;
- iss << signer_config;
- binary_archive<false> ar(iss);
+ binary_archive<false> ar{epee::strspan<std::uint8_t>(signer_config)};
THROW_WALLET_EXCEPTION_IF(!::serialization::serialize(ar, signers), tools::error::wallet_internal_error, "Failed to serialize signer config");
}
catch (...)
@@ -383,9 +381,7 @@ void message_store::process_auto_config_data_message(uint32_t id)
auto_config_data data;
try
{
- std::stringstream iss;
- iss << m.content;
- binary_archive<false> ar(iss);
+ binary_archive<false> ar{epee::strspan<std::uint8_t>(m.content)};
THROW_WALLET_EXCEPTION_IF(!::serialization::serialize(ar, data), tools::error::wallet_internal_error, "Failed to serialize auto config data");
}
catch (...)
@@ -790,9 +786,7 @@ void message_store::read_from_file(const multisig_wallet_state &state, const std
file_data read_file_data;
try
{
- std::stringstream iss;
- iss << buf;
- binary_archive<false> ar(iss);
+ binary_archive<false> ar{epee::strspan<std::uint8_t>(buf)};
if (::serialization::serialize(ar, read_file_data))
if (::serialization::check_stream_state(ar))
loaded = true;
@@ -829,9 +823,7 @@ void message_store::read_from_file(const multisig_wallet_state &state, const std
loaded = false;
try
{
- std::stringstream iss;
- iss << decrypted_data;
- binary_archive<false> ar(iss);
+ binary_archive<false> ar{epee::strspan<std::uint8_t>(decrypted_data)};
if (::serialization::serialize(ar, *this))
if (::serialization::check_stream_state(ar))
loaded = true;