return coins->vout[input.prevout.n].scriptPubKey;
}
-uint32_t komodo_txtime(uint256 hash);
+uint32_t komodo_txtime(uint256 hash)
+{
+ CTransaction tx;
+ uint256 hashBlock;
+ if (!GetTransaction(hash, tx, hashBlock, true))
+ {
+ //printf("null GetTransaction\n");
+ return(tx.nLockTime);
+ }
+ if (!hashBlock.IsNull()) {
+ BlockMap::iterator mi = mapBlockIndex.find(hashBlock);
+ if (mi != mapBlockIndex.end() && (*mi).second)
+ {
+ CBlockIndex* pindex = (*mi).second;
+ if (chainActive.Contains(pindex))
+ return(pindex->GetBlockTime());
+ }
+ //printf("cant find in iterator\n");
+ }
+ //printf("null hashBlock\n");
+ return(tx.nLockTime);
+}
CAmount CCoinsViewCache::GetValueIn(const CTransaction& tx) const
{
CAmount nResult = 0;
for (unsigned int i = 0; i < tx.vin.size(); i++)
{
- fprintf(stderr,"i.%d time.%u\n",i,komodo_txtime(tx.vin[i].prevout.hash));
+ fprintf(stderr,"GetValueIn i.%d time.%u\n",i,komodo_txtime(tx.vin[i].prevout.hash));
nResult += GetOutputFor(tx.vin[i]).nValue;
}
nResult += tx.GetJoinSplitValueIn();
else return(0);
}
-uint32_t komodo_txtime(uint256 hash)
-{
- CTransaction tx;
- uint256 hashBlock;
- if (!GetTransaction(hash, tx, hashBlock, true))
- {
- //printf("null GetTransaction\n");
- return(tx.nLockTime);
- }
- if (!hashBlock.IsNull()) {
- BlockMap::iterator mi = mapBlockIndex.find(hashBlock);
- if (mi != mapBlockIndex.end() && (*mi).second)
- {
- CBlockIndex* pindex = (*mi).second;
- if (chainActive.Contains(pindex))
- return(pindex->GetBlockTime());
- }
- //printf("cant find in iterator\n");
- }
- //printf("null hashBlock\n");
- return(tx.nLockTime);
-}
-
void komodo_nutxoadd(int32_t addflag,int32_t height,int32_t notaryid,uint256 txhash,uint64_t voutmask,int32_t numvouts)
{
struct nutxo_entry *np;
if (nSigOps > MAX_BLOCK_SIGOPS)
return state.DoS(100, error("ConnectBlock(): too many sigops"),
REJECT_INVALID, "bad-blk-sigops");
-
+fprintf(stderr,"ht.%d vout0 t%u\n",pindex->nHeight,tx.nLockTime);
if (!tx.IsCoinBase())
{
if (!view.HaveInputs(tx))
// Create coinbase tx
CMutableTransaction txNew;
+ txNew.nLockTime = (uint32_t)time(NULL) - 60;
txNew.vin.resize(1);
txNew.vin[0].prevout.SetNull();
txNew.vout.resize(1);
}
CBlock *pblock = &pblocktemplate->block;
IncrementExtraNonce(pblock, pindexPrev, nExtraNonce);
-
LogPrintf("Running ZcashMiner with %u transactions in block (%u bytes)\n", pblock->vtx.size(),
::GetSerializeSize(*pblock, SER_NETWORK, PROTOCOL_VERSION));
}
else
{
- txNew.nLockTime = (uint32_t)time(NULL) - 1800; // set to a time close to now
+ txNew.nLockTime = (uint32_t)time(NULL) - 60; // set to a time close to now
}
{