Skip to content

Commit

Permalink
Merge pull request #1 from wsbrianw/master
Browse files Browse the repository at this point in the history
June 22, 2014
  • Loading branch information
ProjectUniversityCoin committed Jun 23, 2014
2 parents fc2b8c5 + 19588f2 commit 5d979a9
Show file tree
Hide file tree
Showing 6 changed files with 403 additions and 257 deletions.
4 changes: 2 additions & 2 deletions src/clientversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
// These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it
#define CLIENT_VERSION_MAJOR 0
#define CLIENT_VERSION_MINOR 7
#define CLIENT_VERSION_REVISION 2
#define CLIENT_VERSION_BUILD 0
#define CLIENT_VERSION_REVISION 3
#define CLIENT_VERSION_BUILD 1

// Converts the parameter X to a string after macro replacement on X has been performed.
// Don't merge these into one macro!
Expand Down
5 changes: 4 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -981,13 +981,16 @@ int64 GetProofOfWorkReward(int nHeight, int64 nFees, uint256 prevHash)
return nSubsidy + nFees;
}

//static const int64 MAX_MINT_PROOF_OF_STAKE = 0.038 * COIN; // 3.8% annual interest
//static const int64 MAX_MINT_PROOF_OF_STAKE2 = 0.085 * COIN; // 8.5% annual interest
//
// miner's coin stake reward based on nBits and coin age spent (coin-days)
// simple algorithm, not depend on the diff
// const int YEARLY_BLOCKCOUNT = 1051200; // 365 * 2880
int64 GetProofOfStakeReward(int64 nCoinAge, unsigned int nBits, unsigned int nTime, int nHeight)
{
int64 nRewardCoinYear;
nRewardCoinYear = MAX_MINT_PROOF_OF_STAKE2;
nRewardCoinYear = MAX_MINT_PROOF_OF_STAKE2; // should have been MAX_MINT_PROOF_OF_STAKE (baw june 10 2014)

if(nHeight > 80640 && nHeight < 357120)
nRewardCoinYear = MAX_MINT_PROOF_OF_STAKE2;
Expand Down
24 changes: 22 additions & 2 deletions src/qt/bitcoinunits.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//Copyright 2014 UniversityCoin Developers
#include "bitcoinunits.h"

#include <stdio.h>
#include <QStringList>

BitcoinUnits::BitcoinUnits(QObject *parent):
Expand Down Expand Up @@ -109,7 +110,26 @@ QString BitcoinUnits::format(int unit, qint64 n, bool fPlus)
quotient_str.insert(0, '-');
else if (fPlus && n > 0)
quotient_str.insert(0, '+');
return quotient_str + QString(".") + remainder_str;

// BAW JUNE 18, 2014 actually we do like the commas
int nStop = 0;
if (n < 0)
nStop = 1;
else if (fPlus && n > 0)
nStop = 1;

QString quotient_str2 = "";
int i2 = 0;
for(int i = quotient_str.size() - 1; i >= nStop; i--)
{
i2++;
if(i2 % 3 == 1 && i2 > 3 )
quotient_str2.insert(0, ',');
quotient_str2.insert(0, quotient_str.at(i));
}
// BAW end

return quotient_str2 + QString(".") + remainder_str;
}

QString BitcoinUnits::formatWithUnit(int unit, qint64 amount, bool plussign)
Expand Down
Loading

0 comments on commit 5d979a9

Please sign in to comment.