mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Cleanup code using forward declarations.
Use misc methods of avoiding unnecesary header includes. Replace int typedefs with int##_t from stdint.h. Replace PRI64[xdu] with PRI[xdu]64 from inttypes.h. Normalize QT_VERSION ifs where possible. Resolve some indirect dependencies as direct ones. Remove extern declarations from .cpp files.
This commit is contained in:
parent
7c4c207be8
commit
51ed9ec971
177 changed files with 2084 additions and 1681 deletions
|
|
@ -2,24 +2,27 @@
|
|||
// Copyright (c) 2009-2013 The Bitcoin developers
|
||||
// Distributed under the MIT/X11 software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include "script.h"
|
||||
#include "core.h"
|
||||
#include "keystore.h"
|
||||
|
||||
#include "bignum.h"
|
||||
#include "core.h"
|
||||
#include "hash.h"
|
||||
#include "key.h"
|
||||
#include "keystore.h"
|
||||
#include "sync.h"
|
||||
#include "uint256.h"
|
||||
#include "util.h"
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <boost/foreach.hpp>
|
||||
#include <boost/tuple/tuple.hpp>
|
||||
#include <boost/tuple/tuple_comparison.hpp>
|
||||
|
||||
using namespace std;
|
||||
using namespace boost;
|
||||
|
||||
bool CheckSig(vector<unsigned char> vchSig, const vector<unsigned char> &vchPubKey, const CScript &scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType, int flags);
|
||||
|
||||
|
||||
|
||||
typedef vector<unsigned char> valtype;
|
||||
static const valtype vchFalse(0);
|
||||
static const valtype vchZero(0);
|
||||
|
|
@ -30,6 +33,7 @@ static const CBigNum bnFalse(0);
|
|||
static const CBigNum bnTrue(1);
|
||||
static const size_t nMaxNumSize = 4;
|
||||
|
||||
bool CheckSig(vector<unsigned char> vchSig, const vector<unsigned char> &vchPubKey, const CScript &scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType, int flags);
|
||||
|
||||
CBigNum CastToBigNum(const valtype& vch)
|
||||
{
|
||||
|
|
@ -1124,12 +1128,12 @@ public:
|
|||
// (~200 bytes per cache entry times 50,000 entries)
|
||||
// Since there are a maximum of 20,000 signature operations per block
|
||||
// 50,000 is a reasonable default.
|
||||
int64 nMaxCacheSize = GetArg("-maxsigcachesize", 50000);
|
||||
int64_t nMaxCacheSize = GetArg("-maxsigcachesize", 50000);
|
||||
if (nMaxCacheSize <= 0) return;
|
||||
|
||||
boost::unique_lock<boost::shared_mutex> lock(cs_sigcache);
|
||||
|
||||
while (static_cast<int64>(setValid.size()) > nMaxCacheSize)
|
||||
while (static_cast<int64_t>(setValid.size()) > nMaxCacheSize)
|
||||
{
|
||||
// Evict a random entry. Random because that helps
|
||||
// foil would-be DoS attackers who might try to pre-generate
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue