Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
574e43e
Make script executable so build runs
Jun 3, 2018
e4d9025
Prepare consensus change as per vote option B
raipat Mar 1, 2019
4a22eff
change consensus to enforce a limit on max cap
May 4, 2019
ccebbcd
use constants, new fork block height
May 12, 2019
cc0316b
bump fork block height and max cap for distribution
Jun 19, 2019
e44d855
bugfix and new fork block
Jul 20, 2019
fdaa307
fix to build with recent boost version
raipat Aug 15, 2019
5cdbb2e
revert to move boost update moves to beta branch
Aug 15, 2019
0dab248
bump version, fork block, max cap for release
raipat Aug 15, 2019
daf8374
mxe crosscompile for windows QT wallet binaries
raipat Aug 15, 2019
b320147
update readme to reflect community takeover
raipat Aug 15, 2019
dddd303
new fork block 1372000, give users time to upgrade
raipat Aug 29, 2019
5382d40
mxe-built windows binary
raipat Aug 29, 2019
c2af2c1
bump fork block after 2nd attempt
Sep 28, 2019
82d7bca
fix comment typo
Sep 28, 2019
8ac159a
Windows binary for v.1.1.1.1
raipat Sep 28, 2019
f5238ef
windows binary file version bump
raipat Sep 28, 2019
f15b0b7
brexit fork block
Nov 5, 2019
2dadd5c
Merge branch master
Nov 5, 2019
6e59f05
new Windows binary
raipat Nov 5, 2019
eea05ec
new fork block and max cap 2G
Dec 11, 2019
1761413
bump fork params
Mar 12, 2020
5d4813a
v1.1.1.4 windows binary
raipat Mar 12, 2020
b999258
bump fork block and version
Jun 7, 2020
4629094
Windows binary v1.1.1.5
raipat Jun 7, 2020
3ac5bb5
bump fork block till new code is ready
Jul 19, 2020
645f867
new windows Binary
raipat Jul 19, 2020
c197ffd
another fork block bump, the last in 2020
Sep 20, 2020
ad82ab3
Merge branch 'master' of https://www.github.com/raipat/rain
raipat Sep 20, 2020
184481b
Windows binary v1.1.1.7
raipat Sep 20, 2020
181985e
new fork block, you know the drill
raipat Jan 2, 2021
69ad1b4
new windows binary
raipat Jan 2, 2021
e43496e
new fork block for new version 1.1.1.9
raipat Mar 28, 2021
e67d79d
Merge branch
raipat Mar 28, 2021
428ef2c
bump fork block
raipat Jun 5, 2021
66f24f1
new windows binary
raipat Jun 5, 2021
160fd6f
Bump fork block to March 2022
raipat Sep 1, 2021
6424cea
bump fork block
raipat Mar 5, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ Port: 23373

RPC port: 23372

Coin supply: 500,000,000
Max Coin supply: 1,500,000,000

Yearly interest: 200%
Yearly interest following Block 1328350: 10%
(until cap reached, enforced in latest release)

Proof of Work Reward: Random?!

Expand Down
9 changes: 5 additions & 4 deletions condensation-qt.pro
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ MOC_DIR = build
UI_DIR = build

