Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 0)
define(_CLIENT_VERSION_MINOR, 9)
define(_CLIENT_VERSION_REVISION, 4)
define(_CLIENT_VERSION_BUILD, 0)
define(_CLIENT_VERSION_BUILD, 3)
define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2015)
AC_INIT([GameCredits Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[info@bitmark.org],[bitmark])
AC_INIT([GameCredits Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[info@bitmark.org],[gamecredits])
AC_CONFIG_AUX_DIR([src/build-aux])
AC_CONFIG_MACRO_DIR([src/m4])
AC_CANONICAL_HOST
Expand Down
4 changes: 2 additions & 2 deletions contrib/gitian-descriptors/deps-linux.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: "bitmark"
name: "gamecredits"
suites:
- "precise"
architectures:
Expand Down Expand Up @@ -95,4 +95,4 @@ script: |
done
#
cd $STAGING
find include lib bin host | sort | zip -X@ $OUTDIR/bitmark-deps-linux${GBUILD_BITS}-gitian-r9.zip
find include lib bin host | sort | zip -X@ $OUTDIR/gamecredits-deps-linux${GBUILD_BITS}-gitian-r9.zip
4 changes: 2 additions & 2 deletions contrib/gitian-descriptors/deps-win.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: "bitmark-deps"
name: "gamecredits-deps"
suites:
- "precise"
architectures:
Expand Down Expand Up @@ -124,5 +124,5 @@ script: |
done
#
cd $INSTALLPREFIX
find include lib | sort | zip -X@ $OUTDIR/bitmark-deps-win$BITS-gitian-r16.zip
find include lib | sort | zip -X@ $OUTDIR/gamecredits-deps-win$BITS-gitian-r16.zip
done # for BITS in
22 changes: 11 additions & 11 deletions contrib/gitian-descriptors/gitian-linux.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: "bitmark"
name: "gamecredits"
suites:
- "precise"
architectures:
Expand All @@ -22,11 +22,11 @@ packages:
- "libqt4-test"
reference_datetime: "2013-06-01 00:00:00"
remotes:
- "url": "https://github.com/project-bitmark/gamecredits.git"
"dir": "bitmark"
- "url": "https://github.com/noise23/gamecredits.git"
"dir": "gamecredits"
files:
- "bitmark-deps-linux32-gitian-r9.zip"
- "bitmark-deps-linux64-gitian-r9.zip"
- "gamecredits-deps-linux32-gitian-r9.zip"
- "gamecredits-deps-linux64-gitian-r9.zip"
- "boost-linux32-1.55.0-gitian-r1.zip"
- "boost-linux64-1.55.0-gitian-r1.zip"
- "qt-linux32-4.8.6-gitian-r1.tar.gz"
Expand All @@ -43,13 +43,13 @@ script: |
#
mkdir -p $STAGING
cd $STAGING
unzip ../build/bitmark-deps-linux${GBUILD_BITS}-gitian-r9.zip
unzip ../build/gamecredits-deps-linux${GBUILD_BITS}-gitian-r9.zip
unzip ../build/boost-linux${GBUILD_BITS}-1.55.0-gitian-r1.zip
tar -zxf ../build/qt-linux${GBUILD_BITS}-4.8.6-gitian-r1.tar.gz
cd ../build

# Avoid exporting *any* symbols from the executable
# This avoids conflicts between the libraries statically linked into bitmark and any
# This avoids conflicts between the libraries statically linked into gamecredits and any
# libraries we may link dynamically (such as Qt and OpenSSL, see issue #4094).
# It also avoids start-up overhead to not export any unnecessary symbols.
# To do this, build a linker script that marks all symbols as local.
Expand All @@ -59,14 +59,14 @@ script: |
local: *;
};' > $LINKER_SCRIPT
function do_configure {
./configure "$@" --enable-upnp-default --prefix=$STAGING --with-protoc-bindir=$STAGING/host/bin --with-qt-bindir=$STAGING/bin --with-boost=$STAGING --disable-maintainer-mode --disable-dependency-tracking PKG_CONFIG_PATH="$STAGING/lib/pkgconfig" CPPFLAGS="-I$STAGING/include ${OPTFLAGS}" LDFLAGS="-L$STAGING/lib -Wl,--version-script=$LINKER_SCRIPT ${OPTFLAGS}" CXXFLAGS="-frandom-seed=bitmark ${OPTFLAGS}" BOOST_CHRONO_EXTRALIBS="-lrt" --enable-glibc-back-compat
./configure "$@" --enable-upnp-default --prefix=$STAGING --with-protoc-bindir=$STAGING/host/bin --with-qt-bindir=$STAGING/bin --with-boost=$STAGING --disable-maintainer-mode --disable-dependency-tracking PKG_CONFIG_PATH="$STAGING/lib/pkgconfig" CPPFLAGS="-I$STAGING/include ${OPTFLAGS}" LDFLAGS="-L$STAGING/lib -Wl,--version-script=$LINKER_SCRIPT ${OPTFLAGS}" CXXFLAGS="-frandom-seed=gamecredits ${OPTFLAGS}" BOOST_CHRONO_EXTRALIBS="-lrt" --enable-glibc-back-compat
}
#
cd bitmark
cd gamecredits
./autogen.sh
do_configure
make dist
DISTNAME=`echo bitmark-*.tar.gz`
DISTNAME=`echo gamecredits-*.tar.gz`

# Build dynamic versions of everything
# (with static linking to boost and openssl as well a some non-OS deps)
Expand All @@ -83,4 +83,4 @@ script: |
rm -rf $TEMPDIR
mkdir -p $TEMPDIR
cd $TEMPDIR
tar -xvf $HOME/build/bitmark/$DISTNAME | sort | tar --no-recursion -cT /dev/stdin --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 --mtime="$REFERENCE_DATETIME" | gzip -n > $OUTDIR/src/$DISTNAME
tar -xvf $HOME/build/gamecredits/$DISTNAME | sort | tar --no-recursion -cT /dev/stdin --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 --mtime="$REFERENCE_DATETIME" | gzip -n > $OUTDIR/src/$DISTNAME
10 changes: 5 additions & 5 deletions contrib/gitian-descriptors/gitian-osx-bitmark.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: "bitmark"
name: "gamecredits"
suites:
- "precise"
architectures:
Expand All @@ -14,8 +14,8 @@ packages:

reference_datetime: "2013-06-01 00:00:00"
remotes:
- "url": "https://github.com/project-bitmark/bitmark.git"
"dir": "bitmark"
- "url": "https://github.com/noise23/gamecredits.git"
"dir": "gamecredits"
files:
- "osx-native-depends-r3.tar.gz"
- "osx-depends-r7.tar.gz"
Expand All @@ -41,7 +41,7 @@ script: |
tar -C osx-cross-depends -xf osx-depends-qt-5.2.1-r6.tar.gz
export PATH=`pwd`/osx-cross-depends/native-prefix/bin:$PATH

cd bitmark
cd gamecredits

export ZERO_AR_DATE=1
export QT_RCC_TEST=1
Expand All @@ -50,7 +50,7 @@ script: |
make dist
mkdir -p distsrc
cd distsrc
tar --strip-components=1 -xf ../bitmark-*.tar*
tar --strip-components=1 -xf ../gamecredits-*.tar*
./configure --host=${HOST} --with-boost=${PREFIX} CC=clang CXX=clang++ OBJC=clang OBJCXX=clang++ CFLAGS="-target ${HOST} -mmacosx-version-min=10.6 --sysroot ${SDK} -msse2 -Qunused-arguments" CXXFLAGS="-target ${HOST} -mmacosx-version-min=10.6 --sysroot ${SDK} -msse2 -Qunused-arguments" LDFLAGS="-B${NATIVEPREFIX}/bin -L${PREFIX}/lib -L${SDK}/usr/lib/i686-apple-darwin10/4.2.1" CPPFLAGS="-I${NATIVEPREFIX}/lib/clang/3.2/include -I${PREFIX}/include" SSL_LIBS="-lz -lssl -lcrypto" --disable-tests -with-gui=qt5 PKG_CONFIG_LIBDIR="${PREFIX}/lib/pkgconfig" --disable-dependency-tracking --disable-maintainer-mode
make $MAKEOPTS
export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1
Expand Down
22 changes: 11 additions & 11 deletions contrib/gitian-descriptors/gitian-win.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: "bitmark"
name: "gamecredits"
suites:
- "precise"
architectures:
Expand All @@ -19,15 +19,15 @@ packages:

reference_datetime: "2013-06-01 00:00:00"
remotes:
- "url": "https://github.com/project-bitmark/bitmark.git"
"dir": "bitmark"
- "url": "https://github.com/noise23/gamecredits.git"
"dir": "gamecredits"
files:
- "qt-win32-5.2.0-gitian-r3.zip"
- "qt-win64-5.2.0-gitian-r3.zip"
- "boost-win32-1.55.0-gitian-r6.zip"
- "boost-win64-1.55.0-gitian-r6.zip"
- "bitmark-deps-win32-gitian-r16.zip"
- "bitmark-deps-win64-gitian-r16.zip"
- "gamecredits-deps-win32-gitian-r16.zip"
- "gamecredits-deps-win64-gitian-r16.zip"
- "protobuf-win32-2.5.0-gitian-r4.zip"
- "protobuf-win64-2.5.0-gitian-r4.zip"
script: |
Expand Down Expand Up @@ -61,13 +61,13 @@ script: |
cd $STAGING
unzip $INDIR/qt-win${BITS}-5.2.0-gitian-r3.zip
unzip $INDIR/boost-win${BITS}-1.55.0-gitian-r6.zip
unzip $INDIR/bitmark-deps-win${BITS}-gitian-r16.zip
unzip $INDIR/gamecredits-deps-win${BITS}-gitian-r16.zip
unzip $INDIR/protobuf-win${BITS}-2.5.0-gitian-r4.zip
if [ "$NEEDDIST" == "1" ]; then
# Make source code archive which is architecture independent so it only needs to be done once
cd $HOME/build/bitmark
cd $HOME/build/gamecredits
./autogen.sh
./configure --bindir=$OUTDIR --prefix=$STAGING --host=$HOST --with-qt-plugindir=$STAGING/plugins --with-qt-incdir=$STAGING/include --with-qt-bindir=$STAGING/host/bin --with-boost=$STAGING --disable-maintainer-mode --with-protoc-bindir=$STAGING/host/bin --disable-dependency-tracking CPPFLAGS="-I$STAGING/include ${OPTFLAGS}" LDFLAGS="-L$STAGING/lib ${OPTFLAGS}" CXXFLAGS="-frandom-seed=bitmark ${OPTFLAGS}"
./configure --bindir=$OUTDIR --prefix=$STAGING --host=$HOST --with-qt-plugindir=$STAGING/plugins --with-qt-incdir=$STAGING/include --with-qt-bindir=$STAGING/host/bin --with-boost=$STAGING --disable-maintainer-mode --with-protoc-bindir=$STAGING/host/bin --disable-dependency-tracking CPPFLAGS="-I$STAGING/include ${OPTFLAGS}" LDFLAGS="-L$STAGING/lib ${OPTFLAGS}" CXXFLAGS="-frandom-seed=gamecredits ${OPTFLAGS}"
make dist
DISTNAME=`echo bitmark-*.tar.gz`
NEEDDIST=0
Expand All @@ -76,8 +76,8 @@ script: |
cd $BUILDDIR
mkdir -p distsrc
cd distsrc
tar --strip-components=1 -xf $HOME/build/bitmark/$DISTNAME
./configure --enable-upnp-default --bindir=$BINDIR --prefix=$STAGING --host=$HOST --with-qt-plugindir=$STAGING/plugins --with-qt-incdir=$STAGING/include --with-qt-bindir=$STAGING/host/bin --with-boost=$STAGING --disable-maintainer-mode --with-protoc-bindir=$STAGING/host/bin --disable-dependency-tracking CPPFLAGS="-I$STAGING/include ${OPTFLAGS}" LDFLAGS="-L$STAGING/lib ${OPTFLAGS}" CXXFLAGS="-frandom-seed=bitmark ${OPTFLAGS}"
tar --strip-components=1 -xf $HOME/build/gamecredits/$DISTNAME
./configure --enable-upnp-default --bindir=$BINDIR --prefix=$STAGING --host=$HOST --with-qt-plugindir=$STAGING/plugins --with-qt-incdir=$STAGING/include --with-qt-bindir=$STAGING/host/bin --with-boost=$STAGING --disable-maintainer-mode --with-protoc-bindir=$STAGING/host/bin --disable-dependency-tracking CPPFLAGS="-I$STAGING/include ${OPTFLAGS}" LDFLAGS="-L$STAGING/lib ${OPTFLAGS}" CXXFLAGS="-frandom-seed=gamecredits ${OPTFLAGS}"
export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1
export FAKETIME=$REFERENCE_DATETIME
make $MAKEOPTS
Expand All @@ -93,5 +93,5 @@ script: |
rm -rf $TEMPDIR
mkdir -p $TEMPDIR
cd $TEMPDIR
tar -xvf $HOME/build/bitmark/$DISTNAME | sort | tar --no-recursion -cT /dev/stdin --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 --mtime="$REFERENCE_DATETIME" | gzip -n > $OUTDIR/src/$DISTNAME
tar -xvf $HOME/build/gamecredits/$DISTNAME | sort | tar --no-recursion -cT /dev/stdin --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 --mtime="$REFERENCE_DATETIME" | gzip -n > $OUTDIR/src/$DISTNAME

8 changes: 4 additions & 4 deletions contrib/gitian-descriptors/qt-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ reference_datetime: "2011-01-30 00:00:00"
remotes: []
files:
- "qt-everywhere-opensource-src-5.2.0.tar.gz"
- "bitmark-deps-win32-gitian-r16.zip"
- "bitmark-deps-win64-gitian-r16.zip"
- "gamecredits-deps-win32-gitian-r16.zip"
- "gamecredits-deps-win64-gitian-r16.zip"
script: |
# Defines
export TZ=UTC
Expand Down Expand Up @@ -46,9 +46,9 @@ script: |
#
mkdir -p $INSTALLPREFIX $INSTALLPREFIX/host/bin $DEPSDIR $BUILDDIR
#
# Need mingw-compiled openssl from bitmark-deps:
# Need mingw-compiled openssl from gamecredits-deps:
cd $DEPSDIR
unzip $INDIR/bitmark-deps-win${BITS}-gitian-r16.zip
unzip $INDIR/gamecredits-deps-win${BITS}-gitian-r16.zip
#
cd $BUILDDIR
#
Expand Down
2 changes: 1 addition & 1 deletion src/clientversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#define CLIENT_VERSION_MAJOR 0
#define CLIENT_VERSION_MINOR 9
#define CLIENT_VERSION_REVISION 4
#define CLIENT_VERSION_BUILD 0
#define CLIENT_VERSION_BUILD 3

// Set to true for release, false for prerelease or test build
#define CLIENT_VERSION_IS_RELEASE true
Expand Down
53 changes: 49 additions & 4 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1222,6 +1222,11 @@ static const int64_t nTargetTimespan = 3.5 * 24 * 60 * 60;
static const int64_t nTargetSpacing = 2.5 * 60;
static const int64_t nInterval = nTargetTimespan / nTargetSpacing;

// V3 Targets
static const int64_t nTargetTimespannew = 30 * 60; // every 30 minutes
static const int64_t nTargetSpacingnew = 1.5 * 60; // 90 sec
static const int64_t nIntervalnew = nTargetTimespannew / nTargetSpacingnew;


unsigned int static KimotoGravityWell(const CBlockIndex* pindexLast, const CBlockHeader *pblock, uint64_t TargetBlocksSpacingSeconds, uint64_t PastBlocksMin, uint64_t PastBlocksMax) {
/* current difficulty formula, megacoin - kimoto gravity well */
Expand Down Expand Up @@ -1353,6 +1358,37 @@ unsigned int static GetNextWorkRequired_OLD(const CBlockIndex* pindexLast, const
return bnNew.GetCompact();
}

unsigned int static GetNextWorkRequired_V3(const CBlockIndex* pindexLast, const CBlockHeader *pblock)
{
const CBigNum &bnProofOfWorkLimit = Params().ProofOfWorkLimit();
unsigned int nProofOfWorkLimit = bnProofOfWorkLimit.GetCompact();

// Genesis block
if (pindexLast == NULL)
return nProofOfWorkLimit;

const CBlockIndex* pindexFirst = pindexLast->pprev;
int64_t nActualSpacing = pindexLast->GetBlockTime() - pindexFirst->GetBlockTime();

// limit the adjustment
if (nActualSpacing < nTargetSpacingnew/16)
nActualSpacing = nTargetSpacingnew/16;
if (nActualSpacing > nTargetSpacingnew*16)
nActualSpacing = nTargetSpacingnew*16;

// Retarget
CBigNum bnNew;
bnNew.SetCompact(pindexLast->nBits);
bnNew *= ((nIntervalnew - 1) * nTargetSpacingnew + 2 * nActualSpacing);
bnNew /= ((nIntervalnew + 1) * nTargetSpacingnew);

if (bnNew > bnProofOfWorkLimit)
bnNew = bnProofOfWorkLimit;


return bnNew.GetCompact();
}

unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHeader *pblock)
{
unsigned int nHeight = pindexLast->nHeight + 1;
Expand All @@ -1366,22 +1402,31 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHead
if(nHeight < 15332) {
// KGW v1
return GetNextWorkRequired_OLD(pindexLast, pblock);
} else if(nHeight < 1036320) {
}
else if(nHeight < 1036320) {
// Former 30 Second Block Target, KGW 2 Prefork
BlocksTargetSpacing = 30;
} else {
uint64_t PastBlocksMin = PastSecondsMin / BlocksTargetSpacing;
uint64_t PastBlocksMax = PastSecondsMax / BlocksTargetSpacing;
return KimotoGravityWell(pindexLast, pblock, BlocksTargetSpacing, PastBlocksMin, PastBlocksMax);
}
else if(nHeight < 1096772) {
// New 90 Second Block Target, KGW 2 Postfork
BlocksTargetSpacing = 90;
}
uint64_t PastBlocksMin = PastSecondsMin / BlocksTargetSpacing;
uint64_t PastBlocksMin = PastSecondsMin / BlocksTargetSpacing;
uint64_t PastBlocksMax = PastSecondsMax / BlocksTargetSpacing;
return KimotoGravityWell(pindexLast, pblock, BlocksTargetSpacing, PastBlocksMin, PastBlocksMax);
}
else {
return GetNextWorkRequired_V3(pindexLast, pblock);
}
}

//
// minimum amount of work that could possibly be required nTime after
// minimum work required was nBase
//

unsigned int ComputeMinWork(unsigned int nBase, int64_t nTime)
{
const CBigNum &bnLimit = Params().ProofOfWorkLimit();
Expand Down
Loading