Skip to content

Commit

Permalink
Committing PoS V2 changes, BIP32/44 preparation and much more
Browse files Browse the repository at this point in the history
  • Loading branch information
SDCDev committed Apr 21, 2015
1 parent 63022b6 commit 2a74cf1
Show file tree
Hide file tree
Showing 203 changed files with 13,041 additions and 9,298 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
src/*.exe
src/shadowcoin
src/shadowcoind
src/test_shadowcoin
src/test_shadow
src/build.h
.*.swp
*.*~*
Expand Down
2 changes: 1 addition & 1 deletion COPYING
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2014 ShadowCoin Developers
Copyright (c) 2014-2015 ShadowCoin Developers
Copyright (c) 2014 BlackCoin Developers
Copyright (c) 2013-2014 NovaCoin Developers
Copyright (c) 2011-2012 PPCoin Developers
Expand Down
59 changes: 59 additions & 0 deletions release-notes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@


Release Notes


Version 1.3.2.0

Changes
- Implemented PoS V2


- Removed Thin mode staking
The network relies on full nodes for security.
Staking should be a reward for maintaining a full node.


- Removed hash from DiskBlockIndex
hash is saved in the key, no need to save it twice, 32 bytes saved per block
Key prefix "blockindex" changed to "bidx", 36 bytes saved per block


The TXDB version has been raised to 70510.

On first boot the nodes will wipe any database before 70509 and initialise
a reindex, which will reload the TXDB from the stored blockchain.

For Databases of verson 70509 an migration will run, significantly faster
than a reindex. All existing nodes should be on txdb version 70509.

Thin nodes don't store the blockchain and will need to redownload.

Note: Reindexing the chain could cause your failed stake transactions to be
detected as occuring during the reindex, and displayed at the top of the
transaction list. They can be removed by running clearwallettransactions
followed by reloadanondata.



- Enabled unit tests
Compile: make -f makefile.unix test_shadow
Run: ./test_shadow --log_level=10




- printstakemodifier, printcoinstake and printcoinage are replaced by debugpos













128 changes: 72 additions & 56 deletions shadow.pro
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ TEMPLATE = app
TARGET = shadow
VERSION = 1.3.1.0
INCLUDEPATH += src src/json src/qt
DEFINES += QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE
DEFINES += BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE
CONFIG += no_include_pwd
CONFIG += thread

Expand Down Expand Up @@ -66,7 +66,6 @@ build_macosx64 {
MINIUPNPC_INCLUDE_PATH=/usr/local/opt/miniupnpc/include
MINIUPNPC_LIB_PATH=/usr/local/Cellar/miniupnpc/1.8.20131007/lib

DEFINES += IS_ARCH_64
QMAKE_CXXFLAGS += -arch x86_64 -stdlib=libc++
QMAKE_CFLAGS += -arch x86_64
QMAKE_LFLAGS += -arch x86_64 -stdlib=libc++
Expand Down Expand Up @@ -197,23 +196,27 @@ QMAKE_CXXFLAGS_WARN_ON = -fdiagnostics-show-option -Wall -Wextra -Wno-ignored-qu
# Input
DEPENDPATH += src src/json src/qt
HEADERS += \
src/qt/transactiontablemodel.h \
src/qt/addresstablemodel.h \
src/qt/coincontroldialog.h \
src/qt/coincontroltreewidget.h \
src/qt/signverifymessagedialog.h \
src/qt/aboutdialog.h \
src/qt/editaddressdialog.h \
src/qt/bitcoinaddressvalidator.h \
src/alert.h \
src/allocators.h \
src/wallet.h \
src/keystore.h \
src/version.h \
src/netbase.h \
src/clientversion.h \
src/threadsafety.h \
src/protocol.h \
src/ui_interface.h \
src/crypter.h \
src/addrman.h \
src/base58.h \
src/bignum.h \
src/chainparams.h \
src/checkpoints.h \
src/compat.h \
src/coincontrol.h \
src/sync.h \
src/util.h \
src/hash.h \
src/uint256.h \
src/kernel.h \
src/scrypt.h \
Expand All @@ -225,18 +228,23 @@ HEADERS += \
src/miner.h \
src/net.h \
src/key.h \
src/eckey.h \
src/db.h \
src/txdb.h \
src/walletdb.h \
src/script.h \
src/stealth.h \
src/ringsig.h \
src/core.h \
src/txmempool.h \
src/state.h \
src/bloom.h \
src/init.h \
src/irc.h \
src/mruset.h \
src/rpcprotocol.h \
src/rpcserver.h \
src/rpcclient.h \
src/json/json_spirit_writer_template.h \
src/json/json_spirit_writer.h \
src/json/json_spirit_value.h \
Expand All @@ -246,6 +254,14 @@ HEADERS += \
src/json/json_spirit_reader.h \
src/json/json_spirit_error_position.h \
src/json/json_spirit.h \
src/qt/transactiontablemodel.h \
src/qt/addresstablemodel.h \
src/qt/coincontroldialog.h \
src/qt/coincontroltreewidget.h \
src/qt/signverifymessagedialog.h \
src/qt/aboutdialog.h \
src/qt/editaddressdialog.h \
src/qt/bitcoinaddressvalidator.h \
src/qt/clientmodel.h \
src/qt/guiutil.h \
src/qt/transactionrecord.h \
Expand All @@ -254,48 +270,34 @@ HEADERS += \
src/qt/monitoreddatamapper.h \
src/qt/transactiondesc.h \
src/qt/bitcoinamountfield.h \
src/wallet.h \
src/keystore.h \
src/qt/walletmodel.h \
src/bitcoinrpc.h \
src/qt/csvmodelwriter.h \
src/crypter.h \
src/qt/qvalidatedlineedit.h \
src/qt/bitcoinunits.h \
src/qt/qvaluecombobox.h \
src/qt/askpassphrasedialog.h \
src/protocol.h \
src/qt/notificator.h \
src/qt/qtipcserver.h \
src/allocators.h \
src/ui_interface.h \
src/qt/rpcconsole.h \
src/qt/paymentserver.h \
src/qt/peertablemodel.h \
src/qt/scicon.h \
src/qt/trafficgraphwidget.h \
src/version.h \
src/netbase.h \
src/clientversion.h \
src/threadsafety.h \
src/qt/messagemodel.h \
src/qt/shadowgui.h \
src/qt/shadowbridge.h \
src/qt/addressbookpage.h

SOURCES += \
src/qt/transactiontablemodel.cpp \
src/qt/addresstablemodel.cpp \
src/qt/coincontroldialog.cpp \
src/qt/coincontroltreewidget.cpp \
src/qt/signverifymessagedialog.cpp \
src/qt/aboutdialog.cpp \
src/qt/editaddressdialog.cpp \
src/qt/bitcoinaddressvalidator.cpp \
src/alert.cpp \
src/version.cpp \
src/chainparams.cpp \
src/sync.cpp \
src/smessage.cpp \
src/util.cpp \
src/hash.cpp \
src/netbase.cpp \
src/key.cpp \
src/eckey.cpp \
src/script.cpp \
src/main.cpp \
src/miner.cpp \
Expand All @@ -306,53 +308,67 @@ SOURCES += \
src/addrman.cpp \
src/db.cpp \
src/walletdb.cpp \
src/qt/clientmodel.cpp \
src/qt/guiutil.cpp \
src/qt/transactionrecord.cpp \
src/qt/optionsmodel.cpp \
src/qt/monitoreddatamapper.cpp \
src/qt/transactiondesc.cpp \
src/qt/bitcoinstrings.cpp \
src/qt/bitcoinamountfield.cpp \
src/noui.cpp \
src/kernel.cpp \
src/scrypt-arm.S \
src/scrypt-x86.S \
src/scrypt-x86_64.S \
src/scrypt.cpp \
src/pbkdf2.cpp \
src/stealth.cpp \
src/ringsig.cpp \
src/core.cpp \
src/txmempool.cpp \
src/wallet.cpp \
src/keystore.cpp \
src/qt/walletmodel.cpp \
src/bitcoinrpc.cpp \
src/state.cpp \
src/bloom.cpp \
src/crypter.cpp \
src/protocol.cpp \
src/rpcprotocol.cpp \
src/rpcserver.cpp \
src/rpcclient.cpp \
src/rpcdump.cpp \
src/rpcnet.cpp \
src/rpcmining.cpp \
src/rpcwallet.cpp \
src/rpcblockchain.cpp \
src/rpcrawtransaction.cpp \
src/rpcsmessage.cpp \
src/qt/transactiontablemodel.cpp \
src/qt/addresstablemodel.cpp \
src/qt/coincontroldialog.cpp \
src/qt/coincontroltreewidget.cpp \
src/qt/signverifymessagedialog.cpp \
src/qt/aboutdialog.cpp \
src/qt/editaddressdialog.cpp \
src/qt/bitcoinaddressvalidator.cpp \
src/qt/clientmodel.cpp \
src/qt/guiutil.cpp \
src/qt/transactionrecord.cpp \
src/qt/optionsmodel.cpp \
src/qt/monitoreddatamapper.cpp \
src/qt/transactiondesc.cpp \
src/qt/bitcoinstrings.cpp \
src/qt/bitcoinamountfield.cpp \
src/qt/walletmodel.cpp \
src/qt/csvmodelwriter.cpp \
src/crypter.cpp \
src/qt/qvalidatedlineedit.cpp \
src/qt/bitcoinunits.cpp \
src/qt/qvaluecombobox.cpp \
src/qt/askpassphrasedialog.cpp \
src/protocol.cpp \
src/qt/notificator.cpp \
src/qt/qtipcserver.cpp \
src/qt/rpcconsole.cpp \
src/qt/paymentserver.cpp \
src/qt/peertablemodel.cpp \
src/qt/scicon.cpp \
src/qt/trafficgraphwidget.cpp \
src/qt/messagemodel.cpp \
src/noui.cpp \
src/kernel.cpp \
src/scrypt-arm.S \
src/scrypt-x86.S \
src/scrypt-x86_64.S \
src/scrypt.cpp \
src/pbkdf2.cpp \
src/stealth.cpp \
src/ringsig.cpp \
src/core.cpp \
src/qt/shadowgui.cpp \
src/qt/shadow.cpp \
src/qt/shadowbridge.cpp \
src/qt/addressbookpage.cpp \
src/state.cpp \
src/bloom.cpp
src/qt/addressbookpage.cpp


FORMS += \
src/qt/forms/coincontroldialog.ui \
Expand Down
13 changes: 6 additions & 7 deletions src/addrman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "addrman.h"

using namespace std;
#include "hash.h"

int CAddrInfo::GetTriedBucket(const std::vector<unsigned char> &nKey) const
{
Expand Down Expand Up @@ -260,7 +259,7 @@ void CAddrMan::MakeTried(CAddrInfo& info, int nId, int nOrigin)

void CAddrMan::Good_(const CService &addr, int64_t nTime)
{
// printf("Good: addr=%s\n", addr.ToString().c_str());
// LogPrintf("Good: addr=%s\n", addr.ToString().c_str());

int nId;
CAddrInfo *pinfo = Find(addr, &nId);
Expand Down Expand Up @@ -303,7 +302,7 @@ void CAddrMan::Good_(const CService &addr, int64_t nTime)
// TODO: maybe re-add the node, but for now, just bail out
if (nUBucket == -1) return;

printf("Moving %s to tried\n", addr.ToString().c_str());
LogPrintf("Moving %s to tried\n", addr.ToString().c_str());

// move nId to the tried tables
MakeTried(info, nId, nUBucket);
Expand All @@ -324,7 +323,7 @@ bool CAddrMan::Add_(const CAddress &addr, const CNetAddr& source, int64_t nTimeP
bool fCurrentlyOnline = (GetAdjustedTime() - addr.nTime < 24 * 60 * 60);
int64_t nUpdateInterval = (fCurrentlyOnline ? 60 * 60 : 24 * 60 * 60);
if (addr.nTime && (!pinfo->nTime || pinfo->nTime < addr.nTime - nUpdateInterval - nTimePenalty))
pinfo->nTime = max((int64_t)0, addr.nTime - nTimePenalty);
pinfo->nTime = std::max((int64_t)0, addr.nTime - nTimePenalty);

// add services
pinfo->nServices |= addr.nServices;
Expand All @@ -350,8 +349,8 @@ bool CAddrMan::Add_(const CAddress &addr, const CNetAddr& source, int64_t nTimeP
} else
{
pinfo = Create(addr, source, &nId);
pinfo->nTime = max((int64_t)0, (int64_t)pinfo->nTime - nTimePenalty);
// printf("Added %s [nTime=%fhr]\n", pinfo->ToString().c_str(), (GetAdjustedTime() - pinfo->nTime) / 3600.0);
pinfo->nTime = std::max((int64_t)0, (int64_t)pinfo->nTime - nTimePenalty);
// LogPrintf("Added %s [nTime=%fhr]\n", pinfo->ToString().c_str(), (GetAdjustedTime() - pinfo->nTime) / 3600.0);
nNew++;
fNew = true;
};
Expand Down
6 changes: 3 additions & 3 deletions src/addrman.h
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ class CAddrMan
LOCK(cs);
int err;
if ((err=Check_()))
printf("ADDRMAN CONSISTENCY CHECK FAILED!!! err=%i\n", err);
LogPrintf("ADDRMAN CONSISTENCY CHECK FAILED!!! err=%i\n", err);
}
#endif
}
Expand All @@ -419,7 +419,7 @@ class CAddrMan
Check();
}
if (fRet)
printf("Added %s from %s: %i tried, %i new\n", addr.ToStringIPPort().c_str(), source.ToString().c_str(), nTried, nNew);
LogPrintf("Added %s from %s: %i tried, %i new\n", addr.ToStringIPPort().c_str(), source.ToString().c_str(), nTried, nNew);
return fRet;
}

Expand All @@ -435,7 +435,7 @@ class CAddrMan
Check();
}
if (nAdd)
printf("Added %i addresses from %s: %i tried, %i new\n", nAdd, source.ToString().c_str(), nTried, nNew);
LogPrintf("Added %i addresses from %s: %i tried, %i new\n", nAdd, source.ToString().c_str(), nTried, nNew);
return nAdd > 0;
}

Expand Down

0 comments on commit 2a74cf1

Please sign in to comment.