diff --git a/src/hush_nSPV_wallet.h b/src/hush_nSPV_wallet.h index 5e329aa2a..85075e29f 100644 --- a/src/hush_nSPV_wallet.h +++ b/src/hush_nSPV_wallet.h @@ -322,31 +322,14 @@ UniValue NSPV_spend(char *srcaddr,char *destaddr,int64_t satoshis) // what its a } else if ( bitcoin_base58decode(rmd160,destaddr) != 25 ) { - if ( (len= is_hexstr(destaddr,0)) > 0 ) - { - len >>= 1; - data.resize(len); - decode_hex(&data[0],len,destaddr); - if ( data[len-1] == OP_CHECKCRYPTOCONDITION ) - { - data.resize(--len); - scriptPubKey = CScript() << data << OP_CHECKCRYPTOCONDITION; - } - else - { - result.push_back(Pair("result","error")); - result.push_back(Pair("error","only CC hex allowed for now")); - return(result); } - } - else - { + if ( (len= is_hexstr(destaddr,0)) > 0 ) { + result.push_back(Pair("result","error")); + return(result); + } else { result.push_back(Pair("result","error")); - result.push_back(Pair("error","invalid destaddr/CCvout hex")); return(result); } - } - else - { + } else { data.resize(20); memcpy(&data[0],&rmd160[1],20); scriptPubKey = (CScript() << OP_DUP << OP_HASH160 << ParseHex(HexStr(data)) << OP_EQUALVERIFY << OP_CHECKSIG); diff --git a/src/main.cpp b/src/main.cpp index c2df1a3e5..a60821d03 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -994,11 +994,10 @@ bool IsStandardTx(const CTransaction& tx, string& reason, const int nHeight) } nDataOut++; //fprintf(stderr,"is OP_RETURN\n"); - } - else if ((whichType == TX_MULTISIG) && (!fIsBareMultisigStd)) { + } else if ((whichType == TX_MULTISIG) && (!fIsBareMultisigStd)) { reason = "bare-multisig"; return false; - } else if (whichType != TX_CRYPTOCONDITION && txout.IsDust(::minRelayTxFee)) { + } else if (txout.IsDust(::minRelayTxFee)) { reason = "dust"; return false; } diff --git a/src/script/script.cpp b/src/script/script.cpp index 532227741..09b876ed9 100644 --- a/src/script/script.cpp +++ b/src/script/script.cpp @@ -156,9 +156,6 @@ const char* GetOpName(opcodetype opcode) case OP_CHECKSIGVERIFY : return "OP_CHECKSIGVERIFY"; case OP_CHECKMULTISIG : return "OP_CHECKMULTISIG"; case OP_CHECKMULTISIGVERIFY : return "OP_CHECKMULTISIGVERIFY"; - case OP_CHECKCRYPTOCONDITION : return "OP_CHECKCRYPTOCONDITION"; - case OP_CHECKCRYPTOCONDITIONVERIFY - : return "OP_CHECKCRYPTOCONDITIONVERIFY"; // expansion case OP_NOP1 : return "OP_NOP1"; diff --git a/src/script/script.h b/src/script/script.h index cc35f0364..b3d1d203f 100644 --- a/src/script/script.h +++ b/src/script/script.h @@ -40,9 +40,6 @@ static const unsigned int MAX_SCRIPT_ELEMENT_SIZE = 520; // bytes -// Max size of pushdata in a CC sig in bytes -static const unsigned int MAX_SCRIPT_CRYPTOCONDITION_FULFILLMENT_SIZE = 2048; - // Maximum script length in bytes static const int MAX_SCRIPT_SIZE = 10000; @@ -178,8 +175,6 @@ enum opcodetype OP_CHECKSIGVERIFY = 0xad, OP_CHECKMULTISIG = 0xae, OP_CHECKMULTISIGVERIFY = 0xaf, - OP_CHECKCRYPTOCONDITION = 0xcc, - OP_CHECKCRYPTOCONDITIONVERIFY = 0xcd, // expansion OP_NOP1 = 0xb0, @@ -200,7 +195,6 @@ enum opcodetype OP_PUBKEYS = 0xfb, OP_PUBKEYHASH = 0xfd, OP_PUBKEY = 0xfe, - OP_CRYPTOCONDITION = 0xfc, OP_INVALIDOPCODE = 0xff, }; diff --git a/src/script/script_error.cpp b/src/script/script_error.cpp index cd1989e44..5529362d6 100644 --- a/src/script/script_error.cpp +++ b/src/script/script_error.cpp @@ -83,8 +83,6 @@ const char* ScriptErrorString(const ScriptError serror) return "NOPx reserved for soft-fork upgrades"; case SCRIPT_ERR_PUBKEYTYPE: return "Public key is neither compressed or uncompressed"; - case SCRIPT_ERR_CRYPTOCONDITION_INVALID_FULFILLMENT: - return "Crypto-Condition payload is invalid"; case SCRIPT_ERR_UNKNOWN_ERROR: case SCRIPT_ERR_ERROR_COUNT: default: break; diff --git a/src/script/script_error.h b/src/script/script_error.h index d34e715a6..278852f6e 100644 --- a/src/script/script_error.h +++ b/src/script/script_error.h @@ -70,9 +70,6 @@ typedef enum ScriptError_t SCRIPT_ERR_ERROR_COUNT, - /* crypto-condition script errors */ - SCRIPT_ERR_CRYPTOCONDITION_VERIFY, - SCRIPT_ERR_CRYPTOCONDITION_INVALID_FULFILLMENT } ScriptError; #define SCRIPT_ERR_LAST SCRIPT_ERR_ERROR_COUNT diff --git a/src/script/sign.cpp b/src/script/sign.cpp index 245806733..afc778d4b 100644 --- a/src/script/sign.cpp +++ b/src/script/sign.cpp @@ -128,29 +128,6 @@ static bool SignN(const vector& multisigdata, const BaseSignatureCreato return nSigned==nRequired; } -std::vector &GetCryptoConditions() -{ - static bool initialized = false; - static std::vector vCC = std::vector(); - CCcontract_info C; - - if (!initialized) - { - // this should initialize any desired auto-signed crypto-conditions - } - return vCC; -} - -bool GetCCByUnspendableAddress(struct CCcontract_info *cp, char *addrstr) -{ - return false; -} - -bool CCinitLite(struct CCcontract_info *cp, uint8_t evalcode) -{ - return false; -} - bool _Getscriptaddress(char *destaddr, const CScript &scriptPubKey) { CTxDestination address; @@ -239,9 +216,6 @@ static bool SignStep(const BaseSignatureCreator& creator, const CScript& scriptP } return false; - case TX_CRYPTOCONDITION: - return SignStepCC(creator, scriptPubKey, vSolutions, ret, consensusBranchId); - case TX_MULTISIG: ret.push_back(valtype()); // workaround CHECKMULTISIG bug return (SignN(vSolutions, creator, scriptPubKey, ret, consensusBranchId)); @@ -429,11 +403,6 @@ static Stacks CombineSignatures(const CScript& scriptPubKey, const BaseSignature return sigs2; case TX_PUBKEY: case TX_PUBKEYHASH: - case TX_CRYPTOCONDITION: - // Signatures are bigger than placeholders or empty scripts: - if (sigs1.script.empty() || sigs1.script[0].empty()) - return sigs2; - return sigs1; case TX_SCRIPTHASH: if (sigs1.script.empty() || sigs1.script.back().empty()) return sigs2; diff --git a/src/script/standard.cpp b/src/script/standard.cpp index 23ffc0ff9..637da08ec 100644 --- a/src/script/standard.cpp +++ b/src/script/standard.cpp @@ -143,7 +143,6 @@ const char* GetTxnOutputType(txnouttype t) case TX_SCRIPTHASH: return "scripthash"; case TX_MULTISIG: return "multisig"; case TX_NULL_DATA: return "nulldata"; - case TX_CRYPTOCONDITION: return "cryptocondition"; default: return "invalid"; } return NULL; @@ -294,8 +293,6 @@ int ScriptSigArgsExpected(txnouttype t, const std::vector(hashBytes.begin(), hashBytes.end())); - } - } if (txType == TX_SCRIPTHASH) { keyType = 2; @@ -190,11 +182,6 @@ void CTxMemPool::addAddressIndex(const CTxMemPoolEntry &entry, const CCoinsViewC // if we failed to solve, and got a vDest, assume P2PKH or P2PK address returned if (vDest.which()) { - uint160 hashBytes; - if (CBitcoinAddress(vDest).GetIndexKey(hashBytes, keyType, out.scriptPubKey.IsPayToCryptoCondition())) - { - vSols.push_back(vector(hashBytes.begin(), hashBytes.end())); - } } else if (txType == TX_SCRIPTHASH) { diff --git a/src/wallet/wallet_ismine.cpp b/src/wallet/wallet_ismine.cpp index c80e37d9a..5897f2bbf 100644 --- a/src/wallet/wallet_ismine.cpp +++ b/src/wallet/wallet_ismine.cpp @@ -78,16 +78,6 @@ isminetype IsMine(const CKeyStore &keystore, const CScript& _scriptPubKey) case TX_NONSTANDARD: case TX_NULL_DATA: break; - case TX_CRYPTOCONDITION: - // for now, default is that the first value returned will be the script, subsequent values will be - // pubkeys. if we have the first pub key in our wallet, we consider this spendable - if (vSolutions.size() > 1) - { - keyID = CPubKey(vSolutions[1]).GetID(); - if (keystore.HaveKey(keyID)) - return ISMINE_SPENDABLE; - } - break; case TX_PUBKEY: keyID = CPubKey(vSolutions[0]).GetID(); if (keystore.HaveKey(keyID))