aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPatrick Lodder <[email protected]>2015-08-07 11:45:02 +0200
committerPatrick Lodder <[email protected]>2015-08-07 11:45:02 +0200
commitc15e5cebc604d7d75b389c42902b3ab7ab40eb0d (patch)
tree0b63a5f69f9d417f6c2d7cebc76ae3ffcf98066e /src
parentMerge pull request #1220 from rnicoll/1.10-paymentprotocol (diff)
parentchanging CAmount (is a int64_t) to arith_uint256 for nTotalAmount in CCoinsSt... (diff)
downloaddiscoin-c15e5cebc604d7d75b389c42902b3ab7ab40eb0d.tar.xz
discoin-c15e5cebc604d7d75b389c42902b3ab7ab40eb0d.zip
Merge pull request #1227 from kaykurokawa/1.10-dev
changing CAmount (is a int64_t) to arith_uint256 for nTotalAmount
Diffstat (limited to 'src')
-rw-r--r--src/coins.h3
-rw-r--r--src/rpcserver.cpp7
-rw-r--r--src/rpcserver.h2
-rw-r--r--src/txdb.cpp3
4 files changed, 13 insertions, 2 deletions
diff --git a/src/coins.h b/src/coins.h
index a4671645d..98caf7b6b 100644
--- a/src/coins.h
+++ b/src/coins.h
@@ -10,6 +10,7 @@
#include "memusage.h"
#include "serialize.h"
#include "uint256.h"
+#include "arith_uint256.h"
#include <assert.h>
#include <stdint.h>
@@ -305,7 +306,7 @@ struct CCoinsStats
uint64_t nTransactionOutputs;
uint64_t nSerializedSize;
uint256 hashSerialized;
- CAmount nTotalAmount;
+ arith_uint256 nTotalAmount;
CCoinsStats() : nHeight(0), nTransactions(0), nTransactionOutputs(0), nSerializedSize(0), nTotalAmount(0) {}
};
diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp
index b2dc252f8..184eb7c7b 100644
--- a/src/rpcserver.cpp
+++ b/src/rpcserver.cpp
@@ -140,6 +140,13 @@ Value ValueFromAmount(const CAmount& amount)
return (double)amount / (double)COIN;
}
+Value ValueFromAmount(const arith_uint256& amount)
+{
+ return amount.getdouble() / (double)COIN;
+}
+
+
+
uint256 ParseHashV(const Value& v, string strName)
{
string strHex;
diff --git a/src/rpcserver.h b/src/rpcserver.h
index 94f666a3b..d1051c4b0 100644
--- a/src/rpcserver.h
+++ b/src/rpcserver.h
@@ -9,6 +9,7 @@
#include "amount.h"
#include "rpcprotocol.h"
#include "uint256.h"
+#include "arith_uint256.h"
#include <list>
#include <map>
@@ -139,6 +140,7 @@ extern void ShutdownRPCMining();
extern int64_t nWalletUnlockTime;
extern CAmount AmountFromValue(const json_spirit::Value& value);
extern json_spirit::Value ValueFromAmount(const CAmount& amount);
+extern json_spirit::Value ValueFromAmount(const arith_uint256& amount);
extern double GetDifficulty(const CBlockIndex* blockindex = NULL);
extern std::string HelpRequiringPassphrase();
extern std::string HelpExampleCli(std::string methodname, std::string args);
diff --git a/src/txdb.cpp b/src/txdb.cpp
index 7eb857ed5..b6543e961 100644
--- a/src/txdb.cpp
+++ b/src/txdb.cpp
@@ -10,6 +10,7 @@
#include "main.h"
#include "pow.h"
#include "uint256.h"
+#include "arith_uint256.h"
#include <stdint.h>
@@ -110,7 +111,7 @@ bool CCoinsViewDB::GetStats(CCoinsStats &stats) const {
CHashWriter ss(SER_GETHASH, PROTOCOL_VERSION);
stats.hashBlock = GetBestBlock();
ss << stats.hashBlock;
- CAmount nTotalAmount = 0;
+ arith_uint256 nTotalAmount = 0;
while (pcursor->Valid()) {
boost::this_thread::interruption_point();
try {