Merge branch 'rebase-v0.18.3.3' of https://github.com/somerandomcryptoguy/salvium into rebase-v0.18.3.3
This commit is contained in:
@@ -36,6 +36,7 @@
|
|||||||
#include "warnings.h"
|
#include "warnings.h"
|
||||||
#include "misc_log_ex.h"
|
#include "misc_log_ex.h"
|
||||||
|
|
||||||
|
#include <boost/numeric/conversion/bounds.hpp>
|
||||||
#include <boost/lexical_cast.hpp>
|
#include <boost/lexical_cast.hpp>
|
||||||
#include <typeinfo>
|
#include <typeinfo>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
|||||||
@@ -110,7 +110,8 @@ namespace tools
|
|||||||
catch(...)
|
catch(...)
|
||||||
{
|
{
|
||||||
// if failed, try reading in unportable mode
|
// if failed, try reading in unportable mode
|
||||||
boost::filesystem::copy_file(file_path, file_path + ".unportable", boost::filesystem::copy_option::overwrite_if_exists);
|
//boost::filesystem::copy_file(file_path, file_path + ".unportable", boost::filesystem::copy_option::overwrite_if_exists);
|
||||||
|
tools::copy_file(file_path, file_path + ".unportable");
|
||||||
data_file.close();
|
data_file.close();
|
||||||
data_file.open( file_path, std::ios_base::binary | std::ios_base::in);
|
data_file.open( file_path, std::ios_base::binary | std::ios_base::in);
|
||||||
if(data_file.fail())
|
if(data_file.fail())
|
||||||
|
|||||||
@@ -115,6 +115,24 @@ static int flock_exnb(int fd)
|
|||||||
|
|
||||||
namespace tools
|
namespace tools
|
||||||
{
|
{
|
||||||
|
|
||||||
|
void copy_file(const std::string& from, const std::string& to)
|
||||||
|
{
|
||||||
|
using boost::filesystem::path;
|
||||||
|
#if BOOST_VERSION < 107400
|
||||||
|
// Remove this preprocessor if/else when we are bumping the boost version.
|
||||||
|
boost::filesystem::copy_file(
|
||||||
|
path(from),
|
||||||
|
path(to),
|
||||||
|
boost::filesystem::copy_option::overwrite_if_exists);
|
||||||
|
#else
|
||||||
|
boost::filesystem::copy_file(
|
||||||
|
path(from),
|
||||||
|
path(to),
|
||||||
|
boost::filesystem::copy_options::overwrite_existing);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
std::function<void(int)> signal_handler::m_handler;
|
std::function<void(int)> signal_handler::m_handler;
|
||||||
|
|
||||||
private_file::private_file() noexcept : m_handle(), m_filename() {}
|
private_file::private_file() noexcept : m_handle(), m_filename() {}
|
||||||
|
|||||||
@@ -67,6 +67,8 @@ namespace tools
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void copy_file(const std::string& from, const std::string& to);
|
||||||
|
|
||||||
//! A file restricted to process owner AND process. Deletes file on destruction.
|
//! A file restricted to process owner AND process. Deletes file on destruction.
|
||||||
class private_file {
|
class private_file {
|
||||||
std::unique_ptr<std::FILE, close_file> m_handle;
|
std::unique_ptr<std::FILE, close_file> m_handle;
|
||||||
|
|||||||
@@ -42,7 +42,7 @@
|
|||||||
#include <boost/serialization/version.hpp>
|
#include <boost/serialization/version.hpp>
|
||||||
|
|
||||||
#include "net_peerlist_boost_serialization.h"
|
#include "net_peerlist_boost_serialization.h"
|
||||||
|
#include "common/util.h"
|
||||||
|
|
||||||
namespace nodetool
|
namespace nodetool
|
||||||
{
|
{
|
||||||
@@ -200,7 +200,8 @@ namespace nodetool
|
|||||||
if (!out)
|
if (!out)
|
||||||
{
|
{
|
||||||
// if failed, try reading in unportable mode
|
// if failed, try reading in unportable mode
|
||||||
boost::filesystem::copy_file(path, path + ".unportable", boost::filesystem::copy_option::overwrite_if_exists);
|
//boost::filesystem::copy_file(path, path + ".unportable", boost::filesystem::copy_option::overwrite_if_exists);
|
||||||
|
tools::copy_file(path, path + ".unportable");
|
||||||
src_file.close();
|
src_file.close();
|
||||||
src_file.open( path , std::ios_base::binary | std::ios_base::in);
|
src_file.open( path , std::ios_base::binary | std::ios_base::in);
|
||||||
if(src_file.fail())
|
if(src_file.fail())
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
#define DEF_SALVIUM_VERSION_TAG "7f6b8da"
|
#define DEF_SALVIUM_VERSION_TAG "7f6b8da"
|
||||||
#define DEF_SALVIUM_VERSION "0.2.0"
|
#define DEF_SALVIUM_VERSION "0.2.1"
|
||||||
#define DEF_MONERO_VERSION_TAG "@VERSIONTAG@"
|
#define DEF_MONERO_VERSION_TAG "@VERSIONTAG@"
|
||||||
#define DEF_MONERO_VERSION "0.18.3.3"
|
#define DEF_MONERO_VERSION "0.18.3.3"
|
||||||
#define DEF_MONERO_RELEASE_NAME "Zero"
|
#define DEF_MONERO_RELEASE_NAME "Zero"
|
||||||
|
|||||||
@@ -6432,8 +6432,9 @@ void wallet2::load(const std::string& wallet_, const epee::wipeable_string& pass
|
|||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
LOG_PRINT_L0("Failed to open portable binary, trying unportable");
|
LOG_PRINT_L0("Failed to open portable binary, trying unportable");
|
||||||
if (use_fs) boost::filesystem::copy_file(m_wallet_file, m_wallet_file + ".unportable", boost::filesystem::copy_option::overwrite_if_exists);
|
//if (use_fs) boost::filesystem::copy_file(m_wallet_file, m_wallet_file + ".unportable", boost::filesystem::copy_option::overwrite_if_exists);
|
||||||
std::stringstream iss;
|
if (use_fs) tools::copy_file(m_wallet_file, m_wallet_file + ".unportable");
|
||||||
|
std::stringstream iss;
|
||||||
iss.str("");
|
iss.str("");
|
||||||
iss << cache_data;
|
iss << cache_data;
|
||||||
boost::archive::binary_iarchive ar(iss);
|
boost::archive::binary_iarchive ar(iss);
|
||||||
@@ -6454,7 +6455,8 @@ void wallet2::load(const std::string& wallet_, const epee::wipeable_string& pass
|
|||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
LOG_PRINT_L0("Failed to open portable binary, trying unportable");
|
LOG_PRINT_L0("Failed to open portable binary, trying unportable");
|
||||||
if (use_fs) boost::filesystem::copy_file(m_wallet_file, m_wallet_file + ".unportable", boost::filesystem::copy_option::overwrite_if_exists);
|
//if (use_fs) boost::filesystem::copy_file(m_wallet_file, m_wallet_file + ".unportable", boost::filesystem::copy_option::overwrite_if_exists);
|
||||||
|
if (use_fs) tools::copy_file(m_wallet_file, m_wallet_file + ".unportable");
|
||||||
std::stringstream iss;
|
std::stringstream iss;
|
||||||
iss.str("");
|
iss.str("");
|
||||||
iss << cache_file_buf;
|
iss << cache_file_buf;
|
||||||
|
|||||||
Reference in New Issue
Block a user