Sync with latest Komodo changes

This commit is contained in:
Michael Toutonghi
2018-08-06 12:52:22 -07:00
150 changed files with 10076 additions and 2162 deletions

View File

@@ -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;
}
@@ -74,6 +76,14 @@ bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, vector<vector<unsi
if (scriptPubKey.IsPayToCryptoCondition()) {
if (scriptPubKey.MayAcceptCryptoCondition()) {
typeRet = TX_CRYPTOCONDITION;
vector<unsigned char> hashBytes; uint160 x; int32_t i; uint8_t hash20[20],*ptr;;
x = Hash160(scriptPubKey);
memcpy(hash20,&x,20);
hashBytes.resize(20);
ptr = hashBytes.data();
for (i=0; i<20; i++)
ptr[i] = hash20[i];
vSolutionsRet.push_back(hashBytes);
return true;
}
return false;
@@ -263,6 +273,12 @@ bool ExtractDestination(const CScript& _scriptPubKey, CTxDestination& addressRet
addressRet = CScriptID(uint160(vSolutions[0]));
return true;
}
else if (IsCryptoConditionsEnabled() != 0 && whichType == TX_CRYPTOCONDITION)
{
addressRet = CKeyID(uint160(vSolutions[0]));
return true;
}
// Multisig txns have more than one address...
return false;
}
@@ -314,7 +330,9 @@ bool ExtractDestinations(const CScript& scriptPubKey, txnouttype& typeRet, vecto
nRequiredRet = 1;
CTxDestination address;
if (!ExtractDestination(scriptPubKey, address))
{
return false;
}
addressRet.push_back(address);
}