Changeset View
Changeset View
Standalone View
Standalone View
src/script/interpreter.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 | ||||
// Copyright (c) 2017-2018 The Bitcoin developers | // Copyright (c) 2017-2018 The Bitcoin 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 "interpreter.h" | #include <script/interpreter.h> | ||||
#include "crypto/ripemd160.h" | #include <crypto/ripemd160.h> | ||||
#include "crypto/sha1.h" | #include <crypto/sha1.h> | ||||
#include "crypto/sha256.h" | #include <crypto/sha256.h> | ||||
#include "primitives/transaction.h" | #include <primitives/transaction.h> | ||||
#include "pubkey.h" | #include <pubkey.h> | ||||
#include "script/script.h" | #include <script/script.h> | ||||
#include "script/script_flags.h" | #include <script/script_flags.h> | ||||
#include "script/sigencoding.h" | #include <script/sigencoding.h> | ||||
#include "uint256.h" | #include <uint256.h> | ||||
bool CastToBool(const valtype &vch) { | bool CastToBool(const valtype &vch) { | ||||
for (size_t i = 0; i < vch.size(); i++) { | for (size_t i = 0; i < vch.size(); i++) { | ||||
if (vch[i] != 0) { | if (vch[i] != 0) { | ||||
// Can be negative zero | // Can be negative zero | ||||
if (i == vch.size() - 1 && vch[i] == 0x80) { | if (i == vch.size() - 1 && vch[i] == 0x80) { | ||||
return false; | return false; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,652 Lines • Show Last 20 Lines |