Skip to content

Commit

Permalink
Merge pull request #5 from sparklecoin/develop
Browse files Browse the repository at this point in the history
v1.1.0 changes
  • Loading branch information
sparklecoin committed Jan 6, 2018
2 parents c679c34 + f7540f6 commit 6474907
Show file tree
Hide file tree
Showing 13 changed files with 98 additions and 107 deletions.
42 changes: 14 additions & 28 deletions doc/README
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Sparkleunity 1.0.1
Copyright (c) 2014-2016 Sparkleunity developers
Sparklecoin 1.1.0
Copyright (c) 2014-2018 Sparklecoin developers

Distributed under the MIT/X11 software license, see the accompanying
file license.txt or http://www.opensource.org/licenses/mit-license.php.
Expand All @@ -8,64 +8,50 @@ the OpenSSL Toolkit (http://www.openssl.org/). This product includes
cryptographic software written by Eric Young (eay@cryptsoft.com).


About Sparkleunity
---------------
Sparkleunity is a Sparklecoin network-compatible, community-developed wallet client.

The project has been designed to provide people with a
stable, secure, and feature-rich alternative to the Sparklecoin reference
wallet (http://github.com/sparklecoin/sparklecoin).
About Sparklecoin
-----------------
Sparklecoin is a community-developed wallet client.

To help faciliate broad community cooperation, a number of trusted
Sparklecoin/Peershares community leaders have write permissions to the project's
Sparklecoin community leaders have write permissions to the project's
codebase, allowing for decentralization and continuity. Community members,
old and new, are encouraged to find ways to contribute to the success of
the project. If you have experience with programming, product design,
QA engineering, translation, or have a different set of skills that you want to
bring to the project, your involvement is appreciated!


Development Roadmap
-------------------
* Updated branding and wallet design
* Integrated support for multiple Peershares offerings
* An improved minting experience


Resources
---------
Sparkleunity source code: https://github.com/Sparkleunity/Sparkleunity
Sparklecoin source code: https://github.com/sparklecoin/sparklecoin

For the most current instructions covering how to compile Sparkleunity from
For the most current instructions covering how to compile Sparklecoin from
source on a variety of operating systems, please visit:
https://github.com/Sparkleunity/Sparkleunity/tree/master/doc
https://github.com/sparklecoin/sparklecoin/tree/master/doc

Open software issues can be viewed, and new issues can be reported at:
https://github.com/Sparkleunity/Sparkleunity/issues?state=open

Sparkleunity discussion forums (hosted by SparklecoinTalk.org):
http://www.sparklecointalk.org/index.php?board=64.0
https://github.com/sparklecoin/sparklecoin/issues?state=open



Acknowledgements
----------------
Sparkleunity owes it's existance to the time and effort put forth by
Sparklecoin owes it's existance to the time and effort put forth by
the developers and supporters of the following projects:


Sparklecoin (SPRKoin) 0.4.0 BETA
Peercoin (PPCoin) 0.5.4
Copyright (c) 2011-2014 Bitcoin Developers

Distributed under the MIT/X11 software license
(http://www.opensource.org/licenses/mit-license.php)

Sparklecoin is a free open source project with the goal of providing a
Peercoin is a free open source project with the goal of providing a
long-term energy-efficient crypto-currency. Built on the foundation
of Bitcoin, innovations such as proof-of-stake help further advance
the field of crypto-currency.

http://github.com/sparklecoin/sparklecoin
http://github.com/peercoin/peercoin


------------------
Expand Down
42 changes: 14 additions & 28 deletions doc/README_windows.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Sparkleunity 1.0.1
Copyright (c) 2014-2016 Sparkleunity developers
Sparklecoin 1.1.0
Copyright (c) 2014-2018 Sparklecoin developers

Distributed under the MIT/X11 software license, see the accompanying
file license.txt or http://www.opensource.org/licenses/mit-license.php.
Expand All @@ -8,64 +8,50 @@ the OpenSSL Toolkit (http://www.openssl.org/). This product includes
cryptographic software written by Eric Young (eay@cryptsoft.com).


About Sparkleunity
---------------
Sparkleunity is a Sparklecoin network-compatible, community-developed wallet client.

The project has been designed to provide people with a
stable, secure, and feature-rich alternative to the Sparklecoin reference
wallet (http://github.com/sparklecoin/sparklecoin).
About Sparklecoin
-----------------
Sparklecoin is a community-developed wallet client.

To help faciliate broad community cooperation, a number of trusted
Sparklecoin/Peershares community leaders have write permissions to the project's
Sparklecoin community leaders have write permissions to the project's
codebase, allowing for decentralization and continuity. Community members,
old and new, are encouraged to find ways to contribute to the success of
the project. If you have experience with programming, product design,
QA engineering, translation, or have a different set of skills that you want to
bring to the project, your involvement is appreciated!


Development Roadmap
-------------------
* Updated branding and wallet design
* Integrated support for multiple Peershares offerings
* An improved minting experience


Resources
---------
Sparkleunity source code: https://github.com/Sparkleunity/Sparkleunity
Sparklecoin source code: https://github.com/sparklecoin/sparklecoin

For the most current instructions covering how to compile Sparkleunity from
For the most current instructions covering how to compile Sparklecoin from
source on a variety of operating systems, please visit:
https://github.com/Sparkleunity/Sparkleunity/tree/master/doc
https://github.com/sparklecoin/sparklecoin/tree/master/doc

Open software issues can be viewed, and new issues can be reported at:
https://github.com/Sparkleunity/Sparkleunity/issues?state=open

Sparkleunity discussion forums (hosted by SparklecoinTalk.org):
http://www.sparklecointalk.org/index.php?board=64.0
https://github.com/sparklecoin/sparklecoin/issues?state=open



Acknowledgements
----------------
Sparkleunity owes it's existance to the time and effort put forth by
Sparklecoin owes it's existance to the time and effort put forth by
the developers and supporters of the following projects:


Sparklecoin (SPRKoin) 0.4.0 BETA
Peercoin (PPCoin) 0.5.4
Copyright (c) 2011-2014 Bitcoin Developers

Distributed under the MIT/X11 software license
(http://www.opensource.org/licenses/mit-license.php)

Sparklecoin is a free open source project with the goal of providing a
Peercoin is a free open source project with the goal of providing a
long-term energy-efficient crypto-currency. Built on the foundation
of Bitcoin, innovations such as proof-of-stake help further advance
the field of crypto-currency.

http://github.com/sparklecoin/sparklecoin
http://github.com/peercoin/peercoin


------------------
Expand Down
2 changes: 1 addition & 1 deletion share/setup.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ SetCompressor /SOLID lzma

# General Symbol Definitions
!define REGKEY "SOFTWARE\$(^Name)"
!define VERSION 1.0.1.0
!define VERSION 1.1.0.0
!define COMPANY "Sparklecoin project"
!define URL http://github.com/sparklecoin/sparklecoin/

Expand Down
2 changes: 1 addition & 1 deletion sparklecoin.pro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
TEMPLATE = app
TARGET = sparklecoin
VERSION = 1.0.1.0
VERSION = 1.1.0.0
INCLUDEPATH += src src/json src/qt
DEFINES += QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE USE_IPV6
CONFIG += no_include_pwd
Expand Down
2 changes: 1 addition & 1 deletion src/bitcoinrpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3149,7 +3149,7 @@ Value sendrawtransaction(const Array& params, bool fHelp)
// parse hex string from parameter
vector<unsigned char> txData(ParseHex(params[0].get_str()));
CDataStream ssData(txData, SER_NETWORK, PROTOCOL_VERSION);
bool fCheckInputs = false;
bool fCheckInputs = true;
if (params.size() > 1)
fCheckInputs = (params[1].get_int() != 0);
CTransaction tx;
Expand Down
10 changes: 10 additions & 0 deletions src/kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ unsigned int nProtocolV04TestSwitchTime = 1495823150;
// Protocol switch time of v0.5 kernel protocol
unsigned int nProtocolV05SwitchTime = 1495823150;
unsigned int nProtocolV05TestSwitchTime = 1505222712;
// Protocol switch time of v0.6 kernel protocol
unsigned int nProtocolV06SwitchTime = 1515693600;
unsigned int nProtocolV06TestSwitchTime = 1515092057;


// TxDB upgrade time for v0.4 protocol
// Note: v0.4 upgrade does not require block chain re-download. However,
Expand Down Expand Up @@ -61,6 +65,12 @@ bool IsProtocolV05(unsigned int nTimeTx)
return (nTimeTx >= (fTestNet? nProtocolV05TestSwitchTime : nProtocolV05SwitchTime));
}

// Whether the given block is subject to new v0.6 protocol
bool IsProtocolV06(unsigned int nTimeBlock)
{
return (nTimeBlock >= (fTestNet? nProtocolV06TestSwitchTime : nProtocolV06SwitchTime));
}

// Get the last stake modifier and its generation time from a given block
static bool GetLastStakeModifier(const CBlockIndex* pindex, uint64& nStakeModifier, int64& nModifierTime)
{
Expand Down
2 changes: 2 additions & 0 deletions src/kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ bool IsProtocolV03(unsigned int nTimeCoinStake);
bool IsProtocolV04(unsigned int nTimeBlock);
// Whether a given transaction is subject to new v0.5 protocol
bool IsProtocolV05(unsigned int nTimeTx);
// Whether a given transaction is subject to new v0.5 protocol
bool IsProtocolV06(unsigned int nTimeBlock);

// Compute the hash modifier for proof-of-stake
bool ComputeNextStakeModifier(const CBlockIndex* pindexCurrent, uint64& nStakeModifier, bool& fGeneratedStakeModifier);
Expand Down
68 changes: 42 additions & 26 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -954,25 +954,29 @@ int64 GetProofOfWorkReward(unsigned int nBits, int nBlockHeight, unsigned int nT
if(nBlockHeight == 1){
nSubsidy = GENESIS_BLOCK_REWARD * COIN;
}
else
{
int64 BlockReward = 7 * COIN;
int64 Block_Interval = 210000;
int64 Block_Interval_Start = 5256000; //expected block height in 100 years

int64 nBlockDifference = nBlockHeight - Block_Interval_Start;
if(nBlockDifference > 0)
else
{
int64 BlockReward = 7 * COIN;
if (IsProtocolV06(nTime))
BlockReward /= 28;

int64 Block_Interval = 210000;
int64 Block_Interval_Start = 5256000; //expected block height in 100 years

int64 nBlockDifference = nBlockHeight - Block_Interval_Start;
if(nBlockDifference > 0)
{
int64 Limit = ceil( nBlockDifference / Block_Interval );
for(int a = 1; a < Limit; a++)
{
BlockReward /= 2;
}
}
nSubsidy = BlockReward;
}
if(fTestNet)
nSubsidy = 100 * COIN;
int64 Limit = ceil( nBlockDifference / Block_Interval );
for(int a = 1; a < Limit; a++)
{
BlockReward /= 2;
}
}
nSubsidy = BlockReward;
}

if(fTestNet)
nSubsidy = 100 * COIN;

if (fDebug && GetBoolArg("-printcreation"))
printf("GetProofOfWorkReward() : create=%s nBits=0x%08x nSubsidy=%" PRI64d"\n", FormatMoney(nSubsidy).c_str(), nBits, nSubsidy);
Expand Down Expand Up @@ -1038,11 +1042,21 @@ unsigned int static GetNextTargetRequired(const CBlockIndex* pindexLast, bool fP
return bnProofOfWorkLimit.GetCompact(); // genesis block

const CBlockIndex* pindexPrev = GetLastBlockIndex(pindexLast, fProofOfStake);
if (pindexPrev->pprev == NULL)
return bnInitialHashTarget.GetCompact(); // first block
if (pindexPrev->pprev == NULL) {
if (fProofOfStake && IsProtocolV06(pindexLast->nTime)) {
return 503481369;
}
else
return bnInitialHashTarget.GetCompact(); // first block
}
const CBlockIndex* pindexPrevPrev = GetLastBlockIndex(pindexPrev->pprev, fProofOfStake);
if (pindexPrevPrev->pprev == NULL)
return bnInitialHashTarget.GetCompact(); // second block
if (pindexPrevPrev->pprev == NULL) {
if (fProofOfStake && IsProtocolV06(pindexLast->nTime)) {
return 503481369;
}
else
return bnInitialHashTarget.GetCompact(); // second block
}

int64 nActualSpacing = pindexPrev->GetBlockTime() - pindexPrevPrev->GetBlockTime();

Expand Down Expand Up @@ -1727,7 +1741,6 @@ bool CBlock::SetBestChainInner(CTxDB& txdb, CBlockIndex *pindexNew)
bool CBlock::SetBestChain(CTxDB& txdb, CBlockIndex* pindexNew)
{
uint256 hash = GetHash();

if (!txdb.TxnBegin())
return error("SetBestChain() : TxnBegin failed");

Expand Down Expand Up @@ -1945,7 +1958,8 @@ bool CBlock::AddToBlockIndex(unsigned int nFile, unsigned int nBlockPos)
txdb.WriteBlockIndex(CDiskBlockIndex(pindexNew));
if (!txdb.TxnCommit())
return false;

if (fDebug && GetBoolArg("-printcheckchaintrust"))
printf("AddToBlockIndex check chaintrust %s > %s = %d\n", CBigNum(pindexNew->bnChainTrust).ToString().c_str(), CBigNum(bnBestChainTrust).ToString().c_str(), (pindexNew->bnChainTrust > bnBestChainTrust));
// New best
if (pindexNew->bnChainTrust > bnBestChainTrust)
if (!SetBestChain(txdb, pindexNew))
Expand Down Expand Up @@ -2103,7 +2117,6 @@ bool CBlock::AcceptBlock()
return error("AcceptBlock() : WriteToDisk failed");
if (!AddToBlockIndex(nFile, nBlockPos))
return error("AcceptBlock() : AddToBlockIndex failed");

// Relay inventory, but don't relay old inventory during initial block download
int nBlockEstimate = Checkpoints::GetTotalBlocksEstimate();
if (hashBestChain == hash)
Expand Down Expand Up @@ -3870,6 +3883,9 @@ CBlock* CreateNewBlock(CReserveKey& reservekey, CWallet* pwallet, bool fProofOfS

if (nSearchTime > nLastCoinStakeSearchTime)
{
if (fDebug && GetBoolArg("-printcreation"))
printf("CreateNewBlock: difficulty %d at %d resulting in target: %s\n", pblock->nBits, nSearchTime, CBigNum().SetCompact(pblock->nBits).getuint256().GetHex().c_str());

if (pwallet->CreateCoinStake(*pwallet, pblock->nBits, nSearchTime-nLastCoinStakeSearchTime, txCoinStake))
{
if (fDebug && GetBoolArg("-printcreation"))
Expand Down Expand Up @@ -4036,7 +4052,7 @@ CBlock* CreateNewBlock(CReserveKey& reservekey, CWallet* pwallet, bool fProofOfS
nBlockHeight = GetLastBlockIndex(pindexBest, false)->nHeight + 1;
}
if (pblock->IsProofOfWork())
pblock->vtx[0].vout[0].nValue = GetProofOfWorkReward(pblock->nBits, nBlockHeight, pblock->nTime);
pblock->vtx[0].vout[0].nValue = GetProofOfWorkReward(pblock->nBits, nBlockHeight, max(nLastCoinStakeSearchTime,(int64)pblock->nTime));

// Fill in header
pblock->hashPrevBlock = pindexPrev->GetBlockHash();
Expand Down
2 changes: 1 addition & 1 deletion src/makefile.osx-mavericks
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ LIBS += \
TESTDEFS += -DBOOST_TEST_DYN_LINK
endif

DEFS=-DMAC_OSX -DMSG_NOSIGNAL=0 -DBOOST_SPIRIT_THREADSAFE -DUSE_IPV6
DEFS=-DMAC_OSX -DMSG_NOSIGNAL=0 -DBOOST_SPIRIT_THREADSAFE -DUSE_IPV6 -DBOOST_THREAD_USE_LIB -DHAVE_WORKING_BOOST_SLEEP_FOR

ifdef RELEASE
CFLAGS = -mmacosx-version-min=10.9 -O3
Expand Down
8 changes: 4 additions & 4 deletions src/qt/bitcoingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,8 @@ void BitcoinGUI::createActions()
unlockForMintingAction->setCheckable(true);
backupWalletAction = new QAction(QIcon(":/icons/filesave"), tr("&Backup Wallet"), this);
backupWalletAction->setToolTip(tr("Backup wallet to another location"));
importWalletAction = new QAction(QIcon(":/icons/import-icon"), tr("&Import Wallet"), this);
importWalletAction->setToolTip(tr("Import External Wallet.dat into current wallet"));
//importWalletAction = new QAction(QIcon(":/icons/import-icon"), tr("&Import Wallet"), this);
//importWalletAction->setToolTip(tr("Import External Wallet.dat into current wallet"));
changePassphraseAction = new QAction(QIcon(":/icons/key"), tr("&Change Passphrase"), this);
changePassphraseAction->setToolTip(tr("Change the passphrase used for wallet encryption"));
openRPCConsoleAction = new QAction(tr("&Debug window"), this);
Expand All @@ -318,7 +318,7 @@ void BitcoinGUI::createActions()

connect(unlockForMintingAction, SIGNAL(triggered(bool)), this, SLOT(unlockForMinting(bool)));
connect(backupWalletAction, SIGNAL(triggered()), this, SLOT(backupWallet()));
connect(importWalletAction, SIGNAL(triggered()), this, SLOT(importWallet()));
//connect(importWalletAction, SIGNAL(triggered()), this, SLOT(importWallet()));
connect(changePassphraseAction, SIGNAL(triggered()), this, SLOT(changePassphrase()));
}

Expand All @@ -335,7 +335,7 @@ void BitcoinGUI::createMenuBar()
// Configure the menus
QMenu *file = appMenuBar->addMenu(tr("&File"));
file->addAction(backupWalletAction);
file->addAction(importWalletAction);
//file->addAction(importWalletAction);
file->addAction(exportAction);
#ifndef FIRST_CLASS_MESSAGING
file->addAction(messageAction);
Expand Down

0 comments on commit 6474907

Please sign in to comment.