mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Merge 9996b1806a into merged_master (Bitcoin PR #21064)
This commit is contained in:
commit
271029357b
15 changed files with 28 additions and 217 deletions
|
|
@ -12,8 +12,10 @@
|
|||
|
||||
#include <cuckoocache.h>
|
||||
|
||||
#include <boost/thread/lock_types.hpp>
|
||||
#include <boost/thread/shared_mutex.hpp>
|
||||
#include <algorithm>
|
||||
#include <mutex>
|
||||
#include <shared_mutex>
|
||||
#include <vector>
|
||||
|
||||
namespace {
|
||||
/**
|
||||
|
|
@ -31,7 +33,7 @@ private:
|
|||
CSHA256 m_salted_hasher_surjection_proof;
|
||||
typedef CuckooCache::cache<uint256, SignatureCacheHasher> map_type;
|
||||
map_type setValid;
|
||||
boost::shared_mutex cs_sigcache;
|
||||
std::shared_mutex cs_sigcache;
|
||||
|
||||
public:
|
||||
CSignatureCache()
|
||||
|
|
@ -82,13 +84,13 @@ public:
|
|||
bool
|
||||
Get(const uint256& entry, const bool erase)
|
||||
{
|
||||
boost::shared_lock<boost::shared_mutex> lock(cs_sigcache);
|
||||
std::shared_lock<std::shared_mutex> lock(cs_sigcache);
|
||||
return setValid.contains(entry, erase);
|
||||
}
|
||||
|
||||
void Set(const uint256& entry)
|
||||
{
|
||||
boost::unique_lock<boost::shared_mutex> lock(cs_sigcache);
|
||||
std::unique_lock<std::shared_mutex> lock(cs_sigcache);
|
||||
setValid.insert(entry);
|
||||
}
|
||||
uint32_t setup_bytes(size_t n)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue