/tmp/bitcoin/src/consensus/validation.h
Line | Count | Source |
1 | | // Copyright (c) 2009-2010 Satoshi Nakamoto |
2 | | // Copyright (c) 2009-present 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_CONSENSUS_VALIDATION_H |
7 | | #define BITCOIN_CONSENSUS_VALIDATION_H |
8 | | |
9 | | #include <string> |
10 | | #include <consensus/consensus.h> |
11 | | #include <primitives/transaction.h> |
12 | | #include <primitives/block.h> |
13 | | |
14 | | /** Index marker for when no witness commitment is present in a coinbase transaction. */ |
15 | | static constexpr int NO_WITNESS_COMMITMENT{-1}; |
16 | | |
17 | | /** Minimum size of a witness commitment structure. Defined in BIP 141. **/ |
18 | | static constexpr size_t MINIMUM_WITNESS_COMMITMENT{38}; |
19 | | |
20 | | /** A "reason" why a transaction was invalid, suitable for determining whether the |
21 | | * provider of the transaction should be banned/ignored/disconnected/etc. |
22 | | */ |
23 | | enum class TxValidationResult { |
24 | | TX_RESULT_UNSET = 0, //!< initial value. Tx has not yet been rejected |
25 | | TX_CONSENSUS, //!< invalid by consensus rules |
26 | | TX_INPUTS_NOT_STANDARD, //!< inputs (covered by txid) failed policy rules |
27 | | TX_NOT_STANDARD, //!< otherwise didn't meet our local policy rules |
28 | | TX_MISSING_INPUTS, //!< transaction was missing some of its inputs |
29 | | TX_PREMATURE_SPEND, //!< transaction spends a coinbase too early, or violates locktime/sequence locks |
30 | | /** |
31 | | * Transaction might have a witness prior to SegWit |
32 | | * activation, or witness may have been malleated (which includes |
33 | | * non-standard witnesses). |
34 | | */ |
35 | | TX_WITNESS_MUTATED, |
36 | | /** |
37 | | * Transaction is missing a witness. |
38 | | */ |
39 | | TX_WITNESS_STRIPPED, |
40 | | /** |
41 | | * Tx already in mempool or conflicts with a tx in the chain |
42 | | * (if it conflicts with another tx in mempool, we use MEMPOOL_POLICY as it failed to reach the RBF threshold) |
43 | | * Currently this is only used if the transaction already exists in the mempool or on chain. |
44 | | */ |
45 | | TX_CONFLICT, |
46 | | TX_MEMPOOL_POLICY, //!< violated mempool's fee/size/descendant/RBF/etc limits |
47 | | TX_NO_MEMPOOL, //!< this node does not have a mempool so can't validate the transaction |
48 | | TX_RECONSIDERABLE, //!< fails some policy, but might be acceptable if submitted in a (different) package |
49 | | TX_UNKNOWN, //!< transaction was not validated because package failed |
50 | | }; |
51 | | |
52 | | /** A "reason" why a block was invalid, suitable for determining whether the |
53 | | * provider of the block should be banned/ignored/disconnected/etc. |
54 | | * These are much more granular than the rejection codes, which may be more |
55 | | * useful for some other use-cases. |
56 | | */ |
57 | | enum class BlockValidationResult { |
58 | | BLOCK_RESULT_UNSET = 0, //!< initial value. Block has not yet been rejected |
59 | | BLOCK_CONSENSUS, //!< invalid by consensus rules (excluding any below reasons) |
60 | | BLOCK_CACHED_INVALID, //!< this block was cached as being invalid and we didn't store the reason why |
61 | | BLOCK_INVALID_HEADER, //!< invalid proof of work or time too old |
62 | | BLOCK_MUTATED, //!< the block's data didn't match the data committed to by the PoW |
63 | | BLOCK_MISSING_PREV, //!< We don't have the previous block the checked one is built on |
64 | | BLOCK_INVALID_PREV, //!< A block this one builds on is invalid |
65 | | BLOCK_TIME_FUTURE, //!< block timestamp was > 2 hours in the future (or our clock is bad) |
66 | | BLOCK_HEADER_LOW_WORK //!< the block header may be on a too-little-work chain |
67 | | }; |
68 | | |
69 | | |
70 | | |
71 | | /** Template for capturing information about block/transaction validation. This is instantiated |
72 | | * by TxValidationState and BlockValidationState for validation information on transactions |
73 | | * and blocks respectively. */ |
74 | | template <typename Result> |
75 | | class ValidationState |
76 | | { |
77 | | private: |
78 | | enum class ModeState { |
79 | | M_VALID, //!< everything ok |
80 | | M_INVALID, //!< network rule violation (DoS value may be set) |
81 | | M_ERROR, //!< run-time error |
82 | | } m_mode{ModeState::M_VALID}; |
83 | | Result m_result{}; |
84 | | std::string m_reject_reason; |
85 | | std::string m_debug_message; |
86 | | |
87 | | public: |
88 | | bool Invalid(Result result, |
89 | | const std::string& reject_reason = "", |
90 | | const std::string& debug_message = "") |
91 | 49.4k | { |
92 | 49.4k | m_result = result; |
93 | 49.4k | m_reject_reason = reject_reason; |
94 | 49.4k | m_debug_message = debug_message; |
95 | 49.4k | if (m_mode != ModeState::M_ERROR) m_mode = ModeState::M_INVALID; |
96 | 49.4k | return false; |
97 | 49.4k | } ValidationState<TxValidationResult>::Invalid(TxValidationResult, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) Line | Count | Source | 91 | 45.4k | { | 92 | 45.4k | m_result = result; | 93 | 45.4k | m_reject_reason = reject_reason; | 94 | 45.4k | m_debug_message = debug_message; | 95 | 45.4k | if (m_mode != ModeState::M_ERROR) m_mode = ModeState::M_INVALID; | 96 | 45.4k | return false; | 97 | 45.4k | } |
ValidationState<PackageValidationResult>::Invalid(PackageValidationResult, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) Line | Count | Source | 91 | 323 | { | 92 | 323 | m_result = result; | 93 | 323 | m_reject_reason = reject_reason; | 94 | 323 | m_debug_message = debug_message; | 95 | 323 | if (m_mode != ModeState::M_ERROR) m_mode = ModeState::M_INVALID; | 96 | 323 | return false; | 97 | 323 | } |
ValidationState<BlockValidationResult>::Invalid(BlockValidationResult, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) Line | Count | Source | 91 | 3.66k | { | 92 | 3.66k | m_result = result; | 93 | 3.66k | m_reject_reason = reject_reason; | 94 | 3.66k | m_debug_message = debug_message; | 95 | 3.66k | if (m_mode != ModeState::M_ERROR) m_mode = ModeState::M_INVALID; | 96 | 3.66k | return false; | 97 | 3.66k | } |
|
98 | | bool Error(const std::string& reject_reason) |
99 | 1 | { |
100 | 1 | if (m_mode == ModeState::M_VALID) |
101 | 1 | m_reject_reason = reject_reason; |
102 | 1 | m_mode = ModeState::M_ERROR; |
103 | 1 | return false; |
104 | 1 | } |
105 | 739k | bool IsValid() const { return m_mode == ModeState::M_VALID; }ValidationState<TxValidationResult>::IsValid() const Line | Count | Source | 105 | 15.3k | bool IsValid() const { return m_mode == ModeState::M_VALID; } |
ValidationState<PackageValidationResult>::IsValid() const Line | Count | Source | 105 | 187 | bool IsValid() const { return m_mode == ModeState::M_VALID; } |
ValidationState<BlockValidationResult>::IsValid() const Line | Count | Source | 105 | 723k | bool IsValid() const { return m_mode == ModeState::M_VALID; } |
|
106 | 160k | bool IsInvalid() const { return m_mode == ModeState::M_INVALID; }ValidationState<TxValidationResult>::IsInvalid() const Line | Count | Source | 106 | 50.4k | bool IsInvalid() const { return m_mode == ModeState::M_INVALID; } |
ValidationState<PackageValidationResult>::IsInvalid() const Line | Count | Source | 106 | 222 | bool IsInvalid() const { return m_mode == ModeState::M_INVALID; } |
ValidationState<BlockValidationResult>::IsInvalid() const Line | Count | Source | 106 | 109k | bool IsInvalid() const { return m_mode == ModeState::M_INVALID; } |
|
107 | 4.58k | bool IsError() const { return m_mode == ModeState::M_ERROR; } |
108 | 23.7k | Result GetResult() const { return m_result; }ValidationState<TxValidationResult>::GetResult() const Line | Count | Source | 108 | 15.6k | Result GetResult() const { return m_result; } |
ValidationState<PackageValidationResult>::GetResult() const Line | Count | Source | 108 | 2.15k | Result GetResult() const { return m_result; } |
ValidationState<BlockValidationResult>::GetResult() const Line | Count | Source | 108 | 5.94k | Result GetResult() const { return m_result; } |
|
109 | 3.63k | std::string GetRejectReason() const { return m_reject_reason; }ValidationState<TxValidationResult>::GetRejectReason[abi:cxx11]() const Line | Count | Source | 109 | 781 | std::string GetRejectReason() const { return m_reject_reason; } |
ValidationState<PackageValidationResult>::GetRejectReason[abi:cxx11]() const Line | Count | Source | 109 | 13 | std::string GetRejectReason() const { return m_reject_reason; } |
ValidationState<BlockValidationResult>::GetRejectReason[abi:cxx11]() const Line | Count | Source | 109 | 2.83k | std::string GetRejectReason() const { return m_reject_reason; } |
|
110 | 638 | std::string GetDebugMessage() const { return m_debug_message; }ValidationState<TxValidationResult>::GetDebugMessage[abi:cxx11]() const Line | Count | Source | 110 | 635 | std::string GetDebugMessage() const { return m_debug_message; } |
ValidationState<BlockValidationResult>::GetDebugMessage[abi:cxx11]() const Line | Count | Source | 110 | 3 | std::string GetDebugMessage() const { return m_debug_message; } |
|
111 | | std::string ToString() const |
112 | 154k | { |
113 | 154k | if (IsValid()) { |
114 | 139k | return "Valid"; |
115 | 139k | } |
116 | | |
117 | 15.0k | if (!m_debug_message.empty()) { |
118 | 11.6k | return m_reject_reason + ", " + m_debug_message; |
119 | 11.6k | } |
120 | | |
121 | 3.42k | return m_reject_reason; |
122 | 15.0k | } ValidationState<PackageValidationResult>::ToString[abi:cxx11]() const Line | Count | Source | 112 | 146 | { | 113 | 146 | if (IsValid()) { | 114 | 1 | return "Valid"; | 115 | 1 | } | 116 | | | 117 | 145 | if (!m_debug_message.empty()) { | 118 | 23 | return m_reject_reason + ", " + m_debug_message; | 119 | 23 | } | 120 | | | 121 | 122 | return m_reject_reason; | 122 | 145 | } |
ValidationState<TxValidationResult>::ToString[abi:cxx11]() const Line | Count | Source | 112 | 5.41k | { | 113 | 5.41k | if (IsValid()) { | 114 | 2 | return "Valid"; | 115 | 2 | } | 116 | | | 117 | 5.40k | if (!m_debug_message.empty()) { | 118 | 2.11k | return m_reject_reason + ", " + m_debug_message; | 119 | 2.11k | } | 120 | | | 121 | 3.29k | return m_reject_reason; | 122 | 5.40k | } |
ValidationState<BlockValidationResult>::ToString[abi:cxx11]() const Line | Count | Source | 112 | 149k | { | 113 | 149k | if (IsValid()) { | 114 | 139k | return "Valid"; | 115 | 139k | } | 116 | | | 117 | 9.51k | if (!m_debug_message.empty()) { | 118 | 9.50k | return m_reject_reason + ", " + m_debug_message; | 119 | 9.50k | } | 120 | | | 121 | 9 | return m_reject_reason; | 122 | 9.51k | } |
|
123 | | }; |
124 | | |
125 | | class TxValidationState : public ValidationState<TxValidationResult> {}; |
126 | | class BlockValidationState : public ValidationState<BlockValidationResult> {}; |
127 | | |
128 | | // These implement the weight = (stripped_size * 4) + witness_size formula, |
129 | | // using only serialization with and without witness data. As witness_size |
130 | | // is equal to total_size - stripped_size, this formula is identical to: |
131 | | // weight = (stripped_size * 3) + total_size. |
132 | | static inline int32_t GetTransactionWeight(const CTransaction& tx) |
133 | 265k | { |
134 | 265k | return ::GetSerializeSize(TX_NO_WITNESS(tx)) * (WITNESS_SCALE_FACTOR - 1) + ::GetSerializeSize(TX_WITH_WITNESS(tx)); |
135 | 265k | } Unexecuted instantiation: blockchain_tests.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: blockencodings_tests.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: blockfilter_index_tests.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: blockmanager_tests.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: chainstate_write_tests.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: coinstatsindex_tests.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: denialofservice_tests.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: headers_sync_chainwork_tests.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: i2p_tests.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: interfaces_tests.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: mempool_tests.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: miner_tests.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: miniminer_tests.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: miniscript_tests.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: multisig_tests.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: net_peer_connection_tests.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: net_peer_eviction_tests.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: net_tests.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: node_init_tests.cpp:GetTransactionWeight(CTransaction const&) orphanage_tests.cpp:GetTransactionWeight(CTransaction const&) Line | Count | Source | 133 | 103 | { | 134 | 103 | return ::GetSerializeSize(TX_NO_WITNESS(tx)) * (WITNESS_SCALE_FACTOR - 1) + ::GetSerializeSize(TX_WITH_WITNESS(tx)); | 135 | 103 | } |
Unexecuted instantiation: peerman_tests.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: policyestimator_tests.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: rbf_tests.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: rpc_tests.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: script_p2sh_tests.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: script_tests.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: sighash_tests.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: testnet4_miner_tests.cpp:GetTransactionWeight(CTransaction const&) transaction_tests.cpp:GetTransactionWeight(CTransaction const&) Line | Count | Source | 133 | 2 | { | 134 | 2 | return ::GetSerializeSize(TX_NO_WITNESS(tx)) * (WITNESS_SCALE_FACTOR - 1) + ::GetSerializeSize(TX_WITH_WITNESS(tx)); | 135 | 2 | } |
Unexecuted instantiation: txdownload_tests.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: txindex_tests.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: txospenderindex_tests.cpp:GetTransactionWeight(CTransaction const&) txpackage_tests.cpp:GetTransactionWeight(CTransaction const&) Line | Count | Source | 133 | 1 | { | 134 | 1 | return ::GetSerializeSize(TX_NO_WITNESS(tx)) * (WITNESS_SCALE_FACTOR - 1) + ::GetSerializeSize(TX_WITH_WITNESS(tx)); | 135 | 1 | } |
txvalidation_tests.cpp:GetTransactionWeight(CTransaction const&) Line | Count | Source | 133 | 1 | { | 134 | 1 | return ::GetSerializeSize(TX_NO_WITNESS(tx)) * (WITNESS_SCALE_FACTOR - 1) + ::GetSerializeSize(TX_WITH_WITNESS(tx)); | 135 | 1 | } |
Unexecuted instantiation: txvalidationcache_tests.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: validation_block_tests.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: validation_chainstate_tests.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: validation_chainstatemanager_tests.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: validation_flush_tests.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: validation_tests.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: validationinterface_tests.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: init_test_fixture.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: wallet_test_fixture.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: db_tests.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: coinselector_tests.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: coinselection_tests.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: feebumper_tests.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: group_outputs_tests.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: init_tests.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: ismine_tests.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: psbt_wallet_tests.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: scriptpubkeyman_tests.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: spend_tests.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: wallet_rpc_tests.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: wallet_tests.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: wallet_transaction_tests.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: walletdb_tests.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: walletload_tests.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: ipc_tests.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: blockfilter.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: net.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: setup_common.cpp:GetTransactionWeight(CTransaction const&) transaction_utils.cpp:GetTransactionWeight(CTransaction const&) Line | Count | Source | 133 | 21 | { | 134 | 21 | return ::GetSerializeSize(TX_NO_WITNESS(tx)) * (WITNESS_SCALE_FACTOR - 1) + ::GetSerializeSize(TX_WITH_WITNESS(tx)); | 135 | 21 | } |
txmempool.cpp:GetTransactionWeight(CTransaction const&) Line | Count | Source | 133 | 153k | { | 134 | 153k | return ::GetSerializeSize(TX_NO_WITNESS(tx)) * (WITNESS_SCALE_FACTOR - 1) + ::GetSerializeSize(TX_WITH_WITNESS(tx)); | 135 | 153k | } |
Unexecuted instantiation: validation.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: util.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: blockencodings.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: tx_verify.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: base.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: blockfilterindex.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: coinstatsindex.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: txindex.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: txospenderindex.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: init.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: coinstats.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: net_processing.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: blockmanager_args.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: blockstorage.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: caches.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: chainstate.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: chainstatemanager_args.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: context.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: interfaces.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: mempool_args.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: mempool_persist.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: mempool_persist_args.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: miner.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: mini_miner.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: peerman_args.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: transaction.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: txdownloadman_impl.cpp:GetTransactionWeight(CTransaction const&) txorphanage.cpp:GetTransactionWeight(CTransaction const&) Line | Count | Source | 133 | 5.27k | { | 134 | 5.27k | return ::GetSerializeSize(TX_NO_WITNESS(tx)) * (WITNESS_SCALE_FACTOR - 1) + ::GetSerializeSize(TX_WITH_WITNESS(tx)); | 135 | 5.27k | } |
Unexecuted instantiation: utxo_snapshot.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: ephemeral_policy.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: block_policy_estimator.cpp:GetTransactionWeight(CTransaction const&) packages.cpp:GetTransactionWeight(CTransaction const&) Line | Count | Source | 133 | 1.40k | { | 134 | 1.40k | return ::GetSerializeSize(TX_NO_WITNESS(tx)) * (WITNESS_SCALE_FACTOR - 1) + ::GetSerializeSize(TX_WITH_WITNESS(tx)); | 135 | 1.40k | } |
Unexecuted instantiation: rbf.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: settings.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: truc_policy.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: rest.cpp:GetTransactionWeight(CTransaction const&) blockchain.cpp:GetTransactionWeight(CTransaction const&) Line | Count | Source | 133 | 44 | { | 134 | 44 | return ::GetSerializeSize(TX_NO_WITNESS(tx)) * (WITNESS_SCALE_FACTOR - 1) + ::GetSerializeSize(TX_WITH_WITNESS(tx)); | 135 | 44 | } |
Unexecuted instantiation: external_signer.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: fees.cpp:GetTransactionWeight(CTransaction const&) mempool.cpp:GetTransactionWeight(CTransaction const&) Line | Count | Source | 133 | 43 | { | 134 | 43 | return ::GetSerializeSize(TX_NO_WITNESS(tx)) * (WITNESS_SCALE_FACTOR - 1) + ::GetSerializeSize(TX_WITH_WITNESS(tx)); | 135 | 43 | } |
mining.cpp:GetTransactionWeight(CTransaction const&) Line | Count | Source | 133 | 109 | { | 134 | 109 | return ::GetSerializeSize(TX_NO_WITNESS(tx)) * (WITNESS_SCALE_FACTOR - 1) + ::GetSerializeSize(TX_WITH_WITNESS(tx)); | 135 | 109 | } |
Unexecuted instantiation: node.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: output_script.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: rawtransaction.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: server.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: server_util.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: signmessage.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: txoutproof.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: signet.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: validationinterface.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: httprpc.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: coin.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: psbt.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: tx_check.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: coinselection.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: load.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: receive.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: wallet.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: scriptpubkeyman.cpp:GetTransactionWeight(CTransaction const&) spend.cpp:GetTransactionWeight(CTransaction const&) Line | Count | Source | 133 | 2.48k | { | 134 | 2.48k | return ::GetSerializeSize(TX_NO_WITNESS(tx)) * (WITNESS_SCALE_FACTOR - 1) + ::GetSerializeSize(TX_WITH_WITNESS(tx)); | 135 | 2.48k | } |
Unexecuted instantiation: walletdb.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: external_signer_scriptpubkeyman.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: feebumper.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: addresses.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: backup.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: coins.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: encrypt.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: transactions.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: ipc_test.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: ipc_test.capnp.proxy-client.c++:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: ipc_test.capnp.proxy-types.c++:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: ipc_test.capnp.proxy-server.c++:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: protocol.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: process.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: init.capnp.proxy-client.c++:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: init.capnp.proxy-types.c++:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: mining.capnp.proxy-types.c++:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: init.capnp.proxy-server.c++:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: mining.capnp.proxy-client.c++:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: mining.capnp.proxy-server.c++:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: messages.cpp:GetTransactionWeight(CTransaction const&) core_io.cpp:GetTransactionWeight(CTransaction const&) Line | Count | Source | 133 | 16.3k | { | 134 | 16.3k | return ::GetSerializeSize(TX_NO_WITNESS(tx)) * (WITNESS_SCALE_FACTOR - 1) + ::GetSerializeSize(TX_WITH_WITNESS(tx)); | 135 | 16.3k | } |
policy.cpp:GetTransactionWeight(CTransaction const&) Line | Count | Source | 133 | 86.2k | { | 134 | 86.2k | return ::GetSerializeSize(TX_NO_WITNESS(tx)) * (WITNESS_SCALE_FACTOR - 1) + ::GetSerializeSize(TX_WITH_WITNESS(tx)); | 135 | 86.2k | } |
Unexecuted instantiation: rawtransaction_util.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: descriptor.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: miniscript.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: sign.cpp:GetTransactionWeight(CTransaction const&) Unexecuted instantiation: bitcoind.cpp:GetTransactionWeight(CTransaction const&) |
136 | | static inline int64_t GetBlockWeight(const CBlock& block) |
137 | 197k | { |
138 | 197k | return ::GetSerializeSize(TX_NO_WITNESS(block)) * (WITNESS_SCALE_FACTOR - 1) + ::GetSerializeSize(TX_WITH_WITNESS(block)); |
139 | 197k | } Unexecuted instantiation: blockchain_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: blockencodings_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: blockfilter_index_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: blockmanager_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: chainstate_write_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: coinstatsindex_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: denialofservice_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: headers_sync_chainwork_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: i2p_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: interfaces_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: mempool_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: miner_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: miniminer_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: miniscript_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: multisig_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: net_peer_connection_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: net_peer_eviction_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: net_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: node_init_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: orphanage_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: peerman_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: policyestimator_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: rbf_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: rpc_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: script_p2sh_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: script_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: sighash_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: testnet4_miner_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: transaction_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: txdownload_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: txindex_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: txospenderindex_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: txpackage_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: txvalidation_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: txvalidationcache_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: validation_block_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: validation_chainstate_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: validation_chainstatemanager_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: validation_flush_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: validation_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: validationinterface_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: init_test_fixture.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: wallet_test_fixture.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: db_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: coinselector_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: coinselection_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: feebumper_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: group_outputs_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: init_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: ismine_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: psbt_wallet_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: scriptpubkeyman_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: spend_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: wallet_rpc_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: wallet_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: wallet_transaction_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: walletdb_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: walletload_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: ipc_tests.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: blockfilter.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: net.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: setup_common.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: transaction_utils.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: txmempool.cpp:GetBlockWeight(CBlock const&) validation.cpp:GetBlockWeight(CBlock const&) Line | Count | Source | 137 | 151k | { | 138 | 151k | return ::GetSerializeSize(TX_NO_WITNESS(block)) * (WITNESS_SCALE_FACTOR - 1) + ::GetSerializeSize(TX_WITH_WITNESS(block)); | 139 | 151k | } |
Unexecuted instantiation: util.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: blockencodings.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: tx_verify.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: base.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: blockfilterindex.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: coinstatsindex.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: txindex.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: txospenderindex.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: init.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: coinstats.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: net_processing.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: blockmanager_args.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: blockstorage.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: caches.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: chainstate.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: chainstatemanager_args.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: context.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: interfaces.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: mempool_args.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: mempool_persist.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: mempool_persist_args.cpp:GetBlockWeight(CBlock const&) miner.cpp:GetBlockWeight(CBlock const&) Line | Count | Source | 137 | 44.4k | { | 138 | 44.4k | return ::GetSerializeSize(TX_NO_WITNESS(block)) * (WITNESS_SCALE_FACTOR - 1) + ::GetSerializeSize(TX_WITH_WITNESS(block)); | 139 | 44.4k | } |
Unexecuted instantiation: mini_miner.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: peerman_args.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: transaction.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: txdownloadman_impl.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: txorphanage.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: utxo_snapshot.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: ephemeral_policy.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: block_policy_estimator.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: packages.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: rbf.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: settings.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: truc_policy.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: rest.cpp:GetBlockWeight(CBlock const&) blockchain.cpp:GetBlockWeight(CBlock const&) Line | Count | Source | 137 | 1.54k | { | 138 | 1.54k | return ::GetSerializeSize(TX_NO_WITNESS(block)) * (WITNESS_SCALE_FACTOR - 1) + ::GetSerializeSize(TX_WITH_WITNESS(block)); | 139 | 1.54k | } |
Unexecuted instantiation: external_signer.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: fees.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: mempool.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: mining.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: node.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: output_script.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: rawtransaction.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: server.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: server_util.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: signmessage.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: txoutproof.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: signet.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: validationinterface.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: httprpc.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: coin.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: psbt.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: tx_check.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: coinselection.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: load.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: receive.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: wallet.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: scriptpubkeyman.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: spend.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: walletdb.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: external_signer_scriptpubkeyman.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: feebumper.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: addresses.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: backup.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: coins.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: encrypt.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: transactions.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: ipc_test.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: ipc_test.capnp.proxy-client.c++:GetBlockWeight(CBlock const&) Unexecuted instantiation: ipc_test.capnp.proxy-types.c++:GetBlockWeight(CBlock const&) Unexecuted instantiation: ipc_test.capnp.proxy-server.c++:GetBlockWeight(CBlock const&) Unexecuted instantiation: protocol.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: process.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: init.capnp.proxy-client.c++:GetBlockWeight(CBlock const&) Unexecuted instantiation: init.capnp.proxy-types.c++:GetBlockWeight(CBlock const&) Unexecuted instantiation: mining.capnp.proxy-types.c++:GetBlockWeight(CBlock const&) Unexecuted instantiation: init.capnp.proxy-server.c++:GetBlockWeight(CBlock const&) Unexecuted instantiation: mining.capnp.proxy-client.c++:GetBlockWeight(CBlock const&) Unexecuted instantiation: mining.capnp.proxy-server.c++:GetBlockWeight(CBlock const&) Unexecuted instantiation: messages.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: core_io.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: policy.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: rawtransaction_util.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: descriptor.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: miniscript.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: sign.cpp:GetBlockWeight(CBlock const&) Unexecuted instantiation: bitcoind.cpp:GetBlockWeight(CBlock const&) |
140 | | static inline int64_t GetTransactionInputWeight(const CTxIn& txin) |
141 | 2.49k | { |
142 | | // scriptWitness size is added here because witnesses and txins are split up in segwit serialization. |
143 | 2.49k | return ::GetSerializeSize(TX_NO_WITNESS(txin)) * (WITNESS_SCALE_FACTOR - 1) + ::GetSerializeSize(TX_WITH_WITNESS(txin)) + ::GetSerializeSize(txin.scriptWitness.stack); |
144 | 2.49k | } Unexecuted instantiation: blockchain_tests.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: blockencodings_tests.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: blockfilter_index_tests.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: blockmanager_tests.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: chainstate_write_tests.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: coinstatsindex_tests.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: denialofservice_tests.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: headers_sync_chainwork_tests.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: i2p_tests.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: interfaces_tests.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: mempool_tests.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: miner_tests.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: miniminer_tests.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: miniscript_tests.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: multisig_tests.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: net_peer_connection_tests.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: net_peer_eviction_tests.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: net_tests.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: node_init_tests.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: orphanage_tests.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: peerman_tests.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: policyestimator_tests.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: rbf_tests.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: rpc_tests.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: script_p2sh_tests.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: script_tests.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: sighash_tests.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: testnet4_miner_tests.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: transaction_tests.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: txdownload_tests.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: txindex_tests.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: txospenderindex_tests.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: txpackage_tests.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: txvalidation_tests.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: txvalidationcache_tests.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: validation_block_tests.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: validation_chainstate_tests.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: validation_chainstatemanager_tests.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: validation_flush_tests.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: validation_tests.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: validationinterface_tests.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: init_test_fixture.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: wallet_test_fixture.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: db_tests.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: coinselector_tests.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: coinselection_tests.cpp:GetTransactionInputWeight(CTxIn const&) feebumper_tests.cpp:GetTransactionInputWeight(CTxIn const&) Line | Count | Source | 141 | 4 | { | 142 | | // scriptWitness size is added here because witnesses and txins are split up in segwit serialization. | 143 | 4 | return ::GetSerializeSize(TX_NO_WITNESS(txin)) * (WITNESS_SCALE_FACTOR - 1) + ::GetSerializeSize(TX_WITH_WITNESS(txin)) + ::GetSerializeSize(txin.scriptWitness.stack); | 144 | 4 | } |
Unexecuted instantiation: group_outputs_tests.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: init_tests.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: ismine_tests.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: psbt_wallet_tests.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: scriptpubkeyman_tests.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: spend_tests.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: wallet_rpc_tests.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: wallet_tests.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: wallet_transaction_tests.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: walletdb_tests.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: walletload_tests.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: ipc_tests.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: blockfilter.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: net.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: setup_common.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: transaction_utils.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: txmempool.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: validation.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: util.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: blockencodings.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: tx_verify.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: base.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: blockfilterindex.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: coinstatsindex.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: txindex.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: txospenderindex.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: init.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: coinstats.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: net_processing.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: blockmanager_args.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: blockstorage.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: caches.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: chainstate.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: chainstatemanager_args.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: context.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: interfaces.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: mempool_args.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: mempool_persist.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: mempool_persist_args.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: miner.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: mini_miner.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: peerman_args.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: transaction.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: txdownloadman_impl.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: txorphanage.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: utxo_snapshot.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: ephemeral_policy.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: block_policy_estimator.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: packages.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: rbf.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: settings.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: truc_policy.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: rest.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: blockchain.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: external_signer.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: fees.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: mempool.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: mining.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: node.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: output_script.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: rawtransaction.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: server.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: server_util.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: signmessage.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: txoutproof.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: signet.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: validationinterface.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: httprpc.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: coin.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: psbt.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: tx_check.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: coinselection.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: load.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: receive.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: wallet.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: scriptpubkeyman.cpp:GetTransactionInputWeight(CTxIn const&) spend.cpp:GetTransactionInputWeight(CTxIn const&) Line | Count | Source | 141 | 2.48k | { | 142 | | // scriptWitness size is added here because witnesses and txins are split up in segwit serialization. | 143 | 2.48k | return ::GetSerializeSize(TX_NO_WITNESS(txin)) * (WITNESS_SCALE_FACTOR - 1) + ::GetSerializeSize(TX_WITH_WITNESS(txin)) + ::GetSerializeSize(txin.scriptWitness.stack); | 144 | 2.48k | } |
Unexecuted instantiation: walletdb.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: external_signer_scriptpubkeyman.cpp:GetTransactionInputWeight(CTxIn const&) feebumper.cpp:GetTransactionInputWeight(CTxIn const&) Line | Count | Source | 141 | 3 | { | 142 | | // scriptWitness size is added here because witnesses and txins are split up in segwit serialization. | 143 | 3 | return ::GetSerializeSize(TX_NO_WITNESS(txin)) * (WITNESS_SCALE_FACTOR - 1) + ::GetSerializeSize(TX_WITH_WITNESS(txin)) + ::GetSerializeSize(txin.scriptWitness.stack); | 144 | 3 | } |
Unexecuted instantiation: addresses.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: backup.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: coins.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: encrypt.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: transactions.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: ipc_test.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: ipc_test.capnp.proxy-client.c++:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: ipc_test.capnp.proxy-types.c++:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: ipc_test.capnp.proxy-server.c++:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: protocol.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: process.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: init.capnp.proxy-client.c++:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: init.capnp.proxy-types.c++:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: mining.capnp.proxy-types.c++:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: init.capnp.proxy-server.c++:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: mining.capnp.proxy-client.c++:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: mining.capnp.proxy-server.c++:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: messages.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: core_io.cpp:GetTransactionInputWeight(CTxIn const&) policy.cpp:GetTransactionInputWeight(CTxIn const&) Line | Count | Source | 141 | 2 | { | 142 | | // scriptWitness size is added here because witnesses and txins are split up in segwit serialization. | 143 | 2 | return ::GetSerializeSize(TX_NO_WITNESS(txin)) * (WITNESS_SCALE_FACTOR - 1) + ::GetSerializeSize(TX_WITH_WITNESS(txin)) + ::GetSerializeSize(txin.scriptWitness.stack); | 144 | 2 | } |
Unexecuted instantiation: rawtransaction_util.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: descriptor.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: miniscript.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: sign.cpp:GetTransactionInputWeight(CTxIn const&) Unexecuted instantiation: bitcoind.cpp:GetTransactionInputWeight(CTxIn const&) |
145 | | |
146 | | /** Compute at which vout of the block's coinbase transaction the witness commitment occurs, or -1 if not found */ |
147 | | inline int GetWitnessCommitmentIndex(const CBlock& block) |
148 | 276k | { |
149 | 276k | int commitpos = NO_WITNESS_COMMITMENT; |
150 | 276k | if (!block.vtx.empty()) { |
151 | 765k | for (size_t o = 0; o < block.vtx[0]->vout.size(); o++) { |
152 | 488k | const CTxOut& vout = block.vtx[0]->vout[o]; |
153 | 488k | if (vout.scriptPubKey.size() >= MINIMUM_WITNESS_COMMITMENT && |
154 | 488k | vout.scriptPubKey[0] == OP_RETURN && |
155 | 488k | vout.scriptPubKey[1] == 0x24 && |
156 | 488k | vout.scriptPubKey[2] == 0xaa && |
157 | 488k | vout.scriptPubKey[3] == 0x21 && |
158 | 488k | vout.scriptPubKey[4] == 0xa9 && |
159 | 488k | vout.scriptPubKey[5] == 0xed) { |
160 | 202k | commitpos = o; |
161 | 202k | } |
162 | 488k | } |
163 | 276k | } |
164 | 276k | return commitpos; |
165 | 276k | } |
166 | | |
167 | | #endif // BITCOIN_CONSENSUS_VALIDATION_H |