aboutsummaryrefslogtreecommitdiff
path: root/src/scriptutils.h
diff options
context:
space:
mode:
authorjtimon <jtimon@monetize.io>2014-08-23 03:35:51 +0200
committerPieter Wuille <pieter.wuille@gmail.com>2014-09-08 20:21:35 +0200
commitc4408a6c8534a36711557028a69314024cbc1bbe (patch)
treeeccd3df9057ee057ffb27844295cd54fa2366a72 /src/scriptutils.h
parentda03e6ed7c380d8942592626b9677579267f86fd (diff)
downloadbitcoin-c4408a6c8534a36711557028a69314024cbc1bbe.tar.xz
Separate script/standard
Diffstat (limited to 'src/scriptutils.h')
-rw-r--r--src/scriptutils.h40
1 files changed, 1 insertions, 39 deletions
diff --git a/src/scriptutils.h b/src/scriptutils.h
index 1df95b1fa0..7ea2c9e6a5 100644
--- a/src/scriptutils.h
+++ b/src/scriptutils.h
@@ -9,6 +9,7 @@
#include "key.h"
#include "script/script.h"
#include "script/interpreter.h"
+#include "script/standard.h"
#include <stdexcept>
#include <stdint.h>
@@ -19,8 +20,6 @@ class CKeyStore;
class CTransaction;
struct CMutableTransaction;
-static const unsigned int MAX_OP_RETURN_RELAY = 40; // bytes
-
/** IsMine() return codes */
enum isminetype
{
@@ -32,38 +31,6 @@ enum isminetype
/** used for bitflags of isminetype */
typedef uint8_t isminefilter;
-// Mandatory script verification flags that all new blocks must comply with for
-// them to be valid. (but old blocks may not comply with) Currently just P2SH,
-// but in the future other flags may be added, such as a soft-fork to enforce
-// strict DER encoding.
-//
-// Failing one of these tests may trigger a DoS ban - see CheckInputs() for
-// details.
-static const unsigned int MANDATORY_SCRIPT_VERIFY_FLAGS = SCRIPT_VERIFY_P2SH;
-
-// Standard script verification flags that standard transactions will comply
-// with. However scripts violating these flags may still be present in valid
-// blocks and we must accept those blocks.
-static const unsigned int STANDARD_SCRIPT_VERIFY_FLAGS = MANDATORY_SCRIPT_VERIFY_FLAGS |
- SCRIPT_VERIFY_STRICTENC |
- SCRIPT_VERIFY_NULLDUMMY;
-
-// For convenience, standard but not mandatory verify flags.
-static const unsigned int STANDARD_NOT_MANDATORY_VERIFY_FLAGS = STANDARD_SCRIPT_VERIFY_FLAGS & ~MANDATORY_SCRIPT_VERIFY_FLAGS;
-
-enum txnouttype
-{
- TX_NONSTANDARD,
- // 'standard' transaction types:
- TX_PUBKEY,
- TX_PUBKEYHASH,
- TX_SCRIPTHASH,
- TX_MULTISIG,
- TX_NULL_DATA,
-};
-
-const char* GetTxnOutputType(txnouttype t);
-
/** Compact serializer for scripts.
*
* It detects common cases and encodes them much more efficiently.
@@ -137,14 +104,9 @@ public:
}
};
-bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, std::vector<std::vector<unsigned char> >& vSolutionsRet);
-int ScriptSigArgsExpected(txnouttype t, const std::vector<std::vector<unsigned char> >& vSolutions);
-bool IsStandard(const CScript& scriptPubKey, txnouttype& whichType);
isminetype IsMine(const CKeyStore& keystore, const CScript& scriptPubKey);
isminetype IsMine(const CKeyStore& keystore, const CTxDestination& dest);
void ExtractAffectedKeys(const CKeyStore &keystore, const CScript& scriptPubKey, std::vector<CKeyID> &vKeys);
-bool ExtractDestination(const CScript& scriptPubKey, CTxDestination& addressRet);
-bool ExtractDestinations(const CScript& scriptPubKey, txnouttype& typeRet, std::vector<CTxDestination>& addressRet, int& nRequiredRet);
bool SignSignature(const CKeyStore& keystore, const CScript& fromPubKey, CMutableTransaction& txTo, unsigned int nIn, int nHashType=SIGHASH_ALL);
bool SignSignature(const CKeyStore& keystore, const CTransaction& txFrom, CMutableTransaction& txTo, unsigned int nIn, int nHashType=SIGHASH_ALL);