@@ -173,7 +173,7 @@ void CDarksendPool::ProcessMessageDarksend(CNode* pfrom, std::string& strCommand
173
173
}
174
174
175
175
std::vector<CTxIn> in;
176
- int64_t nAmount;
176
+ CAmount nAmount;
177
177
CTransaction txCollateral;
178
178
std::vector<CTxOut> out;
179
179
vRecv >> in >> nAmount >> txCollateral >> out;
@@ -197,8 +197,8 @@ void CDarksendPool::ProcessMessageDarksend(CNode* pfrom, std::string& strCommand
197
197
198
198
// check it like a transaction
199
199
{
200
- int64_t nValueIn = 0 ;
201
- int64_t nValueOut = 0 ;
200
+ CAmount nValueIn = 0 ;
201
+ CAmount nValueOut = 0 ;
202
202
bool missingTx = false ;
203
203
204
204
CValidationState state;
@@ -936,8 +936,8 @@ bool CDarksendPool::IsCollateralValid(const CTransaction& txCollateral){
936
936
if (txCollateral.vout .size () < 1 ) return false ;
937
937
if (txCollateral.nLockTime != 0 ) return false ;
938
938
939
- int64_t nValueIn = 0 ;
940
- int64_t nValueOut = 0 ;
939
+ CAmount nValueIn = 0 ;
940
+ CAmount nValueOut = 0 ;
941
941
bool missingTx = false ;
942
942
943
943
BOOST_FOREACH (const CTxOut o, txCollateral.vout ){
@@ -990,7 +990,7 @@ bool CDarksendPool::IsCollateralValid(const CTransaction& txCollateral){
990
990
//
991
991
// Add a clients transaction to the pool
992
992
//
993
- bool CDarksendPool::AddEntry (const std::vector<CTxIn>& newInput, const int64_t & nAmount, const CTransaction& txCollateral, const std::vector<CTxOut>& newOutput, int & errorID){
993
+ bool CDarksendPool::AddEntry (const std::vector<CTxIn>& newInput, const CAmount & nAmount, const CTransaction& txCollateral, const std::vector<CTxOut>& newOutput, int & errorID){
994
994
if (!fMasterNode ) return false ;
995
995
996
996
BOOST_FOREACH (CTxIn in, newInput) {
@@ -1092,7 +1092,7 @@ bool CDarksendPool::SignaturesComplete(){
1092
1092
// Execute a Darksend denomination via a Masternode.
1093
1093
// This is only ran from clients
1094
1094
//
1095
- void CDarksendPool::SendDarksendDenominate (std::vector<CTxIn>& vin, std::vector<CTxOut>& vout, int64_t amount){
1095
+ void CDarksendPool::SendDarksendDenominate (std::vector<CTxIn>& vin, std::vector<CTxOut>& vout, CAmount amount){
1096
1096
1097
1097
if (fMasterNode ) {
1098
1098
LogPrintf (" CDarksendPool::SendDarksendDenominate() - Darksend from a Masternode is not supported currently.\n " );
@@ -1139,7 +1139,7 @@ void CDarksendPool::SendDarksendDenominate(std::vector<CTxIn>& vin, std::vector<
1139
1139
1140
1140
// check it against the memory pool to make sure it's valid
1141
1141
{
1142
- int64_t nValueOut = 0 ;
1142
+ CAmount nValueOut = 0 ;
1143
1143
1144
1144
CValidationState state;
1145
1145
CMutableTransaction tx;
@@ -1652,8 +1652,8 @@ bool CDarksendPool::PrepareDarksendDenominate()
1652
1652
1653
1653
bool CDarksendPool::SendRandomPaymentToSelf ()
1654
1654
{
1655
- int64_t nBalance = pwalletMain->GetBalance ();
1656
- int64_t nPayment = (nBalance*0.35 ) + (rand () % nBalance);
1655
+ CAmount nBalance = pwalletMain->GetBalance ();
1656
+ CAmount nPayment = (nBalance*0.35 ) + (rand () % nBalance);
1657
1657
1658
1658
if (nPayment > nBalance) nPayment = nBalance-(0.1 *COIN);
1659
1659
@@ -1666,9 +1666,9 @@ bool CDarksendPool::SendRandomPaymentToSelf()
1666
1666
scriptChange = GetScriptForDestination (vchPubKey.GetID ());
1667
1667
1668
1668
CWalletTx wtx;
1669
- int64_t nFeeRet = 0 ;
1669
+ CAmount nFeeRet = 0 ;
1670
1670
std::string strFail = " " ;
1671
- vector< pair<CScript, int64_t > > vecSend;
1671
+ vector< pair<CScript, CAmount > > vecSend;
1672
1672
1673
1673
// ****** Add fees ************ /
1674
1674
vecSend.push_back (make_pair (scriptChange, nPayment));
@@ -1691,9 +1691,9 @@ bool CDarksendPool::SendRandomPaymentToSelf()
1691
1691
bool CDarksendPool::MakeCollateralAmounts ()
1692
1692
{
1693
1693
CWalletTx wtx;
1694
- int64_t nFeeRet = 0 ;
1694
+ CAmount nFeeRet = 0 ;
1695
1695
std::string strFail = " " ;
1696
- vector< pair<CScript, int64_t > > vecSend;
1696
+ vector< pair<CScript, CAmount > > vecSend;
1697
1697
CCoinControl *coinControl = NULL ;
1698
1698
1699
1699
// make our collateral address
@@ -1740,13 +1740,13 @@ bool CDarksendPool::MakeCollateralAmounts()
1740
1740
}
1741
1741
1742
1742
// Create denominations
1743
- bool CDarksendPool::CreateDenominated (int64_t nTotalValue)
1743
+ bool CDarksendPool::CreateDenominated (CAmount nTotalValue)
1744
1744
{
1745
1745
CWalletTx wtx;
1746
- int64_t nFeeRet = 0 ;
1746
+ CAmount nFeeRet = 0 ;
1747
1747
std::string strFail = " " ;
1748
- vector< pair<CScript, int64_t > > vecSend;
1749
- int64_t nValueLeft = nTotalValue;
1748
+ vector< pair<CScript, CAmount > > vecSend;
1749
+ CAmount nValueLeft = nTotalValue;
1750
1750
1751
1751
// make our collateral address
1752
1752
CReserveKey reservekeyCollateral (pwalletMain);
@@ -1768,7 +1768,7 @@ bool CDarksendPool::CreateDenominated(int64_t nTotalValue)
1768
1768
1769
1769
// ****** Add denoms ************ /
1770
1770
1771
- BOOST_REVERSE_FOREACH (int64_t v, darkSendDenominations){
1771
+ BOOST_REVERSE_FOREACH (CAmount v, darkSendDenominations){
1772
1772
1773
1773
// Note: denoms are skipped if there are already DENOMS_COUNT_MAX of them
1774
1774
@@ -1852,7 +1852,7 @@ bool CDarksendPool::IsCompatibleWithEntries(std::vector<CTxOut>& vout)
1852
1852
return true ;
1853
1853
}
1854
1854
1855
- bool CDarksendPool::IsCompatibleWithSession (int64_t nDenom, CTransaction txCollateral, int & errorID)
1855
+ bool CDarksendPool::IsCompatibleWithSession (CAmount nDenom, CTransaction txCollateral, int & errorID)
1856
1856
{
1857
1857
if (nDenom == 0 ) return false ;
1858
1858
@@ -1953,16 +1953,16 @@ int CDarksendPool::GetDenominations(const std::vector<CTxDSOut>& vout){
1953
1953
1954
1954
// return a bitshifted integer representing the denominations in this list
1955
1955
int CDarksendPool::GetDenominations (const std::vector<CTxOut>& vout, bool fSingleRandomDenom ){
1956
- std::vector<pair<int64_t , int > > denomUsed;
1956
+ std::vector<pair<CAmount , int > > denomUsed;
1957
1957
1958
1958
// make a list of denominations, with zero uses
1959
- BOOST_FOREACH (int64_t d, darkSendDenominations)
1959
+ BOOST_FOREACH (CAmount d, darkSendDenominations)
1960
1960
denomUsed.push_back (make_pair (d, 0 ));
1961
1961
1962
1962
// look for denominations and update uses to 1
1963
1963
BOOST_FOREACH (CTxOut out, vout){
1964
1964
bool found = false ;
1965
- BOOST_FOREACH (PAIRTYPE (int64_t , int )& s, denomUsed){
1965
+ BOOST_FOREACH (PAIRTYPE (CAmount , int )& s, denomUsed){
1966
1966
if (out.nValue == s.first ){
1967
1967
s.second = 1 ;
1968
1968
found = true ;
@@ -1975,7 +1975,7 @@ int CDarksendPool::GetDenominations(const std::vector<CTxOut>& vout, bool fSingl
1975
1975
int c = 0 ;
1976
1976
// if the denomination is used, shift the bit on.
1977
1977
// then move to the next
1978
- BOOST_FOREACH (PAIRTYPE (int64_t , int )& s, denomUsed) {
1978
+ BOOST_FOREACH (PAIRTYPE (CAmount , int )& s, denomUsed) {
1979
1979
int bit = (fSingleRandomDenom ? rand ()%2 : 1 ) * s.second ;
1980
1980
denom |= bit << c++;
1981
1981
if (fSingleRandomDenom && bit) break ; // use just one random denomination
@@ -1992,27 +1992,27 @@ int CDarksendPool::GetDenominations(const std::vector<CTxOut>& vout, bool fSingl
1992
1992
}
1993
1993
1994
1994
1995
- int CDarksendPool::GetDenominationsByAmounts (std::vector<int64_t >& vecAmount){
1995
+ int CDarksendPool::GetDenominationsByAmounts (std::vector<CAmount >& vecAmount){
1996
1996
CScript e = CScript ();
1997
1997
std::vector<CTxOut> vout1;
1998
1998
1999
1999
// Make outputs by looping through denominations, from small to large
2000
- BOOST_REVERSE_FOREACH (int64_t v, vecAmount){
2000
+ BOOST_REVERSE_FOREACH (CAmount v, vecAmount){
2001
2001
CTxOut o (v, e);
2002
2002
vout1.push_back (o);
2003
2003
}
2004
2004
2005
2005
return GetDenominations (vout1, true );
2006
2006
}
2007
2007
2008
- int CDarksendPool::GetDenominationsByAmount (int64_t nAmount, int nDenomTarget){
2008
+ int CDarksendPool::GetDenominationsByAmount (CAmount nAmount, int nDenomTarget){
2009
2009
CScript e = CScript ();
2010
- int64_t nValueLeft = nAmount;
2010
+ CAmount nValueLeft = nAmount;
2011
2011
2012
2012
std::vector<CTxOut> vout1;
2013
2013
2014
2014
// Make outputs by looping through denominations, from small to large
2015
- BOOST_REVERSE_FOREACH (int64_t v, darkSendDenominations){
2015
+ BOOST_REVERSE_FOREACH (CAmount v, darkSendDenominations){
2016
2016
if (nDenomTarget != 0 ){
2017
2017
bool fAccepted = false ;
2018
2018
if ((nDenomTarget & (1 << 0 )) && v == ((100 *COIN)+100000 )) {fAccepted = true ;}
@@ -2200,7 +2200,7 @@ void CDarksendPool::RelayFinalTransaction(const int sessionID, const CTransactio
2200
2200
}
2201
2201
}
2202
2202
2203
- void CDarksendPool::RelayIn (const std::vector<CTxDSIn>& vin, const int64_t & nAmount, const CTransaction& txCollateral, const std::vector<CTxDSOut>& vout)
2203
+ void CDarksendPool::RelayIn (const std::vector<CTxDSIn>& vin, const CAmount & nAmount, const CTransaction& txCollateral, const std::vector<CTxDSOut>& vout)
2204
2204
{
2205
2205
if (!pSubmittedToMasternode) return ;
2206
2206
0 commit comments