mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-14 05:42:36 -03:00
b874747b51
Remove last few instances of accesses to node global variables from wallet code. Also remove accesses to node globals from code in policy/policy.cpp that isn't actually called by wallet code, but does get linked into wallet code. This is the last change needed to allow bitcoin-wallet tool to be linked without depending on libbitcoin_server.a, to ensure wallet code doesn't access node global state and avoid bugs like https://github.com/bitcoin/bitcoin/pull/15557#discussion_r267735431
35 lines
1.1 KiB
C++
35 lines
1.1 KiB
C++
// Copyright (c) 2009-2010 Satoshi Nakamoto
|
|
// Copyright (c) 2009-2018 The Bitcoin Core developers
|
|
// Distributed under the MIT software license, see the accompanying
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
#ifndef BITCOIN_POLICY_SETTINGS_H
|
|
#define BITCOIN_POLICY_SETTINGS_H
|
|
|
|
#include <policy/policy.h>
|
|
|
|
class CFeeRate;
|
|
class CTransaction;
|
|
|
|
// Policy settings which are configurable at runtime.
|
|
extern CFeeRate incrementalRelayFee;
|
|
extern CFeeRate dustRelayFee;
|
|
extern unsigned int nBytesPerSigOp;
|
|
extern bool fIsBareMultisigStd;
|
|
|
|
static inline bool IsStandardTx(const CTransaction& tx, std::string& reason)
|
|
{
|
|
return IsStandardTx(tx, ::fIsBareMultisigStd, ::dustRelayFee, reason);
|
|
}
|
|
|
|
static inline int64_t GetVirtualTransactionSize(int64_t weight, int64_t sigop_cost)
|
|
{
|
|
return GetVirtualTransactionSize(weight, sigop_cost, ::nBytesPerSigOp);
|
|
}
|
|
|
|
static inline int64_t GetVirtualTransactionSize(const CTransaction& tx, int64_t sigop_cost)
|
|
{
|
|
return GetVirtualTransactionSize(tx, sigop_cost, ::nBytesPerSigOp);
|
|
}
|
|
|
|
#endif // BITCOIN_POLICY_SETTINGS_H
|