Browse Source

test

pull/4/head
jl777 8 years ago
parent
commit
a130c5cb66
  1. 2
      src/coins.cpp
  2. 4
      src/coins.h
  3. 1
      src/komodo.h
  4. 4
      src/pow.cpp
  5. 1
      src/rpcblockchain.cpp
  6. 17
      src/rpcrawtransaction.cpp

2
src/coins.cpp

@ -408,8 +408,8 @@ CAmount CCoinsViewCache::GetValueIn(int32_t nHeight,int64_t *interestp,const CTr
}
nResult += interest;
}
#endif
(*interestp) += interest;
#endif
}
nResult += tx.GetJoinSplitValueIn();

4
src/coins.h

@ -87,14 +87,14 @@ public:
//! version of the CTransaction; accesses to this value should probably check for nHeight as well,
//! as new tx version will probably only be introduced at certain heights
int nVersion;
uint32_t nLockTime;
//uint32_t nLockTime;
void FromTx(const CTransaction &tx, int nHeightIn) {
fCoinBase = tx.IsCoinBase();
vout = tx.vout;
nHeight = nHeightIn;
nVersion = tx.nVersion;
nLockTime = tx.nLockTime;
//nLockTime = tx.nLockTime;
ClearUnspendable();
}

1
src/komodo.h

@ -17,6 +17,7 @@
#define H_KOMODO_H
// Todo:
// 00. standardize interests
// 0. optimize assetchains RT loop
// 1. error check fiat redeem amounts
// 2. net balance limiter

4
src/pow.cpp

@ -155,8 +155,8 @@ bool CheckProofOfWork(int32_t height,uint8_t *pubkey33,uint256 hash, unsigned in
}
if (fNegative || bnTarget == 0 || fOverflow || bnTarget > UintToArith256(params.powLimit))
return error("CheckProofOfWork(): nBits below minimum work");
if ( height > 70000 )
bnTarget /= 64;
//if ( height > 70000 )
// bnTarget /= 64;
// Check proof of work matches claimed amount
if ( UintToArith256(hash) > bnTarget )
{

1
src/rpcblockchain.cpp

@ -577,6 +577,7 @@ Value gettxout(const Array& params, bool fHelp)
CBlockIndex *pblockindex = chainActive[coins.nHeight];
uint64_t interest; uint32_t timestamp=0;
if ( pblockindex != 0 )
timestamp = pblockindex->nTime; // this is approx, but cant figure out how to get tx here
interest = komodo_interest(coins.nHeight,coins.vout[n].nValue,timestamp,pindex->nTime);

17
src/rpcrawtransaction.cpp

@ -251,6 +251,23 @@ Value getrawtransaction(const Array& params, bool fHelp)
return result;
}
uint32_t komodo_interest_args(int32_t *prevblockheightp,int32_t *prevblocktimep,uint64_t *valuep,uint256 hash,int32_t n)
{
//interest = komodo_interest(pindex->nHeight,txout.nValue,tx.nLockTime,pindex->nTime);
LOCK(cs_main);
CTransaction tx;
uint256 hashBlock;
if ( !GetTransaction(hash,tx,hashBlock,true) )
return(0);
uint32_t locktime = 0;
if ( n < tx.vout.size() )
{
locktime = tx.nLockTime;
//TxToJSON(tx,hashBlock,result);
}
return(locktime);
}
Value gettxoutproof(const Array& params, bool fHelp)
{
if (fHelp || (params.size() != 1 && params.size() != 2))

Loading…
Cancel
Save