Remove libcryptoconditions dependency #381
This commit is contained in:
@@ -25,7 +25,6 @@
|
||||
#include "util/strencodings.h"
|
||||
#include "script/cc.h"
|
||||
#include "cc/eval.h"
|
||||
#include "cryptoconditions/include/cryptoconditions.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
@@ -363,50 +362,22 @@ bool CScript::GetOpretData(std::vector<std::vector<unsigned char>>& vData) const
|
||||
|
||||
bool CScript::IsPayToCryptoCondition(CScript *pCCSubScript, std::vector<std::vector<unsigned char>>& vParams) const
|
||||
{
|
||||
const_iterator pc = begin();
|
||||
vector<unsigned char> data;
|
||||
opcodetype opcode;
|
||||
if (this->GetOp(pc, opcode, data))
|
||||
// Sha256 conditions are <76 bytes
|
||||
if (opcode > OP_0 && opcode < OP_PUSHDATA1)
|
||||
if (this->GetOp(pc, opcode, data))
|
||||
if (opcode == OP_CHECKCRYPTOCONDITION)
|
||||
{
|
||||
const_iterator pcCCEnd = pc;
|
||||
if (GetBalancedData(pc, vParams))
|
||||
{
|
||||
if (pCCSubScript)
|
||||
*pCCSubScript = CScript(begin(),pcCCEnd);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CScript::IsPayToCryptoCondition(CScript *pCCSubScript) const
|
||||
{
|
||||
std::vector<std::vector<unsigned char>> vParams;
|
||||
return IsPayToCryptoCondition(pCCSubScript, vParams);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CScript::IsPayToCryptoCondition() const
|
||||
{
|
||||
return IsPayToCryptoCondition(NULL);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CScript::MayAcceptCryptoCondition() const
|
||||
{
|
||||
// Get the type mask of the condition
|
||||
const_iterator pc = this->begin();
|
||||
vector<unsigned char> data;
|
||||
opcodetype opcode;
|
||||
if (!this->GetOp(pc, opcode, data)) return false;
|
||||
if (!(opcode > OP_0 && opcode < OP_PUSHDATA1)) return false;
|
||||
CC *cond = cc_readConditionBinary(data.data(), data.size());
|
||||
if (!cond) return false;
|
||||
bool out = IsSupportedCryptoCondition(cond);
|
||||
cc_free(cond);
|
||||
return out;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CScript::IsCoinImport() const
|
||||
|
||||
Reference in New Issue
Block a user