Changeset View
Changeset View
Standalone View
Standalone View
src/script/standard.cpp
// 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. | ||||
#include <script/standard.h> | #include <script/standard.h> | ||||
#include <crypto/sha256.h> | #include <crypto/sha256.h> | ||||
#include <script/script.h> | #include <script/script.h> | ||||
#include <string> | #include <string> | ||||
typedef std::vector<uint8_t> valtype; | typedef std::vector<uint8_t> valtype; | ||||
bool fAcceptDatacarrier = DEFAULT_ACCEPT_DATACARRIER; | bool fAcceptDatacarrier = DEFAULT_ACCEPT_DATACARRIER; | ||||
CScriptID::CScriptID(const CScript &in) | CScriptID::CScriptID(const CScript &in) : BaseHash(Hash160(in)) {} | ||||
: BaseHash(Hash160(in.begin(), in.end())) {} | |||||
CScriptID::CScriptID(const ScriptHash &in) | CScriptID::CScriptID(const ScriptHash &in) | ||||
: BaseHash(static_cast<uint160>(in)) {} | : BaseHash(static_cast<uint160>(in)) {} | ||||
ScriptHash::ScriptHash(const CScript &in) | ScriptHash::ScriptHash(const CScript &in) : BaseHash(Hash160(in)) {} | ||||
: BaseHash(Hash160(in.begin(), in.end())) {} | |||||
ScriptHash::ScriptHash(const CScriptID &in) | ScriptHash::ScriptHash(const CScriptID &in) | ||||
: BaseHash(static_cast<uint160>(in)) {} | : BaseHash(static_cast<uint160>(in)) {} | ||||
PKHash::PKHash(const CPubKey &pubkey) : BaseHash(pubkey.GetID()) {} | PKHash::PKHash(const CPubKey &pubkey) : BaseHash(pubkey.GetID()) {} | ||||
PKHash::PKHash(const CKeyID &pubkey_id) : BaseHash(pubkey_id) {} | PKHash::PKHash(const CKeyID &pubkey_id) : BaseHash(pubkey_id) {} | ||||
CKeyID ToKeyID(const PKHash &key_hash) { | CKeyID ToKeyID(const PKHash &key_hash) { | ||||
return CKeyID{static_cast<uint160>(key_hash)}; | return CKeyID{static_cast<uint160>(key_hash)}; | ||||
▲ Show 20 Lines • Show All 251 Lines • Show Last 20 Lines |