diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2017-01-04 07:35:39 -0800 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2017-01-11 08:21:37 -0800 |
commit | e356d9a758fff44841c0a630ef6b048de05e53f0 (patch) | |
tree | 39ef7e8da308218dfe54b1c458e1d743cea933b5 | |
parent | 6dd81169fc33f0c9720afe0b9b52ed4539e59580 (diff) |
Shorten variable names and switch to tx/s
-rw-r--r-- | src/chainparams.cpp | 4 | ||||
-rw-r--r-- | src/chainparams.h | 6 | ||||
-rw-r--r-- | src/validation.cpp | 6 |
3 files changed, 8 insertions, 8 deletions
diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 06196de362..626dc9f8cb 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -158,7 +158,7 @@ public: 1397080064, // * UNIX timestamp of last checkpoint block 36544669, // * total number of transactions between genesis and last checkpoint // (the tx=... number in the SetBestChain debug.log lines) - 60000.0 // * estimated number of transactions per day after checkpoint + 0.7 // * estimated number of transactions per second after checkpoint }; } }; @@ -242,7 +242,7 @@ public: chainTxData = ChainTxData{ 1337966069, 1488, - 300 + 0.0035 }; } diff --git a/src/chainparams.h b/src/chainparams.h index 8dbde9fc24..db524e8f8e 100644 --- a/src/chainparams.h +++ b/src/chainparams.h @@ -31,9 +31,9 @@ struct CCheckpointData { }; struct ChainTxData { - int64_t nTimeLastCheckpoint; - int64_t nTransactionsLastCheckpoint; - double fTransactionsPerDay; + int64_t nTime; + int64_t nTxCount; + double dTxRate; }; /** diff --git a/src/validation.cpp b/src/validation.cpp index 0ff9a00254..f9b1cd52ec 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -4150,10 +4150,10 @@ double GuessVerificationProgress(const ChainTxData& data, CBlockIndex *pindex) { double fTxTotal; - if (pindex->nChainTx <= data.nTransactionsLastCheckpoint) { - fTxTotal = data.nTransactionsLastCheckpoint + (nNow - data.nTimeLastCheckpoint) / 86400.0 * data.fTransactionsPerDay; + if (pindex->nChainTx <= data.nTxCount) { + fTxTotal = data.nTxCount + (nNow - data.nTime) * data.dTxRate; } else { - fTxTotal = pindex->nChainTx + (nNow - pindex->GetBlockTime()) / 86400.0 * data.fTransactionsPerDay; + fTxTotal = pindex->nChainTx + (nNow - pindex->GetBlockTime()) * data.dTxRate; } return pindex->nChainTx / fTxTotal; |