struct CC_info

This commit is contained in:
jl777
2019-01-19 23:13:59 -11:00
parent 4223d927ad
commit 4ad5879f56

View File

@@ -28,7 +28,7 @@ class TokenHelper;
"The design requires the heir to spend all the funds at once" (this requirement was changed to "after the inactivity time both the heir and owner may freely spend available funds") "The design requires the heir to spend all the funds at once" (this requirement was changed to "after the inactivity time both the heir and owner may freely spend available funds")
After the first heir spending a flag is set that spending is allowed for the heir whether the owner adds more funds or spends them. After the first heir spending a flag is set that spending is allowed for the heir whether the owner adds more funds or spends them.
This Heir contract supports both coins and tokens. This Heir contract supports both coins and tokens.
*/ */
// tx validation code // tx validation code
@@ -234,9 +234,9 @@ bool HeirValidate(struct CC_info* cpHeir, Eval* eval, const CTransaction& tx, ui
// helper functions used in implementations of rpc calls (in rpcwallet.cpp) or validation code // helper functions used in implementations of rpc calls (in rpcwallet.cpp) or validation code
/** /**
* Checks if vout is to cryptocondition address * Checks if vout is to cryptocondition address
* @return vout value in satoshis * @return vout value in satoshis
*/ */
template <class Helper> int64_t IsHeirFundingVout(struct CC_info* cp, const CTransaction& tx, int32_t voutIndex, CPubKey ownerPubkey, CPubKey heirPubkey) template <class Helper> int64_t IsHeirFundingVout(struct CC_info* cp, const CTransaction& tx, int32_t voutIndex, CPubKey ownerPubkey, CPubKey heirPubkey)
{ {
char destaddr[65], heirFundingAddr[65]; char destaddr[65], heirFundingAddr[65];
@@ -321,9 +321,9 @@ uint8_t _DecodeHeirOpRet(std::vector<uint8_t> vopret, CPubKey& ownerPubkey, CPub
} }
/* not used, see DecodeHeirOpRet(vopret,...) /* not used, see DecodeHeirOpRet(vopret,...)
// overload for 'F' opret // overload for 'F' opret
uint8_t DecodeHeirOpRet(CScript scriptPubKey, CPubKey& ownerPubkey, CPubKey& heirPubkey, int64_t& inactivityTime, std::string& heirName, bool noLogging) uint8_t DecodeHeirOpRet(CScript scriptPubKey, CPubKey& ownerPubkey, CPubKey& heirPubkey, int64_t& inactivityTime, std::string& heirName, bool noLogging)
{ {
uint256 dummytxid; uint256 dummytxid;
uint8_t dummyHasHeirSpendingBegun; uint8_t dummyHasHeirSpendingBegun;
std::vector<uint8_t> vopret; std::vector<uint8_t> vopret;
@@ -334,13 +334,13 @@ uint8_t DecodeHeirOpRet(CScript scriptPubKey, CPubKey& ownerPubkey, CPubKey& hei
return (uint8_t)0; return (uint8_t)0;
} }
return _DecodeHeirOpRet(vopret, ownerPubkey, heirPubkey, inactivityTime, heirName, dummytxid, dummyHasHeirSpendingBegun, noLogging); return _DecodeHeirOpRet(vopret, ownerPubkey, heirPubkey, inactivityTime, heirName, dummytxid, dummyHasHeirSpendingBegun, noLogging);
}*/ }*/
/* not used, see DecodeHeirOpRet(vopret,...) /* not used, see DecodeHeirOpRet(vopret,...)
// overload for A, C oprets and AddHeirContractInputs // overload for A, C oprets and AddHeirContractInputs
uint8_t DecodeHeirOpRet(CScript scriptPubKey, uint256& fundingtxidInOpret, uint8_t &hasHeirSpendingBegun, bool noLogging) uint8_t DecodeHeirOpRet(CScript scriptPubKey, uint256& fundingtxidInOpret, uint8_t &hasHeirSpendingBegun, bool noLogging)
{ {
CPubKey dummyOwnerPubkey, dummyHeirPubkey; CPubKey dummyOwnerPubkey, dummyHeirPubkey;
int64_t dummyInactivityTime; int64_t dummyInactivityTime;
std::string dummyHeirName; std::string dummyHeirName;
@@ -353,7 +353,7 @@ uint8_t DecodeHeirOpRet(CScript scriptPubKey, uint256& fundingtxidInOpret, uint8
} }
return _DecodeHeirOpRet(vopret, dummyOwnerPubkey, dummyHeirPubkey, dummyInactivityTime, dummyHeirName, fundingtxidInOpret, hasHeirSpendingBegun, noLogging); return _DecodeHeirOpRet(vopret, dummyOwnerPubkey, dummyHeirPubkey, dummyInactivityTime, dummyHeirName, fundingtxidInOpret, hasHeirSpendingBegun, noLogging);
} */ } */
// decode combined opret: // decode combined opret:
uint8_t _DecodeHeirEitherOpRet(CScript scriptPubKey, uint256 &tokenid, CPubKey& ownerPubkey, CPubKey& heirPubkey, int64_t& inactivityTime, std::string& heirName, uint256& fundingTxidInOpret, uint8_t &hasHeirSpendingBegun, bool noLogging) uint8_t _DecodeHeirEitherOpRet(CScript scriptPubKey, uint256 &tokenid, CPubKey& ownerPubkey, CPubKey& heirPubkey, int64_t& inactivityTime, std::string& heirName, uint256& fundingTxidInOpret, uint8_t &hasHeirSpendingBegun, bool noLogging)
@@ -1185,3 +1185,4 @@ UniValue HeirList()
return result; return result;
} }