Changeset View
Changeset View
Standalone View
Standalone View
src/policy/policy.cpp
// 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. | ||||
// NOTE: This file is intended to be customised by the end user, and includes | // NOTE: This file is intended to be customised by the end user, and includes | ||||
// only local node policy logic | // only local node policy logic | ||||
#include <policy/policy.h> | #include <policy/policy.h> | ||||
#include <policy/settings.h> | |||||
#include <script/interpreter.h> | #include <script/interpreter.h> | ||||
#include <tinyformat.h> | #include <tinyformat.h> | ||||
#include <util/strencodings.h> | #include <util/strencodings.h> | ||||
#include <util/system.h> | #include <util/system.h> | ||||
#include <validation.h> | #include <validation.h> | ||||
Amount GetDustThreshold(const CTxOut &txout, const CFeeRate &dustRelayFeeIn) { | Amount GetDustThreshold(const CTxOut &txout, const CFeeRate &dustRelayFeeIn) { | ||||
/** | /** | ||||
▲ Show 20 Lines • Show All 141 Lines • ▼ Show 20 Lines | for (const CTxIn &in : tx.vin) { | ||||
return false; | return false; | ||||
} | } | ||||
} | } | ||||
} | } | ||||
return true; | return true; | ||||
} | } | ||||
CFeeRate dustRelayFee = CFeeRate(DUST_RELAY_TX_FEE); | |||||
uint32_t nBytesPerSigOp = DEFAULT_BYTES_PER_SIGOP; | |||||
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) { | ||||
return std::max(nSize, nSigOpCount * bytes_per_sigop); | return std::max(nSize, nSigOpCount * 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) { | ||||
return GetVirtualTransactionSize(::GetSerializeSize(tx, PROTOCOL_VERSION), | return GetVirtualTransactionSize(::GetSerializeSize(tx, PROTOCOL_VERSION), | ||||
nSigOpCount, bytes_per_sigop); | nSigOpCount, bytes_per_sigop); | ||||
} | } | ||||
int64_t GetVirtualTransactionInputSize(const CTxIn &txin, int64_t nSigOpCount, | int64_t GetVirtualTransactionInputSize(const CTxIn &txin, int64_t nSigOpCount, | ||||
unsigned int bytes_per_sigop) { | unsigned int bytes_per_sigop) { | ||||
return GetVirtualTransactionSize(::GetSerializeSize(txin, PROTOCOL_VERSION), | return GetVirtualTransactionSize(::GetSerializeSize(txin, PROTOCOL_VERSION), | ||||
nSigOpCount, bytes_per_sigop); | nSigOpCount, bytes_per_sigop); | ||||
} | } |