diff --git a/src/script/script.h b/src/script/script.h --- a/src/script/script.h +++ b/src/script/script.h @@ -527,7 +527,6 @@ } bool IsPayToScriptHash() const; - bool IsCommitment(const std::vector &data) const; bool IsWitnessProgram(int &version, std::vector &program) const; bool IsWitnessProgram() const; diff --git a/src/script/script.cpp b/src/script/script.cpp --- a/src/script/script.cpp +++ b/src/script/script.cpp @@ -376,27 +376,6 @@ (*this)[1] == 0x14 && (*this)[22] == OP_EQUAL); } -bool CScript::IsCommitment(const std::vector &data) const { - // To ensure we have an immediate push, we limit the commitment size to 64 - // bytes. In addition to the data themselves, we have 2 extra bytes: - // OP_RETURN and the push opcode itself. - if (data.size() > 64 || this->size() != data.size() + 2) { - return false; - } - - if ((*this)[0] != OP_RETURN || (*this)[1] != data.size()) { - return false; - } - - for (size_t i = 0; i < data.size(); i++) { - if ((*this)[i + 2] != data[i]) { - return false; - } - } - - return true; -} - // A witness program is any valid CScript that consists of a 1-byte push opcode // followed by a data push between 2 and 40 bytes. bool CScript::IsWitnessProgram(int &version, diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt --- a/src/test/CMakeLists.txt +++ b/src/test/CMakeLists.txt @@ -208,7 +208,6 @@ scheduler_tests.cpp schnorr_tests.cpp script_bitfield_tests.cpp - script_commitment_tests.cpp script_p2sh_tests.cpp script_standard_tests.cpp script_tests.cpp diff --git a/src/test/script_commitment_tests.cpp b/src/test/script_commitment_tests.cpp deleted file mode 100644 --- a/src/test/script_commitment_tests.cpp +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) 2017-2019 The Bitcoin developers -// Distributed under the MIT software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -#include