diff --git a/src/cc/CCinclude.h b/src/cc/CCinclude.h index 0f0348ebb..94d8d5b2c 100644 --- a/src/cc/CCinclude.h +++ b/src/cc/CCinclude.h @@ -69,6 +69,7 @@ bool PreventCC(Eval* eval,const CTransaction &tx,int32_t preventCCvins,int32_t n bool Getscriptaddress(char *destaddr,const CScript &scriptPubKey); std::vector Mypubkey(); bool Myprivkey(uint8_t myprivkey[]); +int64_t CCduration(uint256 txid); // CCtx std::string FinalizeCCTx(struct CCcontract_info *cp,CMutableTransaction &mtx,CPubKey mypk,uint64_t txfee,CScript opret); diff --git a/src/cc/CCutils.cpp b/src/cc/CCutils.cpp index b68d1061b..af92b69a3 100644 --- a/src/cc/CCutils.cpp +++ b/src/cc/CCutils.cpp @@ -268,3 +268,14 @@ bool ProcessCC(struct CCcontract_info *cp,Eval* eval, std::vector param return(false); } +int64_t CCduration(uint256 txid) +{ + CTransaction tx; uint256 hashBlock; int64_t duration = 0; + if ( GetTransaction(txid,tx,hashBlock,false) == 0 ) + { + fprintf(stderr,"cant find duration txid\n"); + return(0); + } + return(duration); +} +