Browse Source

Fix out type

pull/4/head
jl777 6 years ago
parent
commit
e512c055ac
  1. 1
      src/rpcrawtransaction.cpp
  2. 7
      src/script/standard.cpp

1
src/rpcrawtransaction.cpp

@ -46,6 +46,7 @@ void ScriptPubKeyToJSON(const CScript& scriptPubKey, UniValue& out, bool fInclud
out.push_back(Pair("hex", HexStr(scriptPubKey.begin(), scriptPubKey.end())));
if (!ExtractDestinations(scriptPubKey, type, addresses, nRequired)) {
fprintf(stderr,"extractdestinations error\n");
out.push_back(Pair("type", GetTxnOutputType(type)));
return;
}

7
src/script/standard.cpp

@ -31,6 +31,8 @@ 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;
}
@ -260,7 +262,7 @@ bool ExtractDestination(const CScript& scriptPubKey, CTxDestination& addressRet)
return true;
}
else if ( whichType == TX_CRYPTOCONDITION)
else if (IsCryptoConditionsEnabled() != 0 && whichType == TX_CRYPTOCONDITION)
{
fprintf(stderr,"found CC type\n");
addressRet = CScriptID(uint160(vSolutions[0]));
@ -303,7 +305,10 @@ bool ExtractDestinations(const CScript& scriptPubKey, txnouttype& typeRet, vecto
nRequiredRet = 1;
CTxDestination address;
if (!ExtractDestination(scriptPubKey, address))
{
fprintf(stderr,"error extractdestination from extractdestinations\n");
return false;
}
addressRet.push_back(address);
}

Loading…
Cancel
Save