aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/blockchain_utilities/cn_deserialize.cpp3
-rw-r--r--src/common/CMakeLists.txt7
-rw-r--r--src/common/stack_trace.cpp120
-rw-r--r--src/common/stack_trace.h43
-rw-r--r--src/crypto/crypto.cpp9
-rw-r--r--src/crypto/oaes_lib.c4
-rw-r--r--src/crypto/slow-hash.c6
-rw-r--r--src/cryptonote_core/tx_extra.h13
-rw-r--r--src/daemon/main.cpp2
-rw-r--r--src/p2p/connection_basic.cpp6
-rw-r--r--src/p2p/connection_basic.hpp2
-rw-r--r--src/p2p/data_logger.cpp2
-rw-r--r--src/p2p/data_logger.hpp2
-rw-r--r--src/rpc/core_rpc_server.cpp2
-rw-r--r--src/wallet/wallet_rpc_server.cpp20
15 files changed, 207 insertions, 34 deletions
diff --git a/src/blockchain_utilities/cn_deserialize.cpp b/src/blockchain_utilities/cn_deserialize.cpp
index b8d38c9af..a8448dcee 100644
--- a/src/blockchain_utilities/cn_deserialize.cpp
+++ b/src/blockchain_utilities/cn_deserialize.cpp
@@ -160,8 +160,9 @@ int main(int argc, char* argv[])
std::cout << "field " << n << ": ";
if (typeid(cryptonote::tx_extra_padding) == fields[n].type()) std::cout << "extra padding: " << boost::get<cryptonote::tx_extra_padding>(fields[n]).size << " bytes";
else if (typeid(cryptonote::tx_extra_pub_key) == fields[n].type()) std::cout << "extra pub key: " << boost::get<cryptonote::tx_extra_pub_key>(fields[n]).pub_key;
- else if (typeid(cryptonote::tx_extra_nonce) == fields[n].type()) std::cout << "extra nonce: " << boost::get<cryptonote::tx_extra_nonce>(fields[n]).nonce;
+ else if (typeid(cryptonote::tx_extra_nonce) == fields[n].type()) std::cout << "extra nonce: " << epee::string_tools::buff_to_hex_nodelimer(boost::get<cryptonote::tx_extra_nonce>(fields[n]).nonce);
else if (typeid(cryptonote::tx_extra_merge_mining_tag) == fields[n].type()) std::cout << "extra merge mining tag: depth " << boost::get<cryptonote::tx_extra_merge_mining_tag>(fields[n]).depth << ", merkle root " << boost::get<cryptonote::tx_extra_merge_mining_tag>(fields[n]).merkle_root;
+ else if (typeid(cryptonote::tx_extra_mysterious_minergate) == fields[n].type()) std::cout << "extra minergate custom: " << epee::string_tools::buff_to_hex_nodelimer(boost::get<cryptonote::tx_extra_mysterious_minergate>(fields[n]).data);
else std::cout << "unknown";
std::cout << std::endl;
}
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt
index 2289704e5..9afbe4b82 100644
--- a/src/common/CMakeLists.txt
+++ b/src/common/CMakeLists.txt
@@ -31,7 +31,8 @@ set(common_sources
command_line.cpp
dns_utils.cpp
util.cpp
- i18n.cpp)
+ i18n.cpp
+ stack_trace.cpp)
set(common_headers)
@@ -48,7 +49,8 @@ set(common_private_headers
unordered_containers_boost_serialization.h
util.h
varint.h
- i18n.h)
+ i18n.h
+ stack_trace.h)
bitmonero_private_headers(common
${common_private_headers})
@@ -60,6 +62,7 @@ target_link_libraries(common
LINK_PRIVATE
crypto
${UNBOUND_LIBRARY}
+ ${LIBUNWIND_LIBRARIES}
${Boost_DATE_TIME_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
${Boost_SYSTEM_LIBRARY}
diff --git a/src/common/stack_trace.cpp b/src/common/stack_trace.cpp
new file mode 100644
index 000000000..2805e7604
--- /dev/null
+++ b/src/common/stack_trace.cpp
@@ -0,0 +1,120 @@
+// Copyright (c) 2016, The Monero Project
+//
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without modification, are
+// permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this list of
+// conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice, this list
+// of conditions and the following disclaimer in the documentation and/or other
+// materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its contributors may be
+// used to endorse or promote products derived from this software without specific
+// prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include "common/stack_trace.h"
+#include "misc_log_ex.h"
+#ifdef HAVE_LIBUNWIND
+#define UNW_LOCAL_ONLY
+#include <libunwind.h>
+#endif
+#include <cxxabi.h>
+#include <dlfcn.h>
+
+// from http://stackoverflow.com/questions/11665829/how-can-i-print-stack-trace-for-caught-exceptions-in-c-code-injection-in-c
+#ifdef STATICLIB
+#define CXA_THROW __wrap___cxa_throw
+extern "C" void __real___cxa_throw(void *ex, void *info, void (*dest)(void*));
+#else
+#define CXA_THROW __cxa_throw
+#endif
+
+extern "C" void CXA_THROW(void *ex, void *info, void (*dest)(void*))
+{
+
+ int status;
+ char *dsym = abi::__cxa_demangle(((const std::type_info*)info)->name(), NULL, NULL, &status);
+ tools::log_stack_trace((std::string("Exception: ")+((!status && dsym) ? dsym : (const char*)info)).c_str());
+ free(dsym);
+
+#ifdef STATICLIB
+ __real___cxa_throw(ex, info, dest);
+#else
+ static void (*const rethrow)(void*, void*, void(*)(void*)) __attribute__((noreturn)) = (void(*)(void*, void*, void(*)(void*)))dlsym(RTLD_NEXT, "__cxa_throw");
+ rethrow(ex, info, dest);
+#endif
+}
+
+namespace
+{
+ std::string stack_trace_log;
+}
+
+namespace tools
+{
+
+void set_stack_trace_log(const std::string &log)
+{
+ stack_trace_log = log;
+}
+
+void log_stack_trace(const char *msg)
+{
+#ifdef HAVE_LIBUNWIND
+ unw_context_t ctx;
+ unw_cursor_t cur;
+ unw_word_t ip, off;
+ unsigned level;
+ char sym[512], *dsym;
+ int status;
+ const char *log = stack_trace_log.empty() ? NULL : stack_trace_log.c_str();
+
+ if (msg)
+ LOG_PRINT2(log, msg, LOG_LEVEL_0);
+ LOG_PRINT2(log, "Unwinded call stack:", LOG_LEVEL_0);
+ if (unw_getcontext(&ctx) < 0) {
+ LOG_PRINT2(log, "Failed to create unwind context", LOG_LEVEL_0);
+ return;
+ }
+ if (unw_init_local(&cur, &ctx) < 0) {
+ LOG_PRINT2(log, "Failed to find the first unwind frame", LOG_LEVEL_0);
+ return;
+ }
+ for (level = 1; level < 999; ++level) { // 999 for safety
+ int ret = unw_step(&cur);
+ if (ret < 0) {
+ LOG_PRINT2(log, "Failed to find the next frame", LOG_LEVEL_0);
+ return;
+ }
+ if (ret == 0)
+ break;
+ if (unw_get_reg(&cur, UNW_REG_IP, &ip) < 0) {
+ LOG_PRINT2(log, " " << std::setw(4) << level, LOG_LEVEL_0);
+ continue;
+ }
+ if (unw_get_proc_name(&cur, sym, sizeof(sym), &off) < 0) {
+ LOG_PRINT2(log, " " << std::setw(4) << level << std::setbase(16) << std::setw(20) << "0x" << ip, LOG_LEVEL_0);
+ continue;
+ }
+ dsym = abi::__cxa_demangle(sym, NULL, NULL, &status);
+ LOG_PRINT2(log, " " << std::setw(4) << level << std::setbase(16) << std::setw(20) << "0x" << ip << " " << (!status && dsym ? dsym : sym) << " + " << "0x" << off, LOG_LEVEL_0);
+ free(dsym);
+ }
+#endif
+}
+
+} // namespace tools
diff --git a/src/common/stack_trace.h b/src/common/stack_trace.h
new file mode 100644
index 000000000..25eec9fb3
--- /dev/null
+++ b/src/common/stack_trace.h
@@ -0,0 +1,43 @@
+// Copyright (c) 2016, The Monero Project
+//
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without modification, are
+// permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this list of
+// conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice, this list
+// of conditions and the following disclaimer in the documentation and/or other
+// materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its contributors may be
+// used to endorse or promote products derived from this software without specific
+// prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#ifndef MONERO_EXCEPTION_H
+#define MONERO_EXCEPTION_H
+
+#include <stdexcept>
+#include <string>
+
+namespace tools
+{
+
+void set_stack_trace_log(const std::string &log);
+void log_stack_trace(const char *msg);
+
+} // namespace tools
+
+#endif
diff --git a/src/crypto/crypto.cpp b/src/crypto/crypto.cpp
index e251d0ec2..f5e655274 100644
--- a/src/crypto/crypto.cpp
+++ b/src/crypto/crypto.cpp
@@ -263,16 +263,17 @@ namespace crypto {
PUSH_WARNINGS
DISABLE_VS_WARNINGS(4200)
+ struct ec_point_pair {
+ ec_point a, b;
+ };
struct rs_comm {
hash h;
- struct {
- ec_point a, b;
- } ab[];
+ struct ec_point_pair ab[];
};
POP_WARNINGS
static inline size_t rs_comm_size(size_t pubs_count) {
- return sizeof(rs_comm) + pubs_count * sizeof(rs_comm().ab[0]);
+ return sizeof(rs_comm) + pubs_count * sizeof(ec_point_pair);
}
void crypto_ops::generate_ring_signature(const hash &prefix_hash, const key_image &image,
diff --git a/src/crypto/oaes_lib.c b/src/crypto/oaes_lib.c
index 7fbe96e4c..4c1446898 100644
--- a/src/crypto/oaes_lib.c
+++ b/src/crypto/oaes_lib.c
@@ -27,10 +27,6 @@
* POSSIBILITY OF SUCH DAMAGE.
* ---------------------------------------------------------------------------
*/
-static const char _NR[] = {
- 0x4e,0x61,0x62,0x69,0x6c,0x20,0x53,0x2e,0x20,
- 0x41,0x6c,0x20,0x52,0x61,0x6d,0x6c,0x69,0x00 };
-
#include <stddef.h>
#include <time.h>
#include <string.h>
diff --git a/src/crypto/slow-hash.c b/src/crypto/slow-hash.c
index 6e03be4d4..8a1807657 100644
--- a/src/crypto/slow-hash.c
+++ b/src/crypto/slow-hash.c
@@ -658,10 +658,6 @@ void slow_hash_free_state(void)
return;
}
-static void (*const extra_hashes[4])(const void *, size_t, char *) = {
- hash_extra_blake, hash_extra_groestl, hash_extra_jh, hash_extra_skein
-};
-
#define MEMORY (1 << 21) /* 2 MiB */
#define ITER (1 << 20)
#define AES_BLOCK_SIZE 16
@@ -827,7 +823,7 @@ void cn_slow_hash(const void *data, size_t length, char *hash)
{
for(j = 0; j < INIT_SIZE_BLK; j++)
aesb_pseudo_round(&text[AES_BLOCK_SIZE * j], &text[AES_BLOCK_SIZE * j], expandedKey);
- memcpy(&long_state[i * INIT_SIZE_BYTE], text, INIT_SIZE_BYTE);
+ memcpy(&long_state[i * INIT_SIZE_BYTE], text, INIT_SIZE_BYTE);
}
U64(a)[0] = U64(&state.k[0])[0] ^ U64(&state.k[32])[0];
diff --git a/src/cryptonote_core/tx_extra.h b/src/cryptonote_core/tx_extra.h
index 93d2e21b3..6f5fbe466 100644
--- a/src/cryptonote_core/tx_extra.h
+++ b/src/cryptonote_core/tx_extra.h
@@ -38,6 +38,7 @@
#define TX_EXTRA_TAG_PUBKEY 0x01
#define TX_EXTRA_NONCE 0x02
#define TX_EXTRA_MERGE_MINING_TAG 0x03
+#define TX_EXTRA_MYSTERIOUS_MINERGATE_TAG 0xDE
#define TX_EXTRA_NONCE_PAYMENT_ID 0x00
#define TX_EXTRA_NONCE_ENCRYPTED_PAYMENT_ID 0x01
@@ -158,14 +159,24 @@ namespace cryptonote
}
};
+ struct tx_extra_mysterious_minergate
+ {
+ std::string data;
+
+ BEGIN_SERIALIZE()
+ FIELD(data)
+ END_SERIALIZE()
+ };
+
// tx_extra_field format, except tx_extra_padding and tx_extra_pub_key:
// varint tag;
// varint size;
// varint data[];
- typedef boost::variant<tx_extra_padding, tx_extra_pub_key, tx_extra_nonce, tx_extra_merge_mining_tag> tx_extra_field;
+ typedef boost::variant<tx_extra_padding, tx_extra_pub_key, tx_extra_nonce, tx_extra_merge_mining_tag, tx_extra_mysterious_minergate> tx_extra_field;
}
VARIANT_TAG(binary_archive, cryptonote::tx_extra_padding, TX_EXTRA_TAG_PADDING);
VARIANT_TAG(binary_archive, cryptonote::tx_extra_pub_key, TX_EXTRA_TAG_PUBKEY);
VARIANT_TAG(binary_archive, cryptonote::tx_extra_nonce, TX_EXTRA_NONCE);
VARIANT_TAG(binary_archive, cryptonote::tx_extra_merge_mining_tag, TX_EXTRA_MERGE_MINING_TAG);
+VARIANT_TAG(binary_archive, cryptonote::tx_extra_mysterious_minergate, TX_EXTRA_MYSTERIOUS_MINERGATE_TAG);
diff --git a/src/daemon/main.cpp b/src/daemon/main.cpp
index bfd829dea..2e2f8936c 100644
--- a/src/daemon/main.cpp
+++ b/src/daemon/main.cpp
@@ -31,6 +31,7 @@
#include "common/command_line.h"
#include "common/scoped_message_writer.h"
#include "common/util.h"
+#include "common/stack_trace.h"
#include "cryptonote_core/cryptonote_core.h"
#include "cryptonote_core/miner.h"
#include "daemon/command_server.h"
@@ -259,6 +260,7 @@ int main(int argc, char const * argv[])
, log_file_path.filename().string().c_str()
, log_file_path.parent_path().string().c_str()
);
+ tools::set_stack_trace_log(log_file_path.filename().string());
}
if (command_line::has_arg(vm, daemon_args::arg_max_concurrency))
diff --git a/src/p2p/connection_basic.cpp b/src/p2p/connection_basic.cpp
index c0b73bc3e..981a02882 100644
--- a/src/p2p/connection_basic.cpp
+++ b/src/p2p/connection_basic.cpp
@@ -161,16 +161,16 @@ connection_basic::connection_basic(boost::asio::io_service& io_service, std::ato
mI->m_peer_number = sock_number.fetch_add(1); // use, and increase the generated number
string remote_addr_str = "?";
- try { remote_addr_str = socket_.remote_endpoint().address().to_string(); } catch(...){} ;
+ try { boost::system::error_code e; remote_addr_str = socket_.remote_endpoint(e).address().to_string(); } catch(...){} ;
_note("Spawned connection p2p#"<<mI->m_peer_number<<" to " << remote_addr_str << " currently we have sockets count:" << m_ref_sock_count);
//boost::filesystem::create_directories("log/dr-monero/net/");
}
-connection_basic::~connection_basic() {
+connection_basic::~connection_basic() noexcept(false) {
string remote_addr_str = "?";
m_ref_sock_count--;
- try { remote_addr_str = socket_.remote_endpoint().address().to_string(); } catch(...){} ;
+ try { boost::system::error_code e; remote_addr_str = socket_.remote_endpoint(e).address().to_string(); } catch(...){} ;
_note("Destructing connection p2p#"<<mI->m_peer_number << " to " << remote_addr_str);
}
diff --git a/src/p2p/connection_basic.hpp b/src/p2p/connection_basic.hpp
index 8be798735..5452fa6fb 100644
--- a/src/p2p/connection_basic.hpp
+++ b/src/p2p/connection_basic.hpp
@@ -103,7 +103,7 @@ class connection_basic { // not-templated base class for rapid developmet of som
// first counter is the ++/-- count of current sockets, the other socket_number is only-increasing ++ number generator
connection_basic(boost::asio::io_service& io_service, std::atomic<long> &ref_sock_count, std::atomic<long> &sock_number);
- virtual ~connection_basic();
+ virtual ~connection_basic() noexcept(false);
// various handlers to be called from connection class:
void do_send_handler_write(const void * ptr , size_t cb);
diff --git a/src/p2p/data_logger.cpp b/src/p2p/data_logger.cpp
index ca0726c5f..fe54aef63 100644
--- a/src/p2p/data_logger.cpp
+++ b/src/p2p/data_logger.cpp
@@ -103,7 +103,7 @@ namespace net_utils
_info_c("dbg/data","Data logger constructed");
}
- data_logger::~data_logger() {
+ data_logger::~data_logger() noexcept(false) {
_note_c("dbg/data","Destructor of the data logger");
{
boost::lock_guard<boost::mutex> lock(mMutex);
diff --git a/src/p2p/data_logger.hpp b/src/p2p/data_logger.hpp
index 148afc0ab..278d08bfc 100644
--- a/src/p2p/data_logger.hpp
+++ b/src/p2p/data_logger.hpp
@@ -55,7 +55,7 @@ enum class data_logger_state { state_before_init, state_during_init, state_ready
public:
static data_logger &get_instance(); ///< singleton
static void kill_instance(); ///< call this before ending main to allow more gracefull shutdown of the main singleton and it's background thread
- ~data_logger(); ///< destr, will be called when singleton is killed when global m_obj dies. will kill theads etc
+ ~data_logger() noexcept(false); ///< destr, will be called when singleton is killed when global m_obj dies. will kill theads etc
private:
data_logger(); ///< constructor is private, use only via singleton get_instance
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp
index 9e8d1108e..cfe1057ac 100644
--- a/src/rpc/core_rpc_server.cpp
+++ b/src/rpc/core_rpc_server.cpp
@@ -930,7 +930,7 @@ namespace cryptonote
{
res.tx_hashes.push_back(epee::string_tools::pod_to_hex(blk.tx_hashes[n]));
}
- res.blob = t_serializable_object_to_blob(blk);
+ res.blob = string_tools::buff_to_hex_nodelimer(t_serializable_object_to_blob(blk));
res.json = obj_to_json_str(blk);
res.status = CORE_RPC_STATUS_OK;
return true;
diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp
index a082f731b..5be9ae5b0 100644
--- a/src/wallet/wallet_rpc_server.cpp
+++ b/src/wallet/wallet_rpc_server.cpp
@@ -245,9 +245,9 @@ namespace tools
m_wallet.commit_tx(ptx_vector);
// populate response with tx hash
- res.tx_hash = boost::lexical_cast<std::string>(cryptonote::get_transaction_hash(ptx_vector.back().tx));
+ res.tx_hash = epee::string_tools::pod_to_hex(cryptonote::get_transaction_hash(ptx_vector.back().tx));
if (req.get_tx_key)
- res.tx_key = boost::lexical_cast<std::string>(ptx_vector.back().tx_key);
+ res.tx_key = epee::string_tools::pod_to_hex(ptx_vector.back().tx_key);
return true;
}
catch (const tools::error::daemon_busy& e)
@@ -308,9 +308,9 @@ namespace tools
// populate response with tx hashes
for (auto & ptx : ptx_vector)
{
- res.tx_hash_list.push_back(boost::lexical_cast<std::string>(cryptonote::get_transaction_hash(ptx.tx)));
+ res.tx_hash_list.push_back(epee::string_tools::pod_to_hex(cryptonote::get_transaction_hash(ptx.tx)));
if (req.get_tx_keys)
- res.tx_key_list.push_back(boost::lexical_cast<std::string>(ptx.tx_key));
+ res.tx_key_list.push_back(epee::string_tools::pod_to_hex(ptx.tx_key));
}
return true;
@@ -354,9 +354,9 @@ namespace tools
// populate response with tx hashes
for (auto & ptx : ptx_vector)
{
- res.tx_hash_list.push_back(boost::lexical_cast<std::string>(cryptonote::get_transaction_hash(ptx.tx)));
+ res.tx_hash_list.push_back(epee::string_tools::pod_to_hex(cryptonote::get_transaction_hash(ptx.tx)));
if (req.get_tx_keys)
- res.tx_key_list.push_back(boost::lexical_cast<std::string>(ptx.tx_key));
+ res.tx_key_list.push_back(epee::string_tools::pod_to_hex(ptx.tx_key));
}
return true;
@@ -413,9 +413,9 @@ namespace tools
// populate response with tx hashes
for (auto & ptx : ptx_vector)
{
- res.tx_hash_list.push_back(boost::lexical_cast<std::string>(cryptonote::get_transaction_hash(ptx.tx)));
+ res.tx_hash_list.push_back(epee::string_tools::pod_to_hex(cryptonote::get_transaction_hash(ptx.tx)));
if (req.get_tx_keys)
- res.tx_key_list.push_back(boost::lexical_cast<std::string>(ptx.tx_key));
+ res.tx_key_list.push_back(epee::string_tools::pod_to_hex(ptx.tx_key));
}
return true;
@@ -493,7 +493,7 @@ namespace tools
return false;
}
res.standard_address = get_account_address_as_str(m_wallet.testnet(),address);
- res.payment_id = boost::lexical_cast<std::string>(payment_id);
+ res.payment_id = epee::string_tools::pod_to_hex(payment_id);
return true;
}
catch (std::exception &e)
@@ -686,7 +686,7 @@ namespace tools
rpc_transfers.amount = td.amount();
rpc_transfers.spent = td.m_spent;
rpc_transfers.global_index = td.m_global_output_index;
- rpc_transfers.tx_hash = boost::lexical_cast<std::string>(cryptonote::get_transaction_hash(td.m_tx));
+ rpc_transfers.tx_hash = epee::string_tools::pod_to_hex(cryptonote::get_transaction_hash(td.m_tx));
rpc_transfers.tx_size = txBlob.size();
res.transfers.push_back(rpc_transfers);
}