Skip to content

Commit

Permalink
MultiSend Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MotoAcidic committed Dec 28, 2018
1 parent 718cefc commit 429906a
Show file tree
Hide file tree
Showing 34 changed files with 1,219 additions and 749 deletions.
18 changes: 10 additions & 8 deletions .gitignore
Expand Up @@ -128,17 +128,17 @@ CMakeLists.txt
cmake-build-debug
config.log
config.status
/.vs/smrtc/v15/Browse.VC.db
/.vs/smrtc/v15/Browse.VC.opendb
/.vs/ccbc/v15/Browse.VC.db
/.vs/ccbc/v15/Browse.VC.opendb
/.vs/ProjectSettings.json
/.vs/slnx.sqlite
/.vs/smrtc/v15/.suo
/.vs/ccbc/v15/.suo
/.vs/VSWorkspaceState.json
.vs/smrtc/v15/ipch/AutoPCH/265c25126fc6063c/GUIUTIL.ipch
.vs/smrtc/v15/ipch/AutoPCH/3fc496d53ea39c11/BLOCKEXPLORER.ipch
.vs/smrtc/v15/ipch/AutoPCH/5296bec56a7191ec/MASTERNODEMAN.ipch
.vs/smrtc/v15/ipch/AutoPCH/6883191c1916ca26/AMOUNT.ipch
.vs/smrtc/v15/ipch/AutoPCH/8d46eca7c6902300/INIT.ipch
.vs/ccbc/v15/ipch/AutoPCH/265c25126fc6063c/GUIUTIL.ipch
.vs/ccbc/v15/ipch/AutoPCH/3fc496d53ea39c11/BLOCKEXPLORER.ipch
.vs/ccbc/v15/ipch/AutoPCH/5296bec56a7191ec/MASTERNODEMAN.ipch
.vs/ccbc/v15/ipch/AutoPCH/6883191c1916ca26/AMOUNT.ipch
.vs/ccbc/v15/ipch/AutoPCH/8d46eca7c6902300/INIT.ipch
.vs/CCBC/v15/.suo
.vs/CCBC/v15/Browse.VC.db
.vs/CCBC/v15/Browse.VC.opendb
Expand Down Expand Up @@ -177,3 +177,5 @@ config.status
.vs/CCBC/v15/ipch/AutoPCH/9303b40c10f48ee/PROTOCOL.ipch
.vs/CCBC/v15/ipch/AutoPCH/8e27fc15d56f71b3/STATSPAGE.ipch
.vs/CCBC/v15/ipch/AutoPCH/8e27fc15d56f71b3/STATSPAGE.ipch
.vs/CCBC/v15/ipch/AutoPCH/825640fe6bc8e9a9/STATSPAGE.ipch
.vs/CCBC/v15/ipch/AutoPCH/afe6a5de1e24fc45/PRIVACYDIALOG.ipch
2 changes: 1 addition & 1 deletion configure.ac
Expand Up @@ -3,7 +3,7 @@ AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 1)
define(_CLIENT_VERSION_MINOR, 1)
define(_CLIENT_VERSION_REVISION, 0)
define(_CLIENT_VERSION_BUILD, 1)
define(_CLIENT_VERSION_BUILD, 2)

define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2018)
Expand Down
164 changes: 164 additions & 0 deletions scripts/README.md
@@ -0,0 +1,164 @@
WINDOWS BUILD NOTES
====================

Below are some notes on how to build ccbc Core for Windows.

The options known to work for building ccbc Core on Windows are:

