aboutsummaryrefslogtreecommitdiff
path: root/src/consensus/tx_check.h
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2019-04-02 13:41:12 -0400
committerJohn Newbery <john@johnnewbery.com>2019-04-09 17:53:08 -0400
commitfdf8888b6f0c63e8a4cb1459752625e642d6a4dd (patch)
treef68fbaf3d09a60b9dd63abb5be6bc079d0a0cdb5 /src/consensus/tx_check.h
parent93de9abe6d6847bce6db8da15f15b50b01972e70 (diff)
downloadbitcoin-fdf8888b6f0c63e8a4cb1459752625e642d6a4dd.tar.xz
[build] Move CheckTransaction from lib_server to lib_consensus
CheckTransaction is a context-free function that does not require access to the blockchain or mempool. Move it from src/consensus/tx_verify in lib_server to a new unit src/consensus/tx_check in lib_consensus so that it can be called by non-server libraries.
Diffstat (limited to 'src/consensus/tx_check.h')
-rw-r--r--src/consensus/tx_check.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/consensus/tx_check.h b/src/consensus/tx_check.h
new file mode 100644
index 0000000000..bcfdf36bf9
--- /dev/null
+++ b/src/consensus/tx_check.h
@@ -0,0 +1,20 @@
+// Copyright (c) 2017-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_CONSENSUS_TX_CHECK_H
+#define BITCOIN_CONSENSUS_TX_CHECK_H
+
+/**
+ * Context-independent transaction checking code that can be called outside the
+ * bitcoin server and doesn't depend on chain or mempool state. Transaction
+ * verification code that does call server functions or depend on server state
+ * belongs in tx_verify.h/cpp instead.
+ */
+
+class CTransaction;
+class CValidationState;
+
+bool CheckTransaction(const CTransaction& tx, CValidationState& state, bool fCheckDuplicateInputs=true);
+
+#endif // BITCOIN_CONSENSUS_TX_CHECK_H