Line data Source code
1 : // Copyright (c) 2009-2010 Satoshi Nakamoto 2 : // Copyright (c) 2009-2019 The Bitcoin Core developers 3 : // Distributed under the MIT software license, see the accompanying 4 : // file COPYING or http://www.opensource.org/licenses/mit-license.php. 5 : 6 : #ifndef BITCOIN_POLICY_SETTINGS_H 7 : #define BITCOIN_POLICY_SETTINGS_H 8 : 9 : #include <policy/feerate.h> 10 : #include <policy/policy.h> 11 : 12 : #include <cstdint> 13 : #include <string> 14 : 15 : class CTransaction; 16 : 17 : // Policy settings which are configurable at runtime. 18 : extern CFeeRate incrementalRelayFee; 19 : extern CFeeRate dustRelayFee; 20 : /** A fee rate smaller than this is considered zero fee (for relaying, mining and transaction creation) */ 21 : extern CFeeRate minRelayTxFee; 22 : extern unsigned int nBytesPerSigOp; 23 : extern bool fIsBareMultisigStd; 24 : 25 48248 : static inline bool IsStandardTx(const CTransaction& tx, std::string& reason) 26 : { 27 48248 : return IsStandardTx(tx, ::fIsBareMultisigStd, ::dustRelayFee, reason); 28 : } 29 : 30 268839753 : static inline int64_t GetVirtualTransactionSize(int64_t weight, int64_t sigop_cost) 31 : { 32 268839753 : return GetVirtualTransactionSize(weight, sigop_cost, ::nBytesPerSigOp); 33 : } 34 : 35 12 : static inline int64_t GetVirtualTransactionSize(const CTransaction& tx, int64_t sigop_cost) 36 : { 37 12 : return GetVirtualTransactionSize(tx, sigop_cost, ::nBytesPerSigOp); 38 : } 39 : 40 : #endif // BITCOIN_POLICY_SETTINGS_H