Changeset View
Changeset View
Standalone View
Standalone View
src/compressor.cpp
// Copyright (c) 2009-2010 Satoshi Nakamoto | // Copyright (c) 2009-2010 Satoshi Nakamoto | ||||
// Copyright (c) 2009-2014 The Bitcoin Core developers | // Copyright (c) 2009-2014 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 "compressor.h" | #include <compressor.h> | ||||
#include "hash.h" | #include <hash.h> | ||||
#include "pubkey.h" | #include <pubkey.h> | ||||
#include "script/standard.h" | #include <script/standard.h> | ||||
bool CScriptCompressor::IsToKeyID(CKeyID &hash) const { | bool CScriptCompressor::IsToKeyID(CKeyID &hash) const { | ||||
if (script.size() == 25 && script[0] == OP_DUP && script[1] == OP_HASH160 && | if (script.size() == 25 && script[0] == OP_DUP && script[1] == OP_HASH160 && | ||||
script[2] == 20 && script[23] == OP_EQUALVERIFY && | script[2] == 20 && script[23] == OP_EQUALVERIFY && | ||||
script[24] == OP_CHECKSIG) { | script[24] == OP_CHECKSIG) { | ||||
memcpy(&hash, &script[3], 20); | memcpy(&hash, &script[3], 20); | ||||
return true; | return true; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 167 Lines • Show Last 20 Lines |