From 689eff3aa00cc10a3c629c4c64c71b60955c0e71 Mon Sep 17 00:00:00 2001 From: Alexander Block Date: Fri, 20 Sep 2019 19:36:28 +0200 Subject: [PATCH] Drop unused GetScriptForWitness --- src/script/standard.cpp | 23 ----------------------- src/script/standard.h | 1 - 2 files changed, 24 deletions(-) diff --git a/src/script/standard.cpp b/src/script/standard.cpp index 17c1d1af0a..a6958f5173 100644 --- a/src/script/standard.cpp +++ b/src/script/standard.cpp @@ -279,26 +279,3 @@ CScript GetScriptForMultisig(int nRequired, const std::vector& keys) script << CScript::EncodeOP_N(keys.size()) << OP_CHECKMULTISIG; return script; } - -CScript GetScriptForWitness(const CScript& redeemscript) -{ - CScript ret; - - txnouttype typ; - std::vector > vSolutions; - if (Solver(redeemscript, typ, vSolutions)) { - if (typ == TX_PUBKEY) { - unsigned char h160[20]; - CHash160().Write(&vSolutions[0][0], vSolutions[0].size()).Finalize(h160); - ret << OP_0 << std::vector(&h160[0], &h160[20]); - return ret; - } else if (typ == TX_PUBKEYHASH) { - ret << OP_0 << vSolutions[0]; - return ret; - } - } - uint256 hash; - CSHA256().Write(&redeemscript[0], redeemscript.size()).Finalize(hash.begin()); - ret << OP_0 << ToByteVector(hash); - return ret; -} diff --git a/src/script/standard.h b/src/script/standard.h index d355d0dae9..f348da8e19 100644 --- a/src/script/standard.h +++ b/src/script/standard.h @@ -77,6 +77,5 @@ bool ExtractDestinations(const CScript& scriptPubKey, txnouttype& typeRet, std:: CScript GetScriptForDestination(const CTxDestination& dest); CScript GetScriptForRawPubKey(const CPubKey& pubkey); CScript GetScriptForMultisig(int nRequired, const std::vector& keys); -CScript GetScriptForWitness(const CScript& redeemscript); #endif // BITCOIN_SCRIPT_STANDARD_H