Changeset View
Changeset View
Standalone View
Standalone View
src/script/interpreter.h
// 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. | ||||
#ifndef BITCOIN_SCRIPT_INTERPRETER_H | #ifndef BITCOIN_SCRIPT_INTERPRETER_H | ||||
#define BITCOIN_SCRIPT_INTERPRETER_H | #define BITCOIN_SCRIPT_INTERPRETER_H | ||||
#include "primitives/transaction.h" | #include "primitives/transaction.h" | ||||
#include "script_error.h" | #include "script_error.h" | ||||
#include <stdint.h> | #include <cstdint> | ||||
#include <string> | #include <string> | ||||
#include <vector> | #include <vector> | ||||
class CPubKey; | class CPubKey; | ||||
class CScript; | class CScript; | ||||
class CTransaction; | class CTransaction; | ||||
class uint256; | class uint256; | ||||
▲ Show 20 Lines • Show All 95 Lines • ▼ Show 20 Lines | enum { | ||||
// Do we accept signature using SIGHASH_FORKID | // Do we accept signature using SIGHASH_FORKID | ||||
// | // | ||||
SCRIPT_ENABLE_SIGHASH_FORKID = (1U << 16), | SCRIPT_ENABLE_SIGHASH_FORKID = (1U << 16), | ||||
}; | }; | ||||
bool CheckSignatureEncoding(const std::vector<unsigned char> &vchSig, | bool CheckSignatureEncoding(const std::vector<unsigned char> &vchSig, | ||||
unsigned int flags, ScriptError *serror); | unsigned int flags, ScriptError *serror); | ||||
struct PrecomputedTransactionData { | |||||
uint256 hashPrevouts, hashSequence, hashOutputs; | |||||
PrecomputedTransactionData(const CTransaction &tx); | |||||
}; | |||||
uint256 SignatureHash(const CScript &scriptCode, const CTransaction &txTo, | uint256 SignatureHash(const CScript &scriptCode, const CTransaction &txTo, | ||||
unsigned int nIn, uint32_t nHashType, | unsigned int nIn, uint32_t nHashType, | ||||
const CAmount &amount, | const CAmount &amount, | ||||
const PrecomputedTransactionData *cache = NULL); | const PrecomputedTransactionData *cache = NULL); | ||||
class BaseSignatureChecker { | class BaseSignatureChecker { | ||||
public: | public: | ||||
virtual bool CheckSig(const std::vector<unsigned char> &scriptSig, | virtual bool CheckSig(const std::vector<unsigned char> &scriptSig, | ||||
▲ Show 20 Lines • Show All 62 Lines • Show Last 20 Lines |