diff options
| author | luigi1111 <luigi1111w@gmail.com> | 2021-06-10 12:00:54 -0500 |
|---|---|---|
| committer | luigi1111 <luigi1111w@gmail.com> | 2021-06-10 12:00:54 -0500 |
| commit | 7499837a6fe8d3533e1360dce8f3ba230ff76042 (patch) | |
| tree | cd3e089e2e09de33044220ff72461a761b028e3f /src/wallet/message_store.cpp | |
| parent | ca732849515d1e01147ded7db05defdb5518b13b (diff) | |
| parent | 08e4497c6e3b3f434c0bb255c3942648f153fe66 (diff) | |
| download | monzero-core-7499837a6fe8d3533e1360dce8f3ba230ff76042.tar.gz monzero-core-7499837a6fe8d3533e1360dce8f3ba230ff76042.tar.xz monzero-core-7499837a6fe8d3533e1360dce8f3ba230ff76042.zip | |
Merge pull request #7661
08e4497 Improve cryptonote (block and tx) binary read performance (Lee Clagett)
Diffstat (limited to 'src/wallet/message_store.cpp')
| -rw-r--r-- | src/wallet/message_store.cpp | 16 |
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; |
