Channel definition

This commit is contained in:
jl777
2018-08-22 00:01:11 -11:00
parent 2cd8440c09
commit 2492726dde
2 changed files with 28 additions and 8 deletions

View File

@@ -19,14 +19,6 @@
CCutils has low level functions that are universally useful for all contracts.
*/
CTxOut MakeCC1vout(uint8_t evalcode,CAmount nValue,CPubKey pk)
{
CTxOut vout;
CC *payoutCond = MakeCCcond1(evalcode,pk);
vout = CTxOut(nValue,CCPubKey(payoutCond));
cc_free(payoutCond);
return(vout);
}
CC *MakeCCcond1(uint8_t evalcode,CPubKey pk)
{
@@ -37,6 +29,15 @@ CC *MakeCCcond1(uint8_t evalcode,CPubKey pk)
return CCNewThreshold(2, {condCC, Sig});
}
CTxOut MakeCC1vout(uint8_t evalcode,CAmount nValue,CPubKey pk)
{
CTxOut vout;
CC *payoutCond = MakeCCcond1(evalcode,pk);
vout = CTxOut(nValue,CCPubKey(payoutCond));
cc_free(payoutCond);
return(vout);
}
CC* GetCryptoCondition(CScript const& scriptSig)
{
auto pc = scriptSig.begin();