Changeset View
Changeset View
Standalone View
Standalone View
src/policy/policy.h
// Copyright (c) 2009-2010 Satoshi Nakamoto | // Copyright (c) 2009-2010 Satoshi Nakamoto | ||||
// Copyright (c) 2009-2016 The Bitcoin Core developers | // Copyright (c) 2009-2016 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#ifndef BITCOIN_POLICY_POLICY_H | #ifndef BITCOIN_POLICY_POLICY_H | ||||
#define BITCOIN_POLICY_POLICY_H | #define BITCOIN_POLICY_POLICY_H | ||||
#include <consensus/consensus.h> | #include <consensus/consensus.h> | ||||
#include <feerate.h> | #include <feerate.h> | ||||
#include <policy/settings.h> | |||||
#include <script/standard.h> | #include <script/standard.h> | ||||
#include <string> | #include <string> | ||||
class CCoinsViewCache; | class CCoinsViewCache; | ||||
class CTransaction; | class CTransaction; | ||||
class CTxIn; | class CTxIn; | ||||
class CTxOut; | class CTxOut; | ||||
Show All 40 Lines | |||||
* mempool limiting or BIP 125 replacement. | * mempool limiting or BIP 125 replacement. | ||||
*/ | */ | ||||
static const CFeeRate MEMPOOL_FULL_FEE_INCREMENT(1000 * SATOSHI); | static const CFeeRate MEMPOOL_FULL_FEE_INCREMENT(1000 * SATOSHI); | ||||
/** | /** | ||||
* Default for -bytespersigop . | * Default for -bytespersigop . | ||||
*/ | */ | ||||
static const unsigned int DEFAULT_BYTES_PER_SIGOP = | static const unsigned int DEFAULT_BYTES_PER_SIGOP = | ||||
1000000 / MAX_BLOCK_SIGOPS_PER_MB; | 1000000 / MAX_BLOCK_SIGOPS_PER_MB; | ||||
/** Default for -permitbaremultisig */ | |||||
static const bool DEFAULT_PERMIT_BAREMULTISIG = true; | |||||
/** | /** | ||||
* Min feerate for defining dust. Historically this has been the same as the | * Min feerate for defining dust. Historically this has been the same as the | ||||
* minRelayTxFee, however changing the dust limit changes which transactions are | * minRelayTxFee, however changing the dust limit changes which transactions are | ||||
* standard and should be done with care and ideally rarely. It makes sense to | * standard and should be done with care and ideally rarely. It makes sense to | ||||
* only increase the dust limit after prior releases were already not creating | * only increase the dust limit after prior releases were already not creating | ||||
* outputs below the new threshold. | * outputs below the new threshold. | ||||
*/ | */ | ||||
static const Amount DUST_RELAY_TX_FEE(1000 * SATOSHI); | static const Amount DUST_RELAY_TX_FEE(1000 * SATOSHI); | ||||
▲ Show 20 Lines • Show All 58 Lines • ▼ Show 20 Lines | |||||
* Check for standard transaction types | * Check for standard transaction types | ||||
* @param[in] mapInputs Map of previous transactions that have outputs we're | * @param[in] mapInputs Map of previous transactions that have outputs we're | ||||
* spending | * spending | ||||
* @return True if all inputs (scriptSigs) use only standard transaction forms | * @return True if all inputs (scriptSigs) use only standard transaction forms | ||||
*/ | */ | ||||
bool AreInputsStandard(const CTransaction &tx, const CCoinsViewCache &mapInputs, | bool AreInputsStandard(const CTransaction &tx, const CCoinsViewCache &mapInputs, | ||||
uint32_t flags); | uint32_t flags); | ||||
extern CFeeRate dustRelayFee; | |||||
extern uint32_t nBytesPerSigOp; | |||||
/** | /** | ||||
* Compute the virtual transaction size (size, or more if sigops are too | * Compute the virtual transaction size (size, or more if sigops are too | ||||
* dense). | * dense). | ||||
*/ | */ | ||||
int64_t GetVirtualTransactionSize(int64_t nSize, int64_t nSigOpCount, | int64_t GetVirtualTransactionSize(int64_t nSize, int64_t nSigOpCount, | ||||
unsigned int bytes_per_sigop); | unsigned int bytes_per_sigop); | ||||
int64_t GetVirtualTransactionSize(const CTransaction &tx, int64_t nSigOpCount, | int64_t GetVirtualTransactionSize(const CTransaction &tx, int64_t nSigOpCount, | ||||
unsigned int bytes_per_sigop); | unsigned int bytes_per_sigop); | ||||
Show All 9 Lines |