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 <script/standard.h> | #include <script/standard.h> | ||||
#include <string> | #include <string> | ||||
class CCoinsViewCache; | class CCoinsViewCache; | ||||
class CTransaction; | class CTransaction; | ||||
class CTxIn; | |||||
class CTxOut; | class CTxOut; | ||||
/** | /** | ||||
* Default for -blockmaxsize, which controls the maximum size of block the | * Default for -blockmaxsize, which controls the maximum size of block the | ||||
* mining code will create. | * mining code will create. | ||||
*/ | */ | ||||
static const uint64_t DEFAULT_MAX_GENERATED_BLOCK_SIZE = 2 * ONE_MEGABYTE; | static const uint64_t DEFAULT_MAX_GENERATED_BLOCK_SIZE = 2 * ONE_MEGABYTE; | ||||
/** | /** | ||||
▲ Show 20 Lines • Show All 103 Lines • ▼ Show 20 Lines | |||||
extern CFeeRate dustRelayFee; | extern CFeeRate dustRelayFee; | ||||
extern uint32_t nBytesPerSigOp; | extern uint32_t nBytesPerSigOp; | ||||
/** Compute the virtual transaction size (weight reinterpreted as bytes). */ | /** Compute the virtual transaction size (weight reinterpreted as bytes). */ | ||||
int64_t GetVirtualTransactionSize(int64_t nSize, int64_t nSigOpCost, | int64_t GetVirtualTransactionSize(int64_t nSize, int64_t nSigOpCost, | ||||
unsigned int bytes_per_sigop); | unsigned int bytes_per_sigop); | ||||
int64_t GetVirtualTransactionSize(const CTransaction &tx, int64_t nSigOpCost, | int64_t GetVirtualTransactionSize(const CTransaction &tx, int64_t nSigOpCost, | ||||
unsigned int bytes_per_sigop); | unsigned int bytes_per_sigop); | ||||
int64_t GetVirtualTransactionInputSize(const CTxIn &txin, int64_t nSigOpCost, | |||||
unsigned int bytes_per_sigop); | |||||
static inline int64_t GetVirtualTransactionSize(const CTransaction &tx) { | static inline int64_t GetVirtualTransactionSize(const CTransaction &tx) { | ||||
return GetVirtualTransactionSize(tx, 0, 0); | return GetVirtualTransactionSize(tx, 0, 0); | ||||
} | } | ||||
static inline int64_t GetVirtualTransactionInputSize(const CTxIn &txin) { | |||||
return GetVirtualTransactionInputSize(txin, 0, 0); | |||||
} | |||||
#endif // BITCOIN_POLICY_POLICY_H | #endif // BITCOIN_POLICY_POLICY_H |