Delete coinAge from CKernelRecord
authorsvost <ya.nowa@yandex.ru>
Mon, 7 Feb 2022 18:21:04 +0000 (21:21 +0300)
committersvost <ya.nowa@yandex.ru>
Mon, 7 Feb 2022 18:21:04 +0000 (21:21 +0300)
src/kernelrecord.cpp
src/kernelrecord.h

index 3a0b2db..c1a2c59 100644 (file)
@@ -32,8 +32,6 @@ vector<KernelRecord> KernelRecord::decomposeOutput(const CWallet *wallet, const
     int64_t nTime = wtx.GetTxTime();
     uint256 hash = wtx.GetHash();
     std::map<std::string, std::string> mapValue = wtx.mapValue;
-    int64_t nDayWeight = (min((GetAdjustedTime() - nTime), (int64_t)(nStakeMaxAge+nStakeMinAge)) - nStakeMinAge); // DayWeight * 86400, чтобы был
-                                                                                                              // правильный расчёт CoinAge
     if (showTransaction(wtx))
     {
         for (unsigned int nOut = 0; nOut < wtx.vout.size(); nOut++)
@@ -43,8 +41,6 @@ vector<KernelRecord> KernelRecord::decomposeOutput(const CWallet *wallet, const
                 CTxDestination address;
                 std::string addrStr;
 
-                uint64_t coinAge = max( (txOut.nValue * nDayWeight) / (COIN * nOneDay), (int64_t)0);
-
                 if (ExtractDestination(txOut.scriptPubKey, address))
                 {
                     // Sent to Bitcoin Address
@@ -56,7 +52,7 @@ vector<KernelRecord> KernelRecord::decomposeOutput(const CWallet *wallet, const
                     addrStr = mapValue["to"];
                 }
 
-                parts.push_back(KernelRecord(hash, nTime, addrStr, txOut.nValue, wtx.IsSpent(nOut), coinAge));
+                parts.push_back(KernelRecord(hash, nTime, addrStr, txOut.nValue, wtx.IsSpent(nOut)));
             }
         }
     }
index 8f32816..a583b03 100644 (file)
@@ -10,20 +10,18 @@ class KernelRecord
 {
 public:
     KernelRecord():
-        hash(), nTime(0), address(""), nValue(0), idx(0), spent(false), coinAge(0), prevMinutes(0), prevDifficulty(0), prevProbability(0)
+        hash(), nTime(0), address(""), nValue(0), idx(0), spent(false), prevMinutes(0), prevDifficulty(0), prevProbability(0)
     {
     }
 
     KernelRecord(uint256 hash, int64_t nTime):
-            hash(hash), nTime(nTime), address(""), nValue(0), idx(0), spent(false), coinAge(0), prevMinutes(0), prevDifficulty(0), prevProbability(0)
+            hash(hash), nTime(nTime), address(""), nValue(0), idx(0), spent(false), prevMinutes(0), prevDifficulty(0), prevProbability(0)
     {
     }
 
-    KernelRecord(uint256 hash, int64_t nTime,
-                 const std::string &address,
-                 int64_t nValue, bool spent, int64_t coinAge):
+    KernelRecord(uint256 hash, int64_t nTime, const std::string &address, int64_t nValue, bool spent):
         hash(hash), nTime(nTime), address(address), nValue(nValue),
-        idx(0), spent(spent), coinAge(coinAge), prevMinutes(0), prevDifficulty(0), prevProbability(0)
+        idx(0), spent(spent), prevMinutes(0), prevDifficulty(0), prevProbability(0)
     {
     }
 
@@ -37,7 +35,6 @@ public:
     int64_t nValue;
     int idx;
     bool spent;
-    int64_t coinAge;
 
     std::string getTxID();
     int64_t getAge() const;