From 14d2051eacfd099d669305ca255d04769c1b793d Mon Sep 17 00:00:00 2001 From: svost Date: Mon, 24 Jan 2022 13:06:52 +0300 Subject: [PATCH] Drop some boost deps --- src/rpcwallet.cpp | 2 +- src/script.cpp | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index e75fe87..afef907 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -1677,7 +1677,7 @@ Value encryptwallet(const Array& params, bool fHelp) return "wallet encrypted; NovaCoin server stopping, restart to run with encrypted wallet. The keypool has been flushed, you need to make a new backup."; } -class DescribeAddressVisitor : public boost::static_visitor +class DescribeAddressVisitor { private: isminetype mine; diff --git a/src/script.cpp b/src/script.cpp index 67be71d..d0cf49c 100644 --- a/src/script.cpp +++ b/src/script.cpp @@ -12,6 +12,8 @@ #include "util.h" #include "base58.h" +#include + bool CheckSig(std::vector vchSig, const std::vector &vchPubKey, const CScript &scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType, int flags); static const valtype vchFalse(0); @@ -1227,15 +1229,15 @@ class CSignatureCache { private: // sigdata_type is (signature hash, signature, public key): - typedef std::tuple, CPubKey > sigdata_type; - std::set< sigdata_type> setValid; - boost::shared_mutex cs_sigcache; + using sigdata_type = std::tuple, CPubKey>; + std::set setValid; + std::shared_mutex cs_sigcache; public: bool Get(const uint256 &hash, const std::vector& vchSig, const CPubKey& pubKey) { - boost::shared_lock lock(cs_sigcache); + std::shared_lock lock(cs_sigcache); sigdata_type k(hash, vchSig, pubKey); std::set::iterator mi = setValid.find(k); @@ -1253,7 +1255,7 @@ public: int64_t nMaxCacheSize = GetArg("-maxsigcachesize", 50000); if (nMaxCacheSize <= 0) return; - boost::shared_lock lock(cs_sigcache); + std::shared_lock lock(cs_sigcache); while (static_cast(setValid.size()) > nMaxCacheSize) { @@ -1613,7 +1615,7 @@ unsigned int HaveKeys(const std::vector& pubkeys, const CKeyStore& keys } -class CKeyStoreIsMineVisitor : public boost::static_visitor +class CKeyStoreIsMineVisitor { private: const CKeyStore *keystore; @@ -1765,7 +1767,7 @@ bool ExtractAddress(const CKeyStore &keystore, const CScript& scriptPubKey, CBit return false; } -class CAffectedKeysVisitor : public boost::static_visitor { +class CAffectedKeysVisitor { private: const CKeyStore &keystore; CAffectedKeysVisitor& operator=(CAffectedKeysVisitor const&); @@ -2134,7 +2136,7 @@ bool CScript::HasCanonicalPushes() const return true; } -class CScriptVisitor : public boost::static_visitor +class CScriptVisitor { private: CScript *script; -- 1.7.1