From 28029a846f420114feea33845069f72ad85b61c8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 18 Nov 2018 04:28:51 -1100 Subject: [PATCH] Revert GetScriptaddres --- src/cc/CCutils.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/cc/CCutils.cpp b/src/cc/CCutils.cpp index 3ce1d5eeb..2b781ade3 100644 --- a/src/cc/CCutils.cpp +++ b/src/cc/CCutils.cpp @@ -186,7 +186,7 @@ void CCaddr3set(struct CCcontract_info *cp,uint8_t evalcode,CPubKey pk,uint8_t * strcpy(cp->unspendableaddr3,coinaddr); } -bool Getscriptaddress(char *destaddr,const CScript &scriptPubKey) +/*bool Getscriptaddress(char *destaddr,const CScript &scriptPubKey) { CTxDestination address; txnouttype whichType; @@ -199,6 +199,18 @@ bool Getscriptaddress(char *destaddr,const CScript &scriptPubKey) } fprintf(stderr,"Solver for scriptPubKey failed\n%s\n", scriptPubKey.ToString().c_str()); return(false); +}*/ + +bool Getscriptaddress(char *destaddr,const CScript &scriptPubKey) +{ + CTxDestination address; txnouttype whichType; + if ( ExtractDestination(scriptPubKey,address) != 0 ) + { + strcpy(destaddr,(char *)CBitcoinAddress(address).ToString().c_str()); + return(true); + } + //fprintf(stderr,"ExtractDestination failed\n"); + return(false); } bool GetCCParams(Eval* eval, const CTransaction &tx, uint32_t nIn,