test
This commit is contained in:
@@ -408,8 +408,8 @@ CAmount CCoinsViewCache::GetValueIn(int32_t nHeight,int64_t *interestp,const CTr
|
|||||||
}
|
}
|
||||||
nResult += interest;
|
nResult += interest;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
(*interestp) += interest;
|
(*interestp) += interest;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
nResult += tx.GetJoinSplitValueIn();
|
nResult += tx.GetJoinSplitValueIn();
|
||||||
|
|
||||||
|
|||||||
@@ -87,14 +87,14 @@ public:
|
|||||||
//! version of the CTransaction; accesses to this value should probably check for nHeight as well,
|
//! 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
|
//! as new tx version will probably only be introduced at certain heights
|
||||||
int nVersion;
|
int nVersion;
|
||||||
uint32_t nLockTime;
|
//uint32_t nLockTime;
|
||||||
|
|
||||||
void FromTx(const CTransaction &tx, int nHeightIn) {
|
void FromTx(const CTransaction &tx, int nHeightIn) {
|
||||||
fCoinBase = tx.IsCoinBase();
|
fCoinBase = tx.IsCoinBase();
|
||||||
vout = tx.vout;
|
vout = tx.vout;
|
||||||
nHeight = nHeightIn;
|
nHeight = nHeightIn;
|
||||||
nVersion = tx.nVersion;
|
nVersion = tx.nVersion;
|
||||||
nLockTime = tx.nLockTime;
|
//nLockTime = tx.nLockTime;
|
||||||
ClearUnspendable();
|
ClearUnspendable();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
#define H_KOMODO_H
|
#define H_KOMODO_H
|
||||||
|
|
||||||
// Todo:
|
// Todo:
|
||||||
|
// 00. standardize interests
|
||||||
// 0. optimize assetchains RT loop
|
// 0. optimize assetchains RT loop
|
||||||
// 1. error check fiat redeem amounts
|
// 1. error check fiat redeem amounts
|
||||||
// 2. net balance limiter
|
// 2. net balance limiter
|
||||||
|
|||||||
@@ -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))
|
if (fNegative || bnTarget == 0 || fOverflow || bnTarget > UintToArith256(params.powLimit))
|
||||||
return error("CheckProofOfWork(): nBits below minimum work");
|
return error("CheckProofOfWork(): nBits below minimum work");
|
||||||
if ( height > 70000 )
|
//if ( height > 70000 )
|
||||||
bnTarget /= 64;
|
// bnTarget /= 64;
|
||||||
// Check proof of work matches claimed amount
|
// Check proof of work matches claimed amount
|
||||||
if ( UintToArith256(hash) > bnTarget )
|
if ( UintToArith256(hash) > bnTarget )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -577,6 +577,7 @@ Value gettxout(const Array& params, bool fHelp)
|
|||||||
|
|
||||||
CBlockIndex *pblockindex = chainActive[coins.nHeight];
|
CBlockIndex *pblockindex = chainActive[coins.nHeight];
|
||||||
uint64_t interest; uint32_t timestamp=0;
|
uint64_t interest; uint32_t timestamp=0;
|
||||||
|
|
||||||
if ( pblockindex != 0 )
|
if ( pblockindex != 0 )
|
||||||
timestamp = pblockindex->nTime; // this is approx, but cant figure out how to get tx here
|
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);
|
interest = komodo_interest(coins.nHeight,coins.vout[n].nValue,timestamp,pindex->nTime);
|
||||||
|
|||||||
@@ -251,6 +251,23 @@ Value getrawtransaction(const Array& params, bool fHelp)
|
|||||||
return result;
|
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)
|
Value gettxoutproof(const Array& params, bool fHelp)
|
||||||
{
|
{
|
||||||
if (fHelp || (params.size() != 1 && params.size() != 2))
|
if (fHelp || (params.size() != 1 && params.size() != 2))
|
||||||
|
|||||||
Reference in New Issue
Block a user