* On Linux, using the [Mingw-w64](https://mingw-w64.org/doku.php) cross compiler tool chain. Ubuntu Bionic 18.04 is required
and is the platform used to build the ccbc Core Windows release binaries.
* On Windows, using [Windows
Subsystem for Linux (WSL)](https://msdn.microsoft.com/commandline/wsl/about) and the Mingw-w64 cross compiler tool chain.

Other options which may work, but which have not been extensively tested are (please contribute instructions):

* On Windows, using a POSIX compatibility layer application such as [cygwin](http://www.cygwin.com/) or [msys2](http://www.msys2.org/).
* On Windows, using a native compiler tool chain such as [Visual Studio](https://www.visualstudio.com).

Installing Windows Subsystem for Linux
---------------------------------------

With Windows 10, Microsoft has released a new feature named the [Windows
Subsystem for Linux (WSL)](https://msdn.microsoft.com/commandline/wsl/about). This
feature allows you to run a bash shell directly on Windows in an Ubuntu-based
environment. Within this environment you can cross compile for Windows without
the need for a separate Linux VM or server. Note that while WSL can be installed with
other Linux variants, such as OpenSUSE, the following instructions have only been
tested with Ubuntu.

This feature is not supported in versions of Windows prior to Windows 10 or on
Windows Server SKUs. In addition, it is available [only for 64-bit versions of
Windows](https://msdn.microsoft.com/en-us/commandline/wsl/install_guide).

Full instructions to install WSL are available on the above link.
To install WSL on Windows 10 with Fall Creators Update installed (version >= 16215.0) do the following:

1. Enable the Windows Subsystem for Linux feature
* Open the Windows Features dialog (`OptionalFeatures.exe`)
* Enable 'Windows Subsystem for Linux'
* Click 'OK' and restart if necessary
2. Install Ubuntu
* Open Microsoft Store and search for "Ubuntu 18.04" or use [this link](https://www.microsoft.com/store/productId/9N9TNGVNDL3Q)
* Click Install
3. Complete Installation
* Open a cmd prompt and type "Ubuntu1804"
* Create a new UNIX user account (this is a separate account from your Windows account)

After the bash shell is active, you can follow the instructions below, starting
with the "Cross-compilation" section. Compiling the 64-bit version is
recommended, but it is possible to compile the 32-bit version.

Cross-compilation for Ubuntu and Windows Subsystem for Linux
------------------------------------------------------------

The steps below can be performed on Ubuntu (including in a VM) or WSL. The depends system
will also work on other Linux distributions, however the commands for
installing the toolchain will be different.

First, install the general dependencies:

sudo apt update
sudo apt upgrade
sudo apt install build-essential libtool autotools-dev automake pkg-config bsdmainutils curl git

A host toolchain (`build-essential`) is necessary because some dependency
packages (such as `protobuf`) need to build host utilities that are used in the
build process.

See [dependencies.md](dependencies.md) for a complete overview.

If you want to build the windows installer with `make deploy` you need [NSIS](https://nsis.sourceforge.io/Main_Page):

sudo apt install nsis

## Building for 64-bit Windows

The first step is to install the mingw-w64 cross-compilation tool chain:

sudo apt install g++-mingw-w64-x86-64

Ubuntu Bionic 18.04 <sup>[1](#footnote1)</sup>:

sudo update-alternatives --config x86_64-w64-mingw32-g++ # Set the default mingw32 g++ compiler option to posix.

Once the toolchain is installed the build steps are common:

Note that for WSL the ccbc Core source path MUST be somewhere in the default mount file system, for
example /usr/src/ccbc, AND not under /mnt/d/. If this is not the case the dependency autoconf scripts will fail.
This means you cannot use a directory that is located directly on the host Windows file system to perform the build.

Acquire the source in the usual way:

git clone https://github.com/CryptoCashBack-Hub/CCBC.git

Once the source code is ready the build steps are below:

PATH=$(echo "$PATH" | sed -e 's/:\/mnt.*//g') # strip out problematic Windows %PATH% imported var
cd depends
make HOST=x86_64-w64-mingw32
cd ..
./autogen.sh # not required when building from tarball
CONFIG_SITE=$PWD/depends/x86_64-w64-mingw32/share/config.site ./configure --prefix=/
make

## Building for 32-bit Windows

To build executables for Windows 32-bit, install the following dependencies:

sudo apt install g++-mingw-w64-i686 mingw-w64-i686-dev

For Ubuntu Bionic 18.04 and Windows Subsystem for Linux <sup>[1](#footnote1)</sup>:

sudo update-alternatives --config i686-w64-mingw32-g++ # Set the default mingw32 g++ compiler option to posix.

Note that for WSL the CCBC Core source path MUST be somewhere in the default mount file system, for
example /usr/src/CCBC, AND not under /mnt/d/. If this is not the case the dependency autoconf scripts will fail.
This means you cannot use a directory that located directly on the host Windows file system to perform the build.

Acquire the source in the usual way:

git clone https://github.com/CryptoCashBack-Hub/CCBC.git

Then build using:

PATH=$(echo "$PATH" | sed -e 's/:\/mnt.*//g') # strip out problematic Windows %PATH% imported var
cd depends
make HOST=i686-w64-mingw32
cd ..
./autogen.sh # not required when building from tarball
CONFIG_SITE=$PWD/depends/i686-w64-mingw32/share/config.site ./configure --prefix=/
make

## Depends system

For further documentation on the depends system see [README.md](../depends/README.md) in the depends directory.

Installation
-------------

After building using the Windows subsystem it can be useful to copy the compiled
executables to a directory on the Windows drive in the same directory structure
as they appear in the release `.zip` archive. This can be done in the following
way. This will install to `c:\workspace\ccbc`, for example:

make install DESTDIR=/mnt/c/workspace/ccbc

You can also create an installer using:

make deploy

Footnotes
---------

<a name="footnote1">1</a>: Starting from Ubuntu Xenial 16.04, both the 32 and 64 bit Mingw-w64 packages install two different
compiler options to allow a choice between either posix or win32 threads. The default option is win32 threads which is the more
efficient since it will result in binary code that links directly with the Windows kernel32.lib. Unfortunately, the headers
required to support win32 threads conflict with some of the classes in the C++11 standard library, in particular std::mutex.
It's not possible to build the ccbc Core code using the win32 version of the Mingw-w64 cross compilers (at least not without
modifying headers in the ccbc Core source code).

### For MacOS and ARM Builds - Need these
Source list is from: https://github.com/bitcoin/bitcoin/blob/master/depends/README.md
```
sudo apt-get install curl librsvg2-bin libtiff-tools bsdmainutils cmake imagemagick libcap-dev libz-dev libbz2-dev python-setuptools
sudo apt-get install curl g++-aarch64-linux-gnu g++-4.8-aarch64-linux-gnu gcc-4.8-aarch64-linux-gnu binutils-aarch64-linux-gnu g++-arm-linux-gnueabihf g++-4.8-arm-linux-gnueabihf gcc-4.8-arm-linux-gnueabihf binutils-arm-linux-gnueabihf g++-4.8-multilib gcc-4.8-multilib binutils-gold bsdmainutils
21 changes: 21 additions & 0 deletions scripts/build-arm32.sh
@@ -0,0 +1,21 @@
#!/bin/sh
cd ..
sudo make clean
chmod 777 -R *
sudo apt-get update
sudo apt-get -y upgrade
cd `pwd`/depends
sudo make -j2 HOST=arm-linux-gnueabihf
cd ..
sudo ./autogen.sh
mkdir `pwd`/db4
wget -c 'http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz'
tar -xzvf db-4.8.30.NC.tar.gz
cd `pwd`/db-4.8.30.NC/build_unix/
../dist/configure --enable-cxx --disable-shared --with-pic --prefix=`pwd`/db4
sudo make install
cd ../../
sudo ./autogen.sh
./configure LDFLAGS="-L`pwd`/db4/lib/" CPPFLAGS="-I`pwd`/db4/include/" --prefix=`pwd`/depends/arm-linux-gnueabihf --enable-glibc-back-compat --enable-reduce-exports LDFLAGS=-static-libstdc++
sudo make -j2
echo "Remember to strip the daemon, cli, and tx files!"
21 changes: 21 additions & 0 deletions scripts/build-arm64.sh
@@ -0,0 +1,21 @@
#!/bin/sh
cd ..
sudo make clean
chmod 777 -R *
sudo apt-get update
sudo apt-get -y upgrade
cd `pwd`/depends
sudo make -j2 HOST=aarch64-linux-gnu
cd ..
sudo ./autogen.sh
mkdir `pwd`/db4
wget -c 'http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz'
tar -xzvf db-4.8.30.NC.tar.gz
cd `pwd`/db-4.8.30.NC/build_unix/
../dist/configure --enable-cxx --disable-shared --with-pic --prefix=`pwd`/db4
sudo make install
cd ../../
sudo ./autogen.sh
./configure LDFLAGS="-L`pwd`/db4/lib/" CPPFLAGS="-I`pwd`/db4/include/" --prefix=`pwd`/depends/aarch64-linux-gnu --enable-glibc-back-compat --enable-reduce-exports LDFLAGS=-static-libstdc++
sudo make -j2
echo "Remember to strip the daemon, cli, and tx files!"
28 changes: 28 additions & 0 deletions scripts/build-mac.sh
@@ -0,0 +1,28 @@
#!/bin/sh
cd ..
sudo make clean
chmod 777 -R *
sudo apt-get update
sudo apt-get -y upgrade
PATH=$(echo "$PATH" | sed -e 's/:\/mnt.*//g')
cd `pwd`/depends
mkdir SDKs
cd SDKs
wget -c https://github.com/phracker/MacOSX-SDKs/releases/download/MacOSX10.11.sdk/MacOSX10.11.sdk.tar.xz
tar -xf MacOSX10.11.sdk.tar.xz
cd ..
sudo make -j2 HOST=x86_64-apple-darwin11
cd ..
sudo ./autogen.sh
mkdir db4
wget -c 'http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz'
tar -xzvf db-4.8.30.NC.tar.gz
cd `pwd`/db-4.8.30.NC/build_unix/
../dist/configure --enable-cxx --disable-shared --with-pic --prefix=`pwd`/db4
sudo make install
cd ../../
sudo ./autogen.sh
./configure --prefix=`pwd`/depends/x86_64-apple-darwin11
sudo make -j2
sudo make deploy
echo "No strip required for this file! DMG file is located in the same folder as this script."
1 change: 1 addition & 0 deletions src/build-maintar.sh → scripts/build-maintar.sh
@@ -1,2 +1,3 @@
cd src
strip ccbc{d,-cli}
tar cvzf CCBC-linux.tar.gz ccbcd ccbc-cli
1 change: 1 addition & 0 deletions src/build-testtar.sh → scripts/build-testtar.sh
@@ -1 +1,2 @@
cd src
tar cvzf CCBC-linux-Testnet.tar.gz ccbcd ccbc-cli
7 changes: 7 additions & 0 deletions scripts/build-win32.sh
@@ -0,0 +1,7 @@
cd ..
./autogen.sh
./configure LDFLAGS="-L`pwd`/db4/lib/" CPPFLAGS="-I`pwd`/db4/include/" --prefix=`pwd`/depends/i686-w64-mingw32
make
cd src
cd qt
strip ccbc-qt.exe
6 changes: 5 additions & 1 deletion build-win64.sh → scripts/build-win64.sh
@@ -1,3 +1,7 @@
cd ..
./autogen.sh # not required when building from tarball
CONFIG_SITE=$PWD/depends/x86_64-w64-mingw32/share/config.site ./configure --prefix=/
make
make
cd src
cd qt
strip ccbc-qt.exe
1 change: 1 addition & 0 deletions buildlinux.sh → scripts/buildlinux.sh
@@ -1,3 +1,4 @@
cd ..
sudo apt update
sudo apt upgrade
sudo apt install build-essential libtool autotools-dev automake pkg-config bsdmainutils curl git
Expand Down
24 changes: 24 additions & 0 deletions scripts/buildwindows32.sh
@@ -0,0 +1,24 @@
cd ..
sudo apt update
sudo apt upgrade
sudo apt install build-essential libtool autotools-dev automake pkg-config bsdmainutils curl git
sudo apt-get install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler

sudo apt-get install software-properties-common
sudo add-apt-repository ppa:bitcoin/bitcoin
sudo apt-get update
sudo apt-get install libdb4.8-dev libdb4.8++-dev
sudo apt-get install libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-program-options-dev libboost-test-dev libboost-thread-dev
sudo apt-get install libzmq3-dev -y
sudo apt-get install libminiupnpc-dev -y
sudo apt-get install libgmp3-dev libevent-dev bsdmainutils libboost-all-dev openssl -y

sudo apt install g++-mingw-w64-i686 mingw-w64-i686-dev
sudo update-alternatives --config i686-w64-mingw32-g++
PATH=$(echo "$PATH" | sed -e 's/:\/mnt.*//g') # strip out problematic Windows %PATH% imported var
cd depends
make HOST=i686-w64-mingw32

cd ..
cd scripts
bash build-win32.sh
3 changes: 2 additions & 1 deletion buildwindows.sh → scripts/buildwindows64.sh
@@ -1,3 +1,4 @@
cd ..
sudo apt update
sudo apt upgrade
sudo apt install build-essential libtool autotools-dev automake pkg-config bsdmainutils curl git
Expand All @@ -18,5 +19,5 @@ PATH=$(echo "$PATH" | sed -e 's/:\/mnt.*//g') # strip out problematic Windows %P
cd depends
make HOST=x86_64-w64-mingw32
cd ..

cd scripts
bash build-win64.sh
2 changes: 1 addition & 1 deletion src/clientversion.h
Expand Up @@ -18,7 +18,7 @@
#define CLIENT_VERSION_MAJOR 1
#define CLIENT_VERSION_MINOR 1
#define CLIENT_VERSION_REVISION 0
#define CLIENT_VERSION_BUILD 1
#define CLIENT_VERSION_BUILD 2

//! Set to true for release, false for prerelease or test build
#define CLIENT_VERSION_IS_RELEASE true
Expand Down
4 changes: 2 additions & 2 deletions src/main.cpp
Expand Up @@ -4660,15 +4660,15 @@ bool ProcessNewBlock(CValidationState& state, CNode* pfrom, CBlock* pblock, CDis
}
}
if (nMints || nSpends)
LogPrintf("%s : block contains %d zCcbc mints and %d zCcbc spends\n", __func__, nMints, nSpends);
LogPrintf("%s : block contains %d zCCBC mints and %d zCCCBC spends\n", __func__, nMints, nSpends);

// ppcoin: check proof-of-stake
// Limited duplicity on stake: prevents block flood attack
// Duplicate stake allowed only when there is orphan child block
//if (pblock->IsProofOfStake() && setStakeSeen.count(pblock->GetProofOfStake())/* && !mapOrphanBlocksByPrev.count(hash)*/)
// return error("ProcessNewBlock() : duplicate proof-of-stake (%s, %d) for block %s", pblock->GetProofOfStake().first.ToString().c_str(), pblock->GetProofOfStake().second, pblock->GetHash().ToString().c_str());

// NovaCoin: check proof-of-stake block signature
// Provided from NovaCoin: check proof-of-stake block signature
if (!pblock->CheckBlockSignature())
return error("ProcessNewBlock() : bad proof-of-stake block signature");

Expand Down

0 comments on commit 429906a

Please sign in to comment.