From 0e087cf7423745278250c1db9badad5dd7206b8f Mon Sep 17 00:00:00 2001 From: D4708 <76843085+D4708@users.noreply.github.com> Date: Wed, 7 Jul 2021 15:53:09 +0300 Subject: [PATCH 1/3] update distributive versions --- doc/building-on-ubuntu-debian.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/building-on-ubuntu-debian.md b/doc/building-on-ubuntu-debian.md index bcfb54c6..5be17f81 100644 --- a/doc/building-on-ubuntu-debian.md +++ b/doc/building-on-ubuntu-debian.md @@ -1,7 +1,8 @@ # Ubuntu / Debian building instructions Tested on a pristine: - - Ubuntu 13.10 amd64 + - Ubuntu 20.04 amd64 + - Ubuntu 20.04 arm ## Install From 9584caf124320fd185ec36fa5ffc95cc7891260e Mon Sep 17 00:00:00 2001 From: ghost Date: Sun, 2 Jan 2022 03:08:25 +0200 Subject: [PATCH 2/3] add seed.twisterarmy.org --- src/chainparams.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index ae841807..3d7556af 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -223,7 +223,8 @@ public: vSeeds.push_back(CDNSSeedData("cruller.tasty.sexy", "cruller.tasty.sexy")); vSeeds.push_back(CDNSSeedData("twister-seeder.muh.freedu.ms", "twister-seeder.muh.freedu.ms")); vSeeds.push_back(CDNSSeedData("twisterarmyseed.tk", "twisterarmyseed.tk")); - + vSeeds.push_back(CDNSSeedData("twisterarmy.org", "seed.twisterarmy.org")); + base58Prefixes[PUBKEY_ADDRESS] = 0; base58Prefixes[SCRIPT_ADDRESS] = 5; base58Prefixes[SECRET_KEY] = 128; From db25042269b0119410847d16af06858b87d5a42b Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sat, 4 Jun 2022 12:43:40 +0000 Subject: [PATCH 3/3] Fix compilation errors. --- libtorrent/include/libtorrent/alert.hpp | 8 +++---- .../include/libtorrent/alert_manager.hpp | 8 +++---- libtorrent/include/libtorrent/alert_types.hpp | 4 ++-- .../include/libtorrent/aux_/session_impl.hpp | 4 ++-- libtorrent/include/libtorrent/session.hpp | 4 ++-- libtorrent/src/alert_manager.cpp | 24 +++++++++---------- libtorrent/src/session.cpp | 4 ++-- libtorrent/src/session_impl.cpp | 6 ++--- libtorrent/src/torrent_info.cpp | 2 +- libtorrent/test/setup_transfer.cpp | 6 ++--- libtorrent/test/setup_transfer.hpp | 2 +- src/bitcoinrpc.cpp | 14 +++++------ src/db.cpp | 6 ++--- src/init.cpp | 24 +++++++++---------- src/key.cpp | 2 +- src/leveldb.cpp | 4 ++-- src/leveldb.h | 14 +++++------ src/main.cpp | 6 ++--- src/main.h | 2 +- src/twister.cpp | 6 ++--- src/walletdb.cpp | 12 +++++----- 21 files changed, 81 insertions(+), 81 deletions(-) diff --git a/libtorrent/include/libtorrent/alert.hpp b/libtorrent/include/libtorrent/alert.hpp index 0d1f6a13..d26c536d 100644 --- a/libtorrent/include/libtorrent/alert.hpp +++ b/libtorrent/include/libtorrent/alert.hpp @@ -113,7 +113,7 @@ namespace libtorrent { severity_t severity() const TORRENT_DEPRECATED { return warning; } #endif - virtual std::auto_ptr clone() const = 0; + virtual std::unique_ptr clone() const = 0; private: ptime m_timestamp; @@ -133,7 +133,7 @@ namespace libtorrent { template void handle_alert_dispatch( - const std::auto_ptr& alert_, const Handler& handler + const std::unique_ptr& alert_, const Handler& handler , const std::type_info& typeid_ , T0*, BOOST_PP_ENUM_SHIFTED_BINARY_PARAMS(TORRENT_MAX_ALERT_TYPES, T, *p)) { @@ -147,7 +147,7 @@ namespace libtorrent { template void handle_alert_dispatch( - const std::auto_ptr& + const std::unique_ptr& , const Handler& , const std::type_info& , BOOST_PP_ENUM_PARAMS(TORRENT_MAX_ALERT_TYPES, void_* BOOST_PP_INTERCEPT)) @@ -162,7 +162,7 @@ namespace libtorrent { struct TORRENT_EXPORT handle_alert { template - handle_alert(const std::auto_ptr& alert_ + handle_alert(const std::unique_ptr& alert_ , const Handler& handler) { #define ALERT_POINTER_TYPE(z, n, text) (BOOST_PP_CAT(T, n)*)0 diff --git a/libtorrent/include/libtorrent/alert_manager.hpp b/libtorrent/include/libtorrent/alert_manager.hpp index 589641af..6bebb433 100644 --- a/libtorrent/include/libtorrent/alert_manager.hpp +++ b/libtorrent/include/libtorrent/alert_manager.hpp @@ -57,7 +57,7 @@ namespace libtorrent { void post_alert(const alert& alert_); void post_alert_ptr(alert* alert_); bool pending() const; - std::auto_ptr get(); + std::unique_ptr get(); void get_all(std::deque* alerts); template @@ -86,21 +86,21 @@ namespace libtorrent { size_t alert_queue_size_limit() const { return m_queue_size_limit; } size_t set_alert_queue_size_limit(size_t queue_size_limit_); - void set_dispatch_function(boost::function)> const&); + void set_dispatch_function(std::function&&)> const&); #ifndef TORRENT_DISABLE_EXTENSIONS void add_extension(boost::shared_ptr ext); #endif private: - void post_impl(std::auto_ptr& alert_, mutex::scoped_lock& l); + void post_impl(std::unique_ptr&& alert_, mutex::scoped_lock& l); std::deque m_alerts; mutable mutex m_mutex; condition_variable m_condition; boost::uint32_t m_alert_mask; size_t m_queue_size_limit; - boost::function)> m_dispatch; + std::function&&)> m_dispatch; #ifndef TORRENT_DISABLE_EXTENSIONS typedef std::list > ses_extension_list_t; diff --git a/libtorrent/include/libtorrent/alert_types.hpp b/libtorrent/include/libtorrent/alert_types.hpp index 6e967178..a80a7c55 100644 --- a/libtorrent/include/libtorrent/alert_types.hpp +++ b/libtorrent/include/libtorrent/alert_types.hpp @@ -106,8 +106,8 @@ namespace libtorrent #define TORRENT_DEFINE_ALERT(name) \ const static int alert_type = __LINE__; \ virtual int type() const { return alert_type; } \ - virtual std::auto_ptr clone() const \ - { return std::auto_ptr(new name(*this)); } \ + virtual std::unique_ptr clone() const \ + { return std::unique_ptr(new name(*this)); } \ virtual int category() const { return static_category; } \ virtual char const* what() const { return #name; } diff --git a/libtorrent/include/libtorrent/aux_/session_impl.hpp b/libtorrent/include/libtorrent/aux_/session_impl.hpp index 1b414b0c..158965e9 100644 --- a/libtorrent/include/libtorrent/aux_/session_impl.hpp +++ b/libtorrent/include/libtorrent/aux_/session_impl.hpp @@ -380,9 +380,9 @@ namespace libtorrent void set_alert_mask(boost::uint32_t m); size_t set_alert_queue_size_limit(size_t queue_size_limit_); - std::auto_ptr pop_alert(); + std::unique_ptr pop_alert(); void pop_alerts(std::deque* alerts); - void set_alert_dispatch(boost::function)> const&); + void set_alert_dispatch(boost::function)> const&); void post_alert(const alert& alert_); alert const* wait_for_alert(time_duration max_wait); diff --git a/libtorrent/include/libtorrent/session.hpp b/libtorrent/include/libtorrent/session.hpp index 666c8010..87dda4ce 100644 --- a/libtorrent/include/libtorrent/session.hpp +++ b/libtorrent/include/libtorrent/session.hpp @@ -796,7 +796,7 @@ namespace libtorrent // // ``save_resume_data_alert`` and ``save_resume_data_failed_alert`` are always posted, regardelss // of the alert mask. - std::auto_ptr pop_alert(); + std::unique_ptr pop_alert(); void pop_alerts(std::deque* alerts); alert const* wait_for_alert(time_duration max_wait); @@ -821,7 +821,7 @@ namespace libtorrent // The main intention with this function is to support integration with platform-dependent message // queues or signalling systems. For instance, on windows, one could post a message to an HNWD or // on linux, write to a pipe or an eventfd. - void set_alert_dispatch(boost::function)> const& fun); + void set_alert_dispatch(boost::function)> const& fun); connection_queue& get_connection_queue(); diff --git a/libtorrent/src/alert_manager.cpp b/libtorrent/src/alert_manager.cpp index c9ab704a..79c59caf 100644 --- a/libtorrent/src/alert_manager.cpp +++ b/libtorrent/src/alert_manager.cpp @@ -72,7 +72,7 @@ namespace libtorrent return NULL; } - void alert_manager::set_dispatch_function(boost::function)> const& fun) + void alert_manager::set_dispatch_function(std::function&&)> const& fun) { mutex::scoped_lock lock(m_mutex); @@ -85,7 +85,7 @@ namespace libtorrent while (!alerts.empty()) { TORRENT_TRY { - m_dispatch(std::auto_ptr(alerts.front())); + m_dispatch(std::unique_ptr(alerts.front())); } TORRENT_CATCH(std::exception&) {} alerts.pop_front(); } @@ -94,13 +94,13 @@ namespace libtorrent void dispatch_alert(boost::function dispatcher , alert* alert_) { - std::auto_ptr holder(alert_); + std::unique_ptr holder(alert_); dispatcher(*alert_); } void alert_manager::post_alert_ptr(alert* alert_) { - std::auto_ptr a(alert_); + std::unique_ptr a(alert_); #ifndef TORRENT_DISABLE_EXTENSIONS for (ses_extension_list_t::iterator i = m_ses_extensions.begin() @@ -113,12 +113,12 @@ namespace libtorrent #endif mutex::scoped_lock lock(m_mutex); - post_impl(a, lock); + post_impl(std::move(a), lock); } void alert_manager::post_alert(const alert& alert_) { - std::auto_ptr a(alert_.clone()); + std::unique_ptr a(alert_.clone()); #ifndef TORRENT_DISABLE_EXTENSIONS for (ses_extension_list_t::iterator i = m_ses_extensions.begin() @@ -131,16 +131,16 @@ namespace libtorrent #endif mutex::scoped_lock lock(m_mutex); - post_impl(a, lock); + post_impl(std::move(a), lock); } - void alert_manager::post_impl(std::auto_ptr& alert_, mutex::scoped_lock& l) + void alert_manager::post_impl(std::unique_ptr&& alert_, mutex::scoped_lock& l) { if (m_dispatch) { TORRENT_ASSERT(m_alerts.empty()); TORRENT_TRY { - m_dispatch(alert_); + m_dispatch(std::move(alert_)); } TORRENT_CATCH(std::exception&) {} } else if (m_alerts.size() < m_queue_size_limit || !alert_->discardable()) @@ -158,16 +158,16 @@ namespace libtorrent } #endif - std::auto_ptr alert_manager::get() + std::unique_ptr alert_manager::get() { mutex::scoped_lock lock(m_mutex); if (m_alerts.empty()) - return std::auto_ptr(0); + return std::unique_ptr(nullptr); alert* result = m_alerts.front(); m_alerts.pop_front(); - return std::auto_ptr(result); + return std::unique_ptr(result); } void alert_manager::get_all(std::deque* alerts) diff --git a/libtorrent/src/session.cpp b/libtorrent/src/session.cpp index 9f65af70..a979d989 100644 --- a/libtorrent/src/session.cpp +++ b/libtorrent/src/session.cpp @@ -1096,12 +1096,12 @@ namespace libtorrent } #endif // TORRENT_NO_DEPRECATE - void session::set_alert_dispatch(boost::function)> const& fun) + void session::set_alert_dispatch(boost::function)> const& fun) { TORRENT_ASYNC_CALL1(set_alert_dispatch, fun); } - std::auto_ptr session::pop_alert() + std::unique_ptr session::pop_alert() { return m_impl->pop_alert(); } diff --git a/libtorrent/src/session_impl.cpp b/libtorrent/src/session_impl.cpp index 3412243b..d08b8fc7 100644 --- a/libtorrent/src/session_impl.cpp +++ b/libtorrent/src/session_impl.cpp @@ -5037,7 +5037,7 @@ retry: TORRENT_ASSERT(is_network_thread()); - std::auto_ptr alert(new state_update_alert()); + std::unique_ptr alert(new state_update_alert()); alert->status.reserve(m_state_updates.size()); #if defined TORRENT_DEBUG || TORRENT_RELEASE_ASSERTS @@ -6157,12 +6157,12 @@ retry: } } - void session_impl::set_alert_dispatch(boost::function)> const& fun) + void session_impl::set_alert_dispatch(boost::function)> const& fun) { m_alerts.set_dispatch_function(fun); } - std::auto_ptr session_impl::pop_alert() + std::unique_ptr session_impl::pop_alert() { return m_alerts.get(); } diff --git a/libtorrent/src/torrent_info.cpp b/libtorrent/src/torrent_info.cpp index 3d7137c9..d7178775 100644 --- a/libtorrent/src/torrent_info.cpp +++ b/libtorrent/src/torrent_info.cpp @@ -357,7 +357,7 @@ namespace libtorrent struct string_less_no_case { - bool operator()(std::string const& lhs, std::string const& rhs) + bool operator()(std::string const& lhs, std::string const& rhs) const { char c1, c2; char const* s1 = lhs.c_str(); diff --git a/libtorrent/test/setup_transfer.cpp b/libtorrent/test/setup_transfer.cpp index 7f70097d..4ed933f4 100644 --- a/libtorrent/test/setup_transfer.cpp +++ b/libtorrent/test/setup_transfer.cpp @@ -73,9 +73,9 @@ void report_failure(char const* err, char const* file, int line) tests_failure = true; } -std::auto_ptr wait_for_alert(session& ses, int type) +std::unique_ptr wait_for_alert(session& ses, int type) { - std::auto_ptr ret; + std::unique_ptr ret; while (!ret.get()) { ses.wait_for_alert(milliseconds(5000)); @@ -86,7 +86,7 @@ std::auto_ptr wait_for_alert(session& ses, int type) { if (!ret.get() && (*i)->type() == type) { - ret = std::auto_ptr(*i); + ret = std::unique_ptr(*i); } else delete *i; diff --git a/libtorrent/test/setup_transfer.hpp b/libtorrent/test/setup_transfer.hpp index 5e701a2d..92e3d463 100644 --- a/libtorrent/test/setup_transfer.hpp +++ b/libtorrent/test/setup_transfer.hpp @@ -50,7 +50,7 @@ int EXPORT load_file(std::string const& filename, std::vector& v, libtorre void EXPORT report_failure(char const* err, char const* file, int line); -std::auto_ptr EXPORT wait_for_alert(libtorrent::session& ses, int type); +std::unique_ptr EXPORT wait_for_alert(libtorrent::session& ses, int type); void EXPORT print_ses_rate(float time , libtorrent::torrent_status const* st1 diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp index 15b96d34..401a5629 100644 --- a/src/bitcoinrpc.cpp +++ b/src/bitcoinrpc.cpp @@ -954,14 +954,14 @@ void StartRPCThreads() { rpc_ssl_context->set_options(ssl::context::no_sslv2); - filesystem::path pathCertFile(GetArg("-rpcsslcertificatechainfile", "server.cert")); - if (!pathCertFile.is_complete()) pathCertFile = filesystem::path(GetDataDir()) / pathCertFile; - if (filesystem::exists(pathCertFile)) rpc_ssl_context->use_certificate_chain_file(pathCertFile.string()); + boost::filesystem::path pathCertFile(GetArg("-rpcsslcertificatechainfile", "server.cert")); + if (!pathCertFile.is_complete()) pathCertFile = boost::filesystem::path(GetDataDir()) / pathCertFile; + if (boost::filesystem::exists(pathCertFile)) rpc_ssl_context->use_certificate_chain_file(pathCertFile.string()); else printf("ThreadRPCServer ERROR: missing server certificate file %s\n", pathCertFile.string().c_str()); - filesystem::path pathPKFile(GetArg("-rpcsslprivatekeyfile", "server.pem")); - if (!pathPKFile.is_complete()) pathPKFile = filesystem::path(GetDataDir()) / pathPKFile; - if (filesystem::exists(pathPKFile)) rpc_ssl_context->use_private_key_file(pathPKFile.string(), ssl::context::pem); + boost::filesystem::path pathPKFile(GetArg("-rpcsslprivatekeyfile", "server.pem")); + if (!pathPKFile.is_complete()) pathPKFile = boost::filesystem::path(GetDataDir()) / pathPKFile; + if (boost::filesystem::exists(pathPKFile)) rpc_ssl_context->use_private_key_file(pathPKFile.string(), ssl::context::pem); else printf("ThreadRPCServer ERROR: missing server private key file %s\n", pathPKFile.string().c_str()); string strCiphers = GetArg("-rpcsslciphers", "TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH"); @@ -1182,7 +1182,7 @@ void ServiceConnection(AcceptedConnection *conn) strURI="/home.html"; if (strURI != "/" && strURI.substr(0, 4) != "/rss" && strURI.find("..") == std::string::npos ) { - filesystem::path pathFile = filesystem::path(GetHTMLDir()) / strURI; + boost::filesystem::path pathFile = boost::filesystem::path(GetHTMLDir()) / strURI; std::string fname = pathFile.string(); size_t qMarkIdx = fname.find('?'); if( qMarkIdx != string::npos ) { diff --git a/src/db.cpp b/src/db.cpp index 93f3f5d8..a5634a4f 100644 --- a/src/db.cpp +++ b/src/db.cpp @@ -68,9 +68,9 @@ bool CDBEnv::Open(const boost::filesystem::path& pathIn) boost::this_thread::interruption_point(); path = pathIn; - filesystem::path pathLogDir = path / "database"; - filesystem::create_directory(pathLogDir); - filesystem::path pathErrorFile = path / "db.log"; + boost::filesystem::path pathLogDir = path / "database"; + boost::filesystem::create_directory(pathLogDir); + boost::filesystem::path pathErrorFile = path / "db.log"; printf("dbenv.open LogDir=%s ErrorFile=%s\n", pathLogDir.string().c_str(), pathErrorFile.string().c_str()); unsigned int nEnvFlags = 0; diff --git a/src/init.cpp b/src/init.cpp index 5c188d68..7a6f33f3 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -313,12 +313,12 @@ void ThreadImport(std::vector vImportFiles) } // hardcoded $DATADIR/bootstrap.dat - filesystem::path pathBootstrap = GetDataDir() / "bootstrap.dat"; - if (filesystem::exists(pathBootstrap)) { + boost::filesystem::path pathBootstrap = GetDataDir() / "bootstrap.dat"; + if (boost::filesystem::exists(pathBootstrap)) { FILE *file = fopen(pathBootstrap.string().c_str(), "rb"); if (file) { CImportingNow imp; - filesystem::path pathBootstrapOld = GetDataDir() / "bootstrap.dat.old"; + boost::filesystem::path pathBootstrapOld = GetDataDir() / "bootstrap.dat.old"; printf("Importing bootstrap.dat...\n"); LoadExternalBlockFile(file); RenameOver(pathBootstrap, pathBootstrapOld); @@ -571,7 +571,7 @@ bool AppInit2(boost::thread_group& threadGroup) return false; } - if (filesystem::exists(GetDataDir() / "twisterwallet.dat")) + if (boost::filesystem::exists(GetDataDir() / "twisterwallet.dat")) { CDBEnv::VerifyResult r = bitdb.Verify("twisterwallet.dat", CWalletDB::Recover); if (r == CDBEnv::RECOVER_OK) @@ -700,20 +700,20 @@ bool AppInit2(boost::thread_group& threadGroup) fReindex = GetBoolArg("-reindex", false); // Upgrading to 0.8; hard-link the old blknnnn.dat files into /blocks/ - filesystem::path blocksDir = GetDataDir() / "blocks"; - if (!filesystem::exists(blocksDir)) + boost::filesystem::path blocksDir = GetDataDir() / "blocks"; + if (!boost::filesystem::exists(blocksDir)) { - filesystem::create_directories(blocksDir); + boost::filesystem::create_directories(blocksDir); bool linked = false; for (unsigned int i = 1; i < 10000; i++) { - filesystem::path source = GetDataDir() / strprintf("blk%04u.dat", i); - if (!filesystem::exists(source)) break; - filesystem::path dest = blocksDir / strprintf("blk%05u.dat", i-1); + boost::filesystem::path source = GetDataDir() / strprintf("blk%04u.dat", i); + if (!boost::filesystem::exists(source)) break; + boost::filesystem::path dest = blocksDir / strprintf("blk%05u.dat", i-1); try { - filesystem::create_hard_link(source, dest); + boost::filesystem::create_hard_link(source, dest); printf("Hardlinked %s -> %s\n", source.string().c_str(), dest.string().c_str()); linked = true; - } catch (filesystem::filesystem_error & e) { + } catch (boost::filesystem::filesystem_error & e) { // Note: hardlink creation failing is not a disaster, it just means // blocks will get re-downloaded from peers. printf("Error hardlinking blk%04u.dat : %s\n", i, e.what()); diff --git a/src/key.cpp b/src/key.cpp index d3821ae4..08b058e5 100644 --- a/src/key.cpp +++ b/src/key.cpp @@ -111,7 +111,7 @@ int ECDSA_SIG_recover_key_GFp(EC_KEY *eckey, ECDSA_SIG *ecsig, const unsigned ch if (!BN_bin2bn(msg, msglen, e)) { ret=-1; goto err; } if (8*msglen > n) BN_rshift(e, e, 8-(n & 7)); zero = BN_CTX_get(ctx); - if (!BN_zero(zero)) { ret=-1; goto err; } + BN_zero(zero); if (!BN_mod_sub(e, zero, e, order, ctx)) { ret=-1; goto err; } rr = BN_CTX_get(ctx); #if (OPENSSL_VERSION_NUMBER < 0x10100000) diff --git a/src/leveldb.cpp b/src/leveldb.cpp index f95367d1..8c5b7ab1 100644 --- a/src/leveldb.cpp +++ b/src/leveldb.cpp @@ -12,7 +12,7 @@ #include -void HandleError(const leveldb::Status &status) throw(leveldb_error) { +void HandleError(const leveldb::Status &status) { if (status.ok()) return; if (status.IsCorruption()) @@ -72,7 +72,7 @@ CLevelDB::~CLevelDB() { options.env = NULL; } -bool CLevelDB::WriteBatch(CLevelDBBatch &batch, bool fSync) throw(leveldb_error) { +bool CLevelDB::WriteBatch(CLevelDBBatch &batch, bool fSync) { leveldb::Status status = pdb->Write(fSync ? syncoptions : writeoptions, &batch.batch); if (!status.ok()) { printf("LevelDB write failure: %s\n", status.ToString().c_str()); diff --git a/src/leveldb.h b/src/leveldb.h index ebf9e558..c294c4c0 100644 --- a/src/leveldb.h +++ b/src/leveldb.h @@ -17,7 +17,7 @@ public: leveldb_error(const std::string &msg) : std::runtime_error(msg) {} }; -void HandleError(const leveldb::Status &status) throw(leveldb_error); +void HandleError(const leveldb::Status &status); // Batch of changes queued to be written to a CLevelDB class CLevelDBBatch @@ -83,7 +83,7 @@ public: CLevelDB(const boost::filesystem::path &path, size_t nCacheSize, bool fMemory = false, bool fWipe = false); ~CLevelDB(); - template bool Read(const K& key, V& value) throw(leveldb_error) { + template bool Read(const K& key, V& value) { CDataStream ssKey(SER_DISK, CLIENT_VERSION); ssKey.reserve(ssKey.GetSerializeSize(key)); ssKey << key; @@ -106,13 +106,13 @@ public: return true; } - template bool Write(const K& key, const V& value, bool fSync = false) throw(leveldb_error) { + template bool Write(const K& key, const V& value, bool fSync = false) { CLevelDBBatch batch; batch.Write(key, value); return WriteBatch(batch, fSync); } - template bool Exists(const K& key) throw(leveldb_error) { + template bool Exists(const K& key) { CDataStream ssKey(SER_DISK, CLIENT_VERSION); ssKey.reserve(ssKey.GetSerializeSize(key)); ssKey << key; @@ -129,20 +129,20 @@ public: return true; } - template bool Erase(const K& key, bool fSync = false) throw(leveldb_error) { + template bool Erase(const K& key, bool fSync = false) { CLevelDBBatch batch; batch.Erase(key); return WriteBatch(batch, fSync); } - bool WriteBatch(CLevelDBBatch &batch, bool fSync = false) throw(leveldb_error); + bool WriteBatch(CLevelDBBatch &batch, bool fSync = false); // not available for LevelDB; provide for compatibility with BDB bool Flush() { return true; } - bool Sync() throw(leveldb_error) { + bool Sync() { CLevelDBBatch batch; return WriteBatch(batch, true); } diff --git a/src/main.cpp b/src/main.cpp index 3acf6bfc..7123b6a9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2093,7 +2093,7 @@ bool AbortNode(const std::string &strMessage) { bool CheckDiskSpace(uint64 nAdditionalBytes) { - uint64 nFreeBytesAvailable = filesystem::space(GetDataDir()).available; + uint64 nFreeBytesAvailable = boost::filesystem::space(GetDataDir()).available; // Check for nMinDiskSpace bytes (currently 50MB) if (nFreeBytesAvailable < nMinDiskSpace + nAdditionalBytes) @@ -3819,7 +3819,7 @@ static bool CreateSpamMsgTx(CTransaction &txNew, std::vector &sal CBlockTemplate* CreateNewBlock(std::vector &salt) { // Create new block - auto_ptr pblocktemplate(new CBlockTemplate()); + unique_ptr pblocktemplate(new CBlockTemplate()); if(!pblocktemplate.get()) return NULL; CBlock *pblock = &pblocktemplate->block; // pointer for convenience @@ -4132,7 +4132,7 @@ void static BitcoinMiner(CWallet *pwallet) unsigned int nTransactionsUpdatedLast = nTransactionsUpdated; CBlockIndex* pindexPrev = pindexBest; - auto_ptr pblocktemplate(CreateNewBlock(salt)); + unique_ptr pblocktemplate(CreateNewBlock(salt)); if (!pblocktemplate.get()) return; CBlock *pblock = &pblocktemplate->block; diff --git a/src/main.h b/src/main.h index b296d06a..42ec474d 100644 --- a/src/main.h +++ b/src/main.h @@ -815,7 +815,7 @@ public: struct CBlockIndexWorkComparator { - bool operator()(CBlockIndex *pa, CBlockIndex *pb) { + bool operator()(CBlockIndex *pa, CBlockIndex *pb) const { if (pa->nChainWork > pb->nChainWork) return false; if (pa->nChainWork < pb->nChainWork) return true; diff --git a/src/twister.cpp b/src/twister.cpp index 63a698cf..bb2bed09 100644 --- a/src/twister.cpp +++ b/src/twister.cpp @@ -784,7 +784,7 @@ void ThreadSessionAlerts() , end(alerts.end()); i != end; ++i) { // make sure to delete each alert - std::auto_ptr a(*i); + std::unique_ptr a(*i); dht_reply_data_alert const* rd = alert_cast(*i); if (rd) @@ -2192,7 +2192,7 @@ Value dhtget(const Array& params, bool fHelp) int repliesReceived = 0; while( am.wait_for_alert(timeToWait) ) { - std::auto_ptr a(am.get()); + std::unique_ptr a(am.get()); dht_reply_data_alert const* rd = alert_cast(&(*a)); if( rd ) { @@ -4273,7 +4273,7 @@ Value peekpost(const Array& params, bool fHelp) // this loop receives alerts from both dht network and torrent peek extension while( h.is_valid() && am.wait_for_alert(timeToWait) ) { - std::auto_ptr a(am.get()); + std::unique_ptr a(am.get()); dht_reply_data_alert const* rd = alert_cast(&(*a)); if( rd && rd->m_lst.size() ) { diff --git a/src/walletdb.cpp b/src/walletdb.cpp index 9352c237..3f15c6d2 100644 --- a/src/walletdb.cpp +++ b/src/walletdb.cpp @@ -418,20 +418,20 @@ bool BackupWallet(const CWallet& wallet, const string& strDest) bitdb.mapFileUseCount.erase(wallet.strWalletFile); // Copy twisterwallet.dat - filesystem::path pathSrc = GetDataDir() / wallet.strWalletFile; - filesystem::path pathDest(strDest); - if (filesystem::is_directory(pathDest)) + boost::filesystem::path pathSrc = GetDataDir() / wallet.strWalletFile; + boost::filesystem::path pathDest(strDest); + if (boost::filesystem::is_directory(pathDest)) pathDest /= wallet.strWalletFile; try { #if BOOST_VERSION >= 104000 - filesystem::copy_file(pathSrc, pathDest, filesystem::copy_option::overwrite_if_exists); + boost::filesystem::copy_file(pathSrc, pathDest, boost::filesystem::copy_option::overwrite_if_exists); #else - filesystem::copy_file(pathSrc, pathDest); + boost::filesystem::copy_file(pathSrc, pathDest); #endif printf("copied twisterwallet.dat to %s\n", pathDest.string().c_str()); return true; - } catch(const filesystem::filesystem_error &e) { + } catch(const boost::filesystem::filesystem_error &e) { printf("error copying twisterwallet.dat to %s - %s\n", pathDest.string().c_str(), e.what()); return false; }