From 60c8bda1305697f429364c0b74309222968b10e1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 23 Feb 2019 23:09:13 -1100 Subject: [PATCH] Opret --- src/cc/dilithium.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/cc/dilithium.c b/src/cc/dilithium.c index 8406b0c00..47c447f88 100644 --- a/src/cc/dilithium.c +++ b/src/cc/dilithium.c @@ -2909,6 +2909,24 @@ uint8_t dilithium_registeropretdecode(std::string &handle,CPubKey &pk,std::vecto return(0); } +CScript dilithium_sendopret(uint256 destpubtxid) +{ + CScript opret; uint8_t evalcode = EVAL_DILITHIUM; + opret << OP_RETURN << E_MARSHAL(ss << evalcode << 'x' << destpubtxid); + return(opret); +} + +uint8_t dilithium_sendopretdecode(uint256 &destpubtxid,CScript scriptPubKey) +{ + std::vector vopret; uint8_t e,f; + GetOpReturnData(scriptPubKey,vopret); + if ( vopret.size() > 2 && E_UNMARSHAL(vopret,ss >> e; ss >> f; ss >> handle; ss >> destpubtxid) != 0 && e == EVAL_DILITHIUM && f == 'x' ) + { + return(f); + } + return(0); +} + UniValue dilithium_rawtxresult(UniValue &result,std::string rawtx) { CTransaction tx;