aboutsummaryrefslogtreecommitdiff
path: root/src/simplewallet
diff options
context:
space:
mode:
authorkenshi84 <kenshi84@protonmail.ch>2016-12-20 13:26:39 +0900
committerkenshi84 <kenshi84@protonmail.ch>2016-12-20 13:26:39 +0900
commit07b9138cad7d5e8aa046f2e555563760c11a9e37 (patch)
treef62b0167a52b596ab619d5f7b7e1e4e4042a4bb1 /src/simplewallet
parentalso use portable serializer for boost_serialization_helper.h and net_node.in... (diff)
downloadmonero-07b9138cad7d5e8aa046f2e555563760c11a9e37.tar.xz
support importing unportable outputs
Diffstat (limited to 'src/simplewallet')
-rw-r--r--src/simplewallet/simplewallet.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp
index 222998dfd..251f9c231 100644
--- a/src/simplewallet/simplewallet.cpp
+++ b/src/simplewallet/simplewallet.cpp
@@ -3962,10 +3962,19 @@ bool simple_wallet::import_outputs(const std::vector<std::string> &args)
std::string body(data, headerlen);
std::stringstream iss;
iss << body;
- boost::archive::portable_binary_iarchive ar(iss);
std::vector<tools::wallet2::transfer_details> outputs;
- ar >> outputs;
-
+ try
+ {
+ boost::archive::portable_binary_iarchive ar(iss);
+ ar >> outputs;
+ }
+ catch (...)
+ {
+ iss.str("");
+ iss << body;
+ boost::archive::binary_iarchive ar(iss);
+ ar >> outputs;
+ }
size_t n_outputs = m_wallet->import_outputs(outputs);
success_msg_writer() << boost::lexical_cast<std::string>(n_outputs) << " outputs imported";
}