]> Git Repo - VerusCoin.git/commitdiff
test
authorjl777 <[email protected]>
Fri, 21 Oct 2016 18:48:46 +0000 (15:48 -0300)
committerjl777 <[email protected]>
Fri, 21 Oct 2016 18:48:46 +0000 (15:48 -0300)
src/coins.cpp
src/komodo.h
src/main.cpp
src/miner.cpp
src/wallet/wallet.cpp

index 147c68872e18899f5138d4d5ed3dc0da2712ad26..3385ebd6b2b1a2b3b5ed7016060460fdb96b3bac 100644 (file)
@@ -383,7 +383,28 @@ const CScript &CCoinsViewCache::GetSpendFor(const CTxIn& input) const
     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
 {
@@ -393,7 +414,7 @@ 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();
index 90e2527c803a0893a10810fecde722eeeae79780..41703845a46caca8e39978b15831921ae9fd6592 100644 (file)
@@ -246,29 +246,6 @@ int32_t komodo_threshold(int32_t height,uint64_t signedmask)
     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;
index 29afc109eeac11d17f7bc3f5171e73472683114e..f781a8d6d3a738bbfc9d70a34a79b21682da0cab 100644 (file)
@@ -2133,7 +2133,7 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin
         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))
index 56a6aa5157d3b994a6da6df3c94d61c401e6680c..c65dcff419b087bb21fb28f8d2445cf2cfabd9d1 100644 (file)
@@ -329,6 +329,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn)
 
         // 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);
@@ -499,7 +500,6 @@ void static BitcoinMiner(CWallet *pwallet)
             }
             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));
 
index b33888a294a92378359074b3f7e36f3e7cb654ee..1942994727177c4009c737516733aaa7c477ff81 100644 (file)
@@ -2437,7 +2437,7 @@ bool CWallet::CreateTransaction(const vector<CRecipient>& vecSend,
     }
     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
     }
 
     {
This page took 0.041059 seconds and 4 git commands to generate.