From e596e202ca609518a5050e59746a029ed59fe51a Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 15 Nov 2016 10:56:34 -0300 Subject: [PATCH] test --- src/rpcblockchain.cpp | 21 ++++++++++++++++++++- src/rpcrawtransaction.cpp | 20 +------------------- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index 7c942d0e9..c0bf6fc5f 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -380,7 +380,6 @@ Value gettxoutsetinfo(const Array& params, bool fHelp) return ret; } -uint32_t komodo_interest_args(int32_t *txheightp,uint32_t *tiptimep,uint64_t *valuep,uint256 hash,int32_t n); uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uint32_t tiptime); uint32_t komodo_txtime(uint256 hash); uint64_t komodo_paxprice(uint64_t *seedp,int32_t height,char *base,char *rel,uint64_t basevolume); @@ -388,6 +387,26 @@ int32_t komodo_paxprices(int32_t *heights,uint64_t *prices,int32_t max,char *bas int32_t komodo_notaries(uint8_t pubkeys[64][33],int32_t height); char *bitcoin_address(char *coinaddr,uint8_t addrtype,uint8_t *pubkey_or_rmd160,int32_t len); +uint32_t komodo_interest_args(int32_t *txheightp,int32_t *tiptimep,uint64_t *valuep,uint256 hash,int32_t n) +{ + LOCK(cs_main); + CTransaction tx; uint256 hashBlock; CBlockIndex *pindex,*tipindex; + if ( !GetTransaction(hash,tx,hashBlock,true) ) + return(0); + uint32_t locktime = 0; + if ( n < tx.vout.size() ) + { + if ( (pindex= mapBlockIndex[hashBlock]) != 0 && (tipindex= chainActive.Tip()) != 0 ) + { + *valuep = tx.vout[n].nValue; + *txheightp = pindex->nHeight; + *tiptimep = tipindex->nTime; + locktime = tx.nLockTime; + } + } + return(locktime); +} + Value notaries(const Array& params, bool fHelp) { Array a; Object ret; int32_t i,j,n,m; char *hexstr; uint8_t pubkeys[64][33]; char btcaddr[64],kmdaddr[64],*ptr; diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp index aff59f850..04a6238c5 100644 --- a/src/rpcrawtransaction.cpp +++ b/src/rpcrawtransaction.cpp @@ -253,25 +253,7 @@ Value getrawtransaction(const Array& params, bool fHelp) return result; } -uint32_t komodo_interest_args(int32_t *txheightp,int32_t *tiptimep,uint64_t *valuep,uint256 hash,int32_t n) -{ - LOCK(cs_main); - CTransaction tx; uint256 hashBlock; CBlockIndex *pindex,*tipindex; - if ( !GetTransaction(hash,tx,hashBlock,true) ) - return(0); - uint32_t locktime = 0; - if ( n < tx.vout.size() ) - { - if ( (pindex= mapBlockIndex[hashBlock]) != 0 && (tipindex= chainActive.Tip()) != 0 ) - { - *valuep = tx.vout[n].nValue; - *txheightp = pindex->nHeight; - *tiptimep = tipindex->nTime; - locktime = tx.nLockTime; - } - } - return(locktime); -} +uint32_t komodo_interest_args(int32_t *txheightp,int32_t *tiptimep,uint64_t *valuep,uint256 hash,int32_t n); Value gettxoutproof(const Array& params, bool fHelp) {