win32 {
BOOST_LIB_SUFFIX=-mgw49-mt-s-1_57
BOOST_INCLUDE_PATH=C:/deps/boost_1_57_0
BOOST_LIB_PATH=C:/deps/boost_1_57_0/stage/lib
BOOST_LIB_SUFFIX=-mt
BOOST_INCLUDE_PATH=$MXE_INCLUDE_PATH/boost
BOOST_LIB_PATH=$MXE_LIB_PATH
BDB_INCLUDE_PATH=C:/deps/db-6.1.26.NC/build_unix
BDB_LIB_PATH=C:/deps/db-6.1.26.NC/build_unix
OPENSSL_INCLUDE_PATH=C:/deps/openssl-1.0.2j/include
Expand Down Expand Up @@ -95,6 +95,7 @@ contains(USE_QRCODE, 1) {
LIBS += -lqrencode
}

USE_UPNP=-
# use: qmake "USE_UPNP=1" ( enabled by default; default)
# or: qmake "USE_UPNP=0" (disabled by default)
# or: qmake "USE_UPNP=-" (not supported)
Expand Down Expand Up @@ -484,7 +485,7 @@ LIBS += $$join(BOOST_LIB_PATH,,-L,) $$join(BDB_LIB_PATH,,-L,) $$join(OPENSSL_LIB
LIBS += -lssl -lcrypto -ldb_cxx$$BDB_LIB_SUFFIX
# -lgdi32 has to happen after -lcrypto (see #681)
windows:LIBS += -lws2_32 -lshlwapi -lmswsock -lole32 -loleaut32 -luuid -lgdi32
LIBS += -lboost_system$$BOOST_LIB_SUFFIX -lboost_filesystem$$BOOST_LIB_SUFFIX -lboost_program_options$$BOOST_LIB_SUFFIX -lboost_thread$$BOOST_THREAD_LIB_SUFFIX
LIBS += -L/mnt/mxe/usr/i686-w64-mingw32.static/include/boost -lboost_system$$BOOST_LIB_SUFFIX -lboost_filesystem$$BOOST_LIB_SUFFIX -lboost_program_options$$BOOST_LIB_SUFFIX -lboost_thread$$BOOST_THREAD_LIB_SUFFIX
windows:LIBS += -lboost_chrono$$BOOST_LIB_SUFFIX

contains(RELEASE, 1) {
Expand Down
Binary file modified release/Condensation-qt.exe
100644 → 100755
Binary file not shown.
4 changes: 2 additions & 2 deletions src/clientversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

// These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it
#define CLIENT_VERSION_MAJOR 1
#define CLIENT_VERSION_MINOR 0
#define CLIENT_VERSION_MINOR 1
#define CLIENT_VERSION_REVISION 1
#define CLIENT_VERSION_BUILD 0
#define CLIENT_VERSION_BUILD 12

// Converts the parameter X to a string after macro replacement on X has been performed.
// Don't merge these into one macro!
Expand Down
Empty file modified src/leveldb/build_detect_platform
100644 → 100755
Empty file.
30 changes: 25 additions & 5 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1010,12 +1010,30 @@ int64_t GetProofOfWorkReward(int nHeight, int64_t nFees, uint256 prevHash)
}

// miner's coin stake reward based on coin age spent (coin-days)
int64_t GetProofOfStakeReward(int64_t nCoinAge, int64_t nFees)
int64_t GetProofOfStakeReward(int nHeight, int64_t nCoinAge, int64_t nFees, int64_t supply)
{
int64_t nSubsidy = nCoinAge * COIN_YEAR_REWARD / 365;
int64_t nSubsidy = 0;
int64_t nSubsidyn = 0;
if (nHeight <= CONSENSUS_CHANGE_BLOCK) {
nSubsidy = nCoinAge * COIN_YEAR_REWARD / 365;
nSubsidyn = nCoinAge * COIN_YEAR_REWARD_NEW / 365;
}
else if (nHeight > CONSENSUS_CHANGE_BLOCK) {
if (supply >= RAIN_CAP)
nSubsidy = 0;
else
nSubsidy = nCoinAge * COIN_YEAR_REWARD_NEW / 365;
}

if (fDebug && GetBoolArg("-printcreation"))
printf("GetProofOfStakeReward(): create=%s nCoinAge=%"PRId64"\n", FormatMoney(nSubsidy).c_str(), nCoinAge);
if (fDebug && GetBoolArg("-printcreation")) {
printf("GetProofOfStakeReward(): create=%s nCoinAge=%"PRId64" supply=%"PRId64"\n", FormatMoney(nSubsidy).c_str(), nCoinAge,supply);
if (supply >= RAIN_CAP)
printf("Supply cap reached\n");
else
printf("Supply cap not yet reached\n");

printf("GetProofOfStakeReward() Preview: create=%s nCoinAge=%"PRId64" supply=%"PRId64"\n", FormatMoney(nSubsidyn).c_str(), nCoinAge,supply);
}

return nSubsidy + nFees;
}
Expand Down Expand Up @@ -1553,7 +1571,9 @@ bool CBlock::ConnectBlock(CTxDB& txdb, CBlockIndex* pindex, bool fJustCheck)
if (!vtx[1].GetCoinAge(txdb, nCoinAge))
return error("ConnectBlock() : %s unable to get coin age for coinstake", vtx[1].GetHash().ToString().substr(0,10).c_str());

int64_t nCalculatedStakeReward = GetProofOfStakeReward(nCoinAge, nFees);
// debug nMoneySupply
printf("Supply: %"PRId64"\n",pindex->pprev->nMoneySupply);
int64_t nCalculatedStakeReward = GetProofOfStakeReward(pindex->nHeight,nCoinAge, nFees,pindex->pprev->nMoneySupply);

if (nStakeReward > nCalculatedStakeReward)
return DoS(100, error("ConnectBlock() : coinstake pays too much(actual=%"PRId64" vs calculated=%"PRId64")", nStakeReward, nCalculatedStakeReward));
Expand Down
6 changes: 5 additions & 1 deletion src/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ static const int64_t MIN_TX_FEE = 0.1 * COIN;
static const int64_t MIN_RELAY_TX_FEE = MIN_TX_FEE;
static const int64_t MAX_MONEY = 500000000 * COIN;
static const int64_t COIN_YEAR_REWARD = 200 * CENT;
// implement consensus vote result Option B. Set Max Supply and staking to 10%
static const int64_t COIN_YEAR_REWARD_NEW = 10 * CENT;
static const int64_t RAIN_CAP = 50000000000 * COIN;
static const int CONSENSUS_CHANGE_BLOCK = 2915500; // should be around August 31th 2022

inline bool MoneyRange(int64_t nValue) { return (nValue >= 0 && nValue <= MAX_MONEY); }
// Threshold for nLockTime: below this value it is interpreted as block number, otherwise as UNIX timestamp.
Expand Down Expand Up @@ -112,7 +116,7 @@ bool LoadExternalBlockFile(FILE* fileIn);
bool CheckProofOfWork(uint256 hash, unsigned int nBits);
unsigned int GetNextTargetRequired(const CBlockIndex* pindexLast, bool fProofOfStake);
int64_t GetProofOfWorkReward(int nHeight, int64_t nFees, uint256 prevHash);
int64_t GetProofOfStakeReward(int64_t nCoinAge, int64_t nFees);
int64_t GetProofOfStakeReward(int nHeight, int64_t nCoinAge, int64_t nFees, int64_t supply);
unsigned int ComputeMinWork(unsigned int nBase, int64_t nTime);
unsigned int ComputeMinStake(unsigned int nBase, int64_t nTime, unsigned int nBlockTime);
int GetNumBlocksOfPeers();
Expand Down
2 changes: 1 addition & 1 deletion src/qt/res/bitcoin-qt.rc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ BEGIN
VALUE "FileDescription", "rain-qt (OSS GUI client for rain)"
VALUE "FileVersion", VER_FILEVERSION_STR
VALUE "InternalName", "rain-qt"
VALUE "LegalCopyright", "2017 bitc0der"
VALUE "LegalCopyright", "2017-2021 Rain community"
VALUE "LegalTrademarks1", "Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php."
VALUE "OriginalFilename", "rain-qt.exe"
VALUE "ProductName", "rain-qt"
Expand Down
2 changes: 1 addition & 1 deletion src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ static const int DATABASE_VERSION = 70509;
// network protocol versioning
//

static const int PROTOCOL_VERSION = 60010;
static const int PROTOCOL_VERSION = 60050;

// intial proto version, to be increased after version/verack negotiation
static const int INIT_PROTO_VERSION = 209;
Expand Down
4 changes: 2 additions & 2 deletions src/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2572,8 +2572,8 @@ bool CWallet::CreateCoinStake(const CKeyStore& keystore, unsigned int nBits, int
if (!txNew.GetCoinAge(txdb, nCoinAge))
return error("CreateCoinStake : failed to calculate coin age");

int64_t nReward = GetProofOfStakeReward(nCoinAge, nFees);
if (nReward <= 0)
int64_t nReward = GetProofOfStakeReward(pindexPrev->nHeight,nCoinAge, nFees,pindexPrev->nMoneySupply);
if (nReward < 0)
return false;

nCredit += nReward;
Expand Down