Commit 8dbc109a authored by Ashot's avatar Ashot
Browse files

Merge branch 'Current-dev'

parents 550f99ba 0c06329d
Showing with 508 additions and 42 deletions
+508 -42
......@@ -116,4 +116,4 @@ qa/pull-tester/test.*/*
.cproject
.project
/doc/doxygen/
\ No newline at end of file
/doc/doxygen/
variables:
GIT_STRATEGY: "clone"
OUTDIR: "out"
MAKEJOBS: "-j4"
CCACHE_SIZE: "100M"
GOAL: "install"
CROWN_CONFIG_ALL: "--disable-tests --disable-reduced-exports --disable-dependency-tracking --prefix=$CI_PROJECT_DIR/depends/$HOST --bindir=$CI_PROJECT_DIR/$OUTDIR/bin --libdir=$CI_PROJECT_DIR/$OUTDIR/lib"
SDK_URL: "https://bitcoincore.org/depends-sources/sdks"
WINEDEBUG: "fixme-all"
cache:
paths:
- depends/built
- depends/sdk-sources
.job_template: &job_definition
stage: build
before_script:
- if [ -n "$PACKAGES" ]; then sudo apt-get update; fi
- if [ -n "$PACKAGES" ]; then sudo apt-get install --no-install-recommends --no-upgrade -qq $PACKAGES; fi
- unset CC; unset CXX
- mkdir -p depends/SDKs depends/sdk-sources out
- if [ -n "$OSX_SDK" -a ! -f depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz ]; then curl --location --fail $SDK_URL/MacOSX${OSX_SDK}.sdk.tar.gz -o depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz; fi
- if [ -n "$OSX_SDK" -a -f depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz ]; then tar -C depends/SDKs -xf depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz; fi
- make $MAKEJOBS -C depends HOST=$HOST $DEP_OPTS
script:
- ./autogen.sh
- mkdir build && cd build
- ../configure --cache-file=config.cache $CROWN_CONFIG_ALL $CROWN_CONFIG
- make distdir VERSION=$HOST
- cd crown-$HOST
- ./configure --cache-file=../config.cache $CROWN_CONFIG_ALL $CROWN_CONFIG
- make $MAKEJOBS $GOAL || ( echo "Build failure. Verbose build follows." && make $GOAL V=1 ; false )
.job_template: &win64_definition
variables:
CROWN_CONFIG: "--enable-mingw"
HOST: "x86_64-w64-mingw32"
PACKAGES: "nsis gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 binutils-mingw-w64-x86-64 wine1.6 bc"
.job_template: &win32_definition
variables:
CROWN_CONFIG: ""
HOST: "i686-w64-mingw32"
PACKAGES: "nsis g++-mingw-w64-i686 gcc-mingw-w64-i686 binutils-mingw-w64-i686 wine1.6 bc"
.job_template: &linux64_definition
variables:
CROWN_CONFIG: "--enable-glibc-back-compat"
HOST: "x86_64-unknown-linux-gnu"
DEP_OPTS: "USE_LINUX_STATIC_QT5=1"
.job_template: &linux32_definition
variables:
CROWN_CONFIG: "--enable-glibc-back-compat"
HOST: "i686-pc-linux-gnu"
DEP_OPTS: "USE_LINUX_STATIC_QT5=1"
PACKAGES: "g++-multilib bc"
.job_template: &raspberrypi_definition
variables:
CROWN_CONFIG: "--enable-glibc-back-compat"
HOST: "arm-linux-gnueabihf"
PACKAGES: "g++-arm-linux-gnueabihf"
.job_template: &osx_definition
variables:
CROWN_CONFIG: ""
HOST: "x86_64-apple-darwin11"
OSX_SDK: "10.7"
PACKAGES: "cmake gcc-multilib g++-multilib libcap-dev libbz2-dev"
# Artifact settings for releases and snapshots
.job_template: &release_definition
artifacts:
paths:
- $OUTDIR
only:
- master
- tags
.job_template: &snapshot_definition
artifacts:
paths:
- $OUTDIR
expire_in: 2 weeks
except:
- master
- tags
# Job definitions for releases
Win64:
<<: *win64_definition
<<: *job_definition
<<: *release_definition
Win32:
<<: *win32_definition
<<: *job_definition
<<: *release_definition
Linux64:
<<: *linux64_definition
<<: *job_definition
<<: *release_definition
Linux32:
<<: *linux32_definition
<<: *job_definition
<<: *release_definition
RaspberryPi:
<<: *raspberrypi_definition
<<: *job_definition
<<: *release_definition
Osx:
<<: *osx_definition
<<: *job_definition
<<: *release_definition
# Job definitions for temporary builds (snapshots)
Win64-snapshot:
<<: *win64_definition
<<: *job_definition
<<: *snapshot_definition
Win32-snapshot:
<<: *win32_definition
<<: *job_definition
<<: *snapshot_definition
Linux64-snapshot:
<<: *linux64_definition
<<: *job_definition
<<: *snapshot_definition
Linux32-snapshot:
<<: *linux32_definition
<<: *job_definition
<<: *snapshot_definition
RaspberryPi-snapshot:
<<: *raspberrypi_definition
<<: *job_definition
<<: *snapshot_definition
Osx-snapshot:
<<: *osx_definition
<<: *job_definition
<<: *snapshot_definition
......@@ -81,7 +81,7 @@ deploy:
skip_cleanup: true
provider: releases
api_key:
secure: "jcw2OYoyW6eVZ3ZV97GNAs+j8aOQO0yy/qEUbEFo3jyPXrrMiYq4IEEAA/FhNv9KSOUyH2pTKQ6Gz8kbZo1Qj49x+9FjDnxDWIX9Jw80WFeB2+pO5lyFiE7KTG96VKsi4Z1dFveg2mmOWHYX1L1wQZMwZWzQCB4hvKbfdsGXwPYZR143OCzUVan7jvEcp5429GUL6zMHfuso+zOT6+CqEEqdTt6xNBMY8xsY/QhZNFD7vVZ4ygUW0/5RAPIzT7a/bBW7IWQ4Xt2hZ6DzBcFM85KsDmOzSaxB9cxSPOKYM9vK5mIe2vIbsl8xNke57wZOw2kHP3wRDXl1Y2+/k3cBzZMn0iQV7eOfM1CYQ8l68yLmTNOSdDLY0NERkrtZGczevGTjIDAFGgMEdE4tsLzarrtdR/gBxYLg7kb+eZWf8it5ECqiIP8Rho3HIKk84vCWPcaT0/ETT4qZd5P1iWDCXiX2yNF2lIavmfl5IzER1aHM4K6dJ09POZABQ1lYo6jGmEJY2U7qTWYXv2pwUd9PB5rZId0Xa2csDUHRU2Ry0Cy5qMbTeQPIVzqvfGXHs2PtMJROhFmk16Vr3nMka+EkBxyqMGdCaZ37s8e7Q6+kk2mdL2Hn/vRW95X8T3X2A5r5oo0VMAPjlsmqc8JdFbgwjX0DYuCxbq+BvaTX4HURY6I="
secure: "FTdTDATd9lQjV2fm7Bz+Qp9kTdudwHmDLseGLoaIKhyK3avZew5LAZk4kqLWT7dQACdgkF3spVrCinAXKAg5t8sGTo08Zy1EP/MQyqBP8vp+ojhCaHP2R1DN9zN5ZI4vMDAvBg2yYQf5s10SsFLj6E2qSUCCrLuh+4O3qU4CGEfiy9NiBYr8DIrFa+lFwB2SqV4w7GCEK6OuJ+KmMA5x53KrfcTOJxVjMHSjIC8kdH+0p4wV/xxshq/s6Z2AUZuHxHTOY0j79WLyBLLOkaZQ8jMoVQh48uARRc4qRgjA9+X9wps3UwofIFlksa2V+hoLBPr0ToV9EHRh/jGPRb2gUPh51sqreJGTXYzawYTcgyPSisk3trOulsKjAiKElKJF2wfwwrs4SgZdPU3LnhAMrwLUN08z66kZab/4W2DYKIvYFBWBK3vgHHz/WevhxdB5l052Ydprcg5Ehk9Q1fWSM3pq7zV1tm+sPEhcPc1vA9CETldo2EOLOMx+aZ/syx17xBMiVSgxyl4XpTzaX+1aYRu7KaMUOH73HO4h4roJaQ4U75Pyp7a5kliKhMLYBIjtB8tU/tGLr1raO6JuuM/2wBHri4bLo7LGUyioPeFvvwJLYvPPRSLvwfPJT2pRcM5BNLx9jg0RrgQUll+YccJ0JDPI8NxWFydBEX/QlhnVMXk="
file:
- ${OUTDIR}/..//Crown-$HOST2.zip
on:
......
Crown Core staging tree 0.12
===============================
`master:` [![Build Status](https://travis-ci.org/Crowndev/crowncoin.svg?branch=master)](https://travis-ci.org/crownpay/crown) `v0.12.0.x:` [![Build Status](https://travis-ci.org/Crowndev/crowncoin.svg?branch=0.12.0.x)](https://travis-ci.org/Crowndev/crowncoin/branches) `v0.12.1.x:` [![Build Status](https://travis-ci.org/Crowndev/crowncoin.svg?branch=0.12.1.x)](https://travis-ci.org/Crowndev/crowncoin/branches)
Travis:
`master:` [![Build Status](https://travis-ci.org/Crowndev/crowncoin.svg?branch=master)](https://travis-ci.org/crownpay/crown) `v0.12.0.x:` [![Build Status](https://travis-ci.org/Crowndev/crowncoin.svg?branch=0.12.0.x)](https://travis-ci.org/Crowndev/crowncoin/branches) `v0.12.1.x:` [![Build Status](https://travis-ci.org/Crowndev/crowncoin.svg?branch=0.12.1.x)](https://travis-ci.org/Crowndev/crowncoin/branches)
Gitlab:
`master:` [![pipeline status](http://gitlab.crown.tech/crown/crown-core/badges/master/pipeline.svg)](http://gitlab.crown.tech/crown/crown-core/commits/master)
http://www.crown.tech
Copyright (c) 2009-2015 Bitcoin Core Developers
Copyright (c) 2014-2017 Crown Core Developers
Copyright (c) 2014-2018 Crown Core Developers
What is Crown?
......
......@@ -3,9 +3,9 @@ AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 0)
define(_CLIENT_VERSION_MINOR, 12)
define(_CLIENT_VERSION_REVISION, 3)
define(_CLIENT_VERSION_BUILD, 0)
define(_CLIENT_VERSION_BUILD, 7)
define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2017)
define(_COPYRIGHT_YEAR, 2018)
AC_INIT([Crown Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[info@crown.tech],[crown])
AC_CONFIG_SRCDIR([src/main.cpp])
AC_CONFIG_HEADERS([src/config/crown-config.h])
......@@ -169,7 +169,7 @@ fi
if test "x$CXXFLAGS_overridden" = "xno"; then
CXXFLAGS="$CXXFLAGS -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter -Wno-self-assign"
fi
CPPFLAGS="$CPPFLAGS -DBOOST_SPIRIT_THREADSAFE -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS"
CPPFLAGS="$CPPFLAGS -DBOOST_NO_CXX11_SCOPED_ENUMS -DBOOST_SPIRIT_THREADSAFE -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS"
AC_ARG_WITH([utils],
[AS_HELP_STRING([--with-utils],
......@@ -688,6 +688,7 @@ if test x$use_pkgconfig = xyes; then
[
PKG_CHECK_MODULES([SSL], [libssl],, [AC_MSG_ERROR(openssl not found.)])
PKG_CHECK_MODULES([CRYPTO], [libcrypto],,[AC_MSG_ERROR(libcrypto not found.)])
PKG_CHECK_MODULES([CURL], [libcurl],, [AC_MSG_ERROR(libcurl not found.)])
BITCOIN_QT_CHECK([PKG_CHECK_MODULES([PROTOBUF], [protobuf], [have_protobuf=yes], [BITCOIN_QT_FAIL(libprotobuf not found)])])
if test x$use_qr != xno; then
BITCOIN_QT_CHECK([PKG_CHECK_MODULES([QR], [libqrencode], [have_qrencode=yes], [have_qrencode=no])])
......@@ -701,6 +702,9 @@ else
AC_CHECK_HEADER([openssl/ssl.h],, AC_MSG_ERROR(libssl headers missing),)
AC_CHECK_LIB([ssl], [main],SSL_LIBS=-lssl, AC_MSG_ERROR(libssl missing))
AC_CHECK_HEADER([curl/curl.h],, AC_MSG_ERROR(libcurl headers missing),)
AC_CHECK_LIB([curl], [main],CURL_LIBS=-lcurl, AC_MSG_ERROR(libcurl missing))
BITCOIN_QT_CHECK(AC_CHECK_LIB([protobuf] ,[main],[PROTOBUF_LIBS=-lprotobuf], BITCOIN_QT_FAIL(libprotobuf not found)))
if test x$use_qr != xno; then
BITCOIN_QT_CHECK([AC_CHECK_LIB([qrencode], [main],[QR_LIBS=-lqrencode], [have_qrencode=no])])
......
package=curl
$(package)_version=7.43.0
$(package)_download_path=https://curl.haxx.se/download
$(package)_file_name=$(package)-$($(package)_version).tar.gz
$(package)_dependencies=openssl
$(package)_sha256_hash=1a084da1edbfc3bd632861358b26af45ba91aaadfb15d6482de55748b8dfc693
define $(package)_set_vars
$(package)_config_opts += --with-ssl=$(host_prefix) --without-librtmp --disable-shared
$(package)_config_opts_darwin = --with-darwinssl
$(package)_config_opts_mingw32 = --with-winssl
endef
define $(package)_preprocess_cmds
sed -i.old "s|-lgdi32 \$$$$LIBS|\$$$$LIBS -lgdi32|" configure
endef
define $(package)_config_cmds
$($(package)_autoconf)
endef
define $(package)_build_cmds
$(MAKE)
endef
define $(package)_stage_cmds
$(MAKE) DESTDIR=$($(package)_staging_dir) install
endef
packages:=boost openssl
packages:=boost openssl curl
native_packages := native_ccache native_comparisontool
qt_native_packages = native_protobuf
......
#!/bin/bash
# Copyright (c) 2018 The Crown developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Usage: ./crown-server-install.sh [OPTION]...
#
# Setup crown server or update existing one
LATEST_RELEASE="v0.12.3.0"
systemnode=false
masternode=false
help=false
install=false
unknown=()
appname=$(basename "$0")
print_help()
{
echo "Usage: $(basename "$0") [OPTION]...
Setup crown server or update existing one
-m, --masternode create a masternode
-s, --systemnode create a systemnode
-p, --privkey=privkey set private key
-v, --version=version set version, default will be the latest release
-h, --help display this help and exit
"
}
handle_arguments()
{
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
-h|--help)
help=true
shift
;;
-m|--masternode)
masternode=true
shift
;;
-s|--systemnode)
systemnode=true
shift
;;
-p|--privkey)
privkey="$2"
shift
shift
;;
--privkey=*)
privkey="${key#*=}"
shift
;;
-v|--version)
LATEST_RELEASE="$2"
shift
shift
;;
--version=*)
LATEST_RELEASE="${key#*=}"
shift
;;
*) # unknown option
unknown+=("$1") # save it in an array
shift
;;
esac
done
if [ "$help" = true ] ; then
print_help
exit 0
fi
# Check if there are unknown arguments
if [ ${#unknown[@]} -gt 0 ] ; then
printf "$appname: unrecognized option '${unknown[0]}'\nTry '$appname --help' for more information.\n"
exit 1
fi
# Check if only one of the options is set
if [ "$masternode" = true ] && [ "$systemnode" = true ] ; then
echo "'-m|masternode' and '-s|--systemnode' options are mutually exclusive."
exit 1
fi
# Check if private key is set and not empty
if [ ! -z ${privkey+x} ] && [ -z "$privkey" ]; then
printf "$appname: option '-p|--privkey' requires an argument'\nTry '$appname --help' for more information.\n"
exit 1
fi
# Check if '-m' or '-s' option is set with '-p'
if [ ! -z "$privkey" ] && [ "$masternode" != true ] && [ "$systemnode" != true ] ; then
printf "$appname: If private key is set '-m' or '-s' option is mandatory'\nTry '$appname --help' for more information.\n"
exit 1
fi
# If private key is set then install otherwise update
if [ ! -z "$privkey" ]; then
install=true
fi
echo $LATEST_RELEASE
}
install_dependencies() {
sudo apt-get install ufw -y
sudo apt-get install unzip -y
}
create_swap() {
sudo mkdir -p /var/cache/swap/
sudo dd if=/dev/zero of=/var/cache/swap/myswap bs=1M count=1024
sudo mkswap /var/cache/swap/myswap
sudo swapon /var/cache/swap/myswap
swap_line='/var/cache/swap/myswap none swap sw 0 0'
# Add the line only once
sudo grep -q -F "$swap_line" /etc/fstab || echo "$swap_line" | sudo tee --append /etc/fstab > /dev/null
cat /etc/fstab
}
update_repos() {
sudo DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" update
sudo DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade
}
download_package() {
# Create temporary directory
dir=`mktemp -d`
if [ -z "$dir" ]; then
# Create directory under $HOME if above operation failed
dir=$HOME/crown-temp
mkdir -p $dir
fi
# Change this later to take latest release version.
wget "https://github.com/Crowndev/crowncoin/releases/download/$LATEST_RELEASE/Crown-Linux64.zip" -O $dir/crown.zip
}
install_package() {
sudo unzip -d $dir/crown $dir/crown.zip
cp $dir/crown/*/bin/* /usr/local/bin/
cp $dir/crown/*/lib/* /usr/local/lib/
rm -rf $tmp
}
configure_conf() {
cd $HOME
mkdir -p .crown
sudo mv .crown/crown.conf .crown/crown.bak
touch .crown/crown.conf
IP=$(curl http://checkip.amazonaws.com/)
PW=$(date +%s | sha256sum | base64 | head -c 32 ;)
echo "==========================================================="
pwd
echo "daemon=1" > .crown/crown.conf
echo "rpcallowip=127.0.0.1" >> .crown/crown.conf
echo "rpcuser=crowncoinrpc">> .crown/crown.conf
echo "rpcpassword="$PW >> .crown/crown.conf
echo "listen=1" >> .crown/crown.conf
echo "server=1" >>.crown/crown.conf
echo "externalip="$IP >>.crown/crown.conf
if [ "$systemnode" = true ] ; then
echo "systemnode=1" >>.crown/crown.conf
echo "systemnodeprivkey="$privkey >>.crown/crown.conf
elif [ "$masternode" = true ] ; then
echo "masternode=1" >>.crown/crown.conf
echo "masternodeprivkey="$privkey >>.crown/crown.conf
fi
cat .crown/crown.conf
}
configure_firewall() {
sudo ufw allow ssh/tcp
sudo ufw limit ssh/tcp
sudo ufw allow 9340/tcp
sudo ufw logging on
sudo ufw --force enable
}
add_cron_job() {
(crontab -l 2>/dev/null; echo "@reboot sudo /usr/local/bin/crownd") | crontab -
}
main() {
# Stop crownd (in case it's running)
sudo crown-cli stop
# Install Packages
install_dependencies
# Download the latest release
download_package
# Extract and install
install_package
if [ "$install" = true ] ; then
# Create swap to help with sync
create_swap
# Update Repos
update_repos
# Create folder structures and configure crown.conf
configure_conf
# Configure firewall
configure_firewall
# Add cron job to restart crownd on reboot
add_cron_job
fi
# Start Crownd to begin sync
sudo crownd
}
handle_arguments "$@"
main
......@@ -121,6 +121,7 @@ BITCOIN_CORE_H = \
rpcclient.h \
rpcprotocol.h \
rpcserver.h \
rpcupdate.h \
script/interpreter.h \
script/script_error.h \
script/script.h \
......@@ -141,6 +142,7 @@ BITCOIN_CORE_H = \
masternode-sync.h \
masternodeman.h \
masternodeconfig.h \
nodeconfig.h \
systemnode.h \
systemnode-payments.h \
systemnode-sync.h \
......@@ -164,7 +166,8 @@ BITCOIN_CORE_H = \
wallet_ismine.h \
compat/byteswap.h \
compat/endian.h \
compat/sanity.h
compat/sanity.h \
updater.h
JSON_H = \
json/json_spirit.h \
......@@ -208,6 +211,7 @@ libbitcoin_server_a_SOURCES = \
rpcmining.cpp \
rpcmisc.cpp \
rpcnet.cpp \
rpcupdate.cpp \
rpcrawtransaction.cpp \
rpcserver.cpp \
script/sigcache.cpp \
......@@ -232,6 +236,7 @@ libbitcoin_wallet_a_SOURCES = \
masternode-payments.cpp \
masternode-sync.cpp \
masternodeconfig.cpp \
nodeconfig.cpp \
masternodeman.cpp \
systemnode-sync.cpp \
systemnode.cpp \
......@@ -243,6 +248,7 @@ libbitcoin_wallet_a_SOURCES = \
wallet.cpp \
wallet_ismine.cpp \
walletdb.cpp \
updater.cpp \
$(BITCOIN_CORE_H)
# crypto primitives library
......@@ -356,7 +362,7 @@ if TARGET_WINDOWS
crownd_SOURCES += crownd-res.rc
endif
crownd_LDADD += $(BOOST_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS)
crownd_LDADD += $(BOOST_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CURL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS)
crownd_CPPFLAGS = $(BITCOIN_INCLUDES)
crownd_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
......@@ -366,6 +372,7 @@ crown_cli_LDADD = \
$(LIBBITCOIN_UTIL) \
$(BOOST_LIBS) \
$(SSL_LIBS) \
$(CURL_LIBS) \
$(CRYPTO_LIBS)
crown_cli_SOURCES = \
......
......@@ -42,7 +42,10 @@ QT_FORMS_UI = \
qt/forms/transactiondescdialog.ui \
qt/forms/multisigaddressentry.ui \
qt/forms/multisigdialog.ui \
qt/forms/multisiginputentry.ui
qt/forms/multisiginputentry.ui \
qt/forms/createnodedialog.ui \
qt/forms/startmissingdialog.ui \
qt/forms/updatedialog.ui
QT_MOC_CPP = \
qt/moc_addressbookpage.cpp \
......@@ -75,6 +78,7 @@ QT_MOC_CPP = \
qt/moc_recentrequeststablemodel.cpp \
qt/moc_rpcconsole.cpp \
qt/moc_sendcoinsdialog.cpp \
qt/moc_sendcollateraldialog.cpp \
qt/moc_sendcoinsentry.cpp \
qt/moc_signverifymessagedialog.cpp \
qt/moc_splashscreen.cpp \
......@@ -88,11 +92,17 @@ QT_MOC_CPP = \
qt/moc_transactionview.cpp \
qt/moc_utilitydialog.cpp \
qt/moc_walletframe.cpp \
qt/moc_privatekeywidget.cpp \
qt/moc_createsystemnodedialog.cpp \
qt/moc_createmasternodedialog.cpp \
qt/moc_createnodedialog.cpp \
qt/moc_startmissingdialog.cpp \
qt/moc_walletmodel.cpp \
qt/moc_walletview.cpp \
qt/moc_multisigaddressentry.cpp \
qt/moc_multisigdialog.cpp \
qt/moc_multisiginputentry.cpp
qt/moc_multisiginputentry.cpp \
qt/moc_updatedialog.cpp
BITCOIN_MM = \
qt/macdockiconhandler.mm \
......@@ -149,10 +159,17 @@ BITCOIN_QT_H = \
qt/rpcconsole.h \
qt/sendcoinsdialog.h \
qt/sendcoinsentry.h \
qt/sendcollateraldialog.h \
qt/signverifymessagedialog.h \
qt/splashscreen.h \
qt/masternodelist.h \
qt/systemnodelist.h \
qt/datetablewidgetitem.h \
qt/privatekeywidget.h \
qt/createsystemnodedialog.h \
qt/createmasternodedialog.h \
qt/createnodedialog.h \
qt/startmissingdialog.h \
qt/trafficgraphwidget.h \
qt/transactiondesc.h \
qt/transactiondescdialog.h \
......@@ -168,7 +185,8 @@ BITCOIN_QT_H = \
qt/winshutdownmonitor.h \
qt/multisigaddressentry.h \
qt/multisigdialog.h \
qt/multisiginputentry.h
qt/multisiginputentry.h \
qt/updatedialog.h
RES_ICONS = \
qt/res/icons/add.png \
......@@ -205,6 +223,7 @@ RES_ICONS = \
qt/res/icons/history.png \
qt/res/icons/key.png \
qt/res/icons/lock_closed.png \
qt/res/icons/notsynced.png \
qt/res/icons/lock_open.png \
qt/res/icons/overview.png \
qt/res/icons/qrcode.png \
......@@ -215,6 +234,9 @@ RES_ICONS = \
qt/res/icons/synced.png \
qt/res/icons/masternode.png \
qt/res/icons/systemnode.png \
qt/res/icons/copy.png \
qt/res/icons/show.png \
qt/res/icons/hide.png \
qt/res/icons/toolbar.png \
qt/res/icons/transaction0.png \
qt/res/icons/transaction2.png \
......@@ -273,10 +295,15 @@ BITCOIN_QT_CPP += \
qt/receiverequestdialog.cpp \
qt/recentrequeststablemodel.cpp \
qt/sendcoinsdialog.cpp \
qt/sendcollateraldialog.cpp \
qt/sendcoinsentry.cpp \
qt/signverifymessagedialog.cpp \
qt/masternodelist.cpp \
qt/systemnodelist.cpp \
qt/datetablewidgetitem.cpp \
qt/privatekeywidget.cpp \
qt/createnodedialog.cpp \
qt/startmissingdialog.cpp \
qt/transactiondesc.cpp \
qt/transactiondescdialog.cpp \
qt/transactionfilterproxy.cpp \
......@@ -286,7 +313,8 @@ BITCOIN_QT_CPP += \
qt/walletframe.cpp \
qt/walletmodel.cpp \
qt/walletmodeltransaction.cpp \
qt/walletview.cpp
qt/walletview.cpp \
qt/updatedialog.cpp
endif
RES_IMAGES = \
......@@ -357,7 +385,7 @@ if ENABLE_WALLET
qt_crown_qt_LDADD += $(LIBBITCOIN_WALLET)
endif
qt_crown_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBBITCOIN_UNIVALUE) $(LIBLEVELDB) $(LIBMEMENV) \
$(BOOST_LIBS) $(QT_LIBS) $(QT_DBUS_LIBS) $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) $(LIBSECP256K1)
$(BOOST_LIBS) $(QT_LIBS) $(QT_DBUS_LIBS) $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) $(LIBSECP256K1) $(CURL_LIBS)
qt_crown_qt_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(QT_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
qt_crown_qt_LIBTOOLFLAGS = --tag CXX
......
......@@ -10,11 +10,10 @@
#include "util.h"
#include "utilstrencodings.h"
#include <assert.h>
#include <boost/assign/list_of.hpp>
using namespace std;
#include <assert.h>
using namespace boost::assign;
struct SeedSpec6 {
......@@ -141,7 +140,7 @@ public:
CMutableTransaction txNew;
txNew.vin.resize(1);
txNew.vout.resize(1);
txNew.vin[0].scriptSig = CScript() << 486604799 << CScriptNum(4) << vector<unsigned char>((const unsigned char*)pszTimestamp, (const unsigned char*)pszTimestamp + strlen(pszTimestamp));
txNew.vin[0].scriptSig = CScript() << 486604799 << CScriptNum(4) << std::vector<unsigned char>((const unsigned char*)pszTimestamp, (const unsigned char*)pszTimestamp + strlen(pszTimestamp));
txNew.vout[0].nValue = 10 * COIN;
txNew.vout[0].scriptPubKey = CScript() << ParseHex("04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f") << OP_CHECKSIG;
genesis.vtx.push_back(txNew);
......@@ -215,9 +214,11 @@ static CMainParams mainParams;
/**
* Testnet (v3)
*/
class CTestNetParams : public CMainParams {
class CTestNetParams : public CMainParams
{
public:
CTestNetParams() {
CTestNetParams()
{
networkID = CBaseChainParams::TESTNET;
strNetworkID = "test";
pchMessageStart[0] = 0x0f;
......@@ -230,8 +231,8 @@ public:
nRejectBlockOutdatedMajority = 75;
nToCheckBlockUpgradeMajority = 100;
nMinerThreads = 0;
nTargetTimespan = 2 * 24 * 60 * 60; // Crown: 2 day
nTargetSpacing = 1.5 * 60; // Crown: 1.5 minutes
nTargetTimespan = 2 * 24 * 60 * 60; // 2 days
nTargetSpacing = 1.5 * 60; // 1.5 minutes
nMaxTipAge = 0x7fffffff;
//! Modify the testnet genesis block so the timestamp is valid for a later start.
......
......@@ -79,7 +79,7 @@ const std::string CLIENT_NAME("Crown Core");
const std::string CLIENT_BUILD(BUILD_DESC CLIENT_VERSION_SUFFIX);
const std::string CLIENT_DATE(BUILD_DATE);
static std::string FormatVersion(int nVersion)
std::string FormatVersion(int nVersion)
{
if (nVersion % 100 == 0)
return strprintf("%d.%d.%d", nVersion / 1000000, (nVersion / 10000) % 100, (nVersion / 100) % 100);
......
......@@ -17,7 +17,7 @@
#define CLIENT_VERSION_MAJOR 0
#define CLIENT_VERSION_MINOR 12
#define CLIENT_VERSION_REVISION 3
#define CLIENT_VERSION_BUILD 0
#define CLIENT_VERSION_BUILD 7
//! Set to true for release, false for prerelease or test build
#define CLIENT_VERSION_IS_RELEASE true
......@@ -26,7 +26,7 @@
* Copyright year (2009-this)
* Todo: update this when changing our copyright comments in the source
*/
#define COPYRIGHT_YEAR 2017
#define COPYRIGHT_YEAR 2018
#endif //HAVE_CONFIG_H
......@@ -61,7 +61,7 @@ extern const std::string CLIENT_NAME;
extern const std::string CLIENT_BUILD;
extern const std::string CLIENT_DATE;
std::string FormatVersion(int nVersion);
std::string FormatFullVersion();
std::string FormatSubVersion(const std::string& name, int nClientVersion, const std::vector<std::string>& comments);
......
......@@ -62,7 +62,6 @@ bool AppInit(int argc, char* argv[])
boost::thread* detectShutdownThread = NULL;
bool fRet = false;
//
// Parameters
//
......@@ -186,6 +185,22 @@ bool AppInit(int argc, char* argv[])
delete detectShutdownThread;
detectShutdownThread = NULL;
}
if (RestartRequested())
{
// If restart requested cleanup resources and run application again.
// The old one will be exited below.
PrepareShutdown();
CExplicitNetCleanup::callCleanup();
if (argc > 0)
{
runCommand(std::string(argv[0]) + " &");
}
else
{
fprintf(stderr, "Error: Application name couldn't be detected.");
}
}
Shutdown();
return fRet;
......
......@@ -122,10 +122,18 @@ void StartShutdown()
{
fRequestShutdown = true;
}
void StartRestart()
{
fRestartRequested = true;
}
bool ShutdownRequested()
{
return fRequestShutdown || fRestartRequested;
}
bool RestartRequested()
{
return fRestartRequested;
}
class CCoinsViewErrorCatcher : public CCoinsViewBacked
{
......@@ -460,6 +468,9 @@ std::string HelpMessage(HelpMessageMode mode)
strUsage += " -rpcsslcertificatechainfile=<file.cert> " + strprintf(_("Server certificate file (default: %s)"), "server.cert") + "\n";
strUsage += " -rpcsslprivatekeyfile=<file.pem> " + strprintf(_("Server private key (default: %s)"), "server.pem") + "\n";
strUsage += " -rpcsslciphers=<ciphers> " + strprintf(_("Acceptable ciphers (default: %s)"), "TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH") + "\n";
strUsage += "\n" + _("Updater options:") + "\n";
strUsage += " -updateurl " + _("Url of json file which holds update information") + "\n";
strUsage += " -updateautocheck " + _("Check for updates automatically") + "\n";
return strUsage;
}
......@@ -1594,7 +1605,7 @@ bool AppInit2(boost::thread_group& threadGroup)
LOCK(pwalletMain->cs_wallet);
LogPrintf("Locking Masternodes:\n");
uint256 mnTxHash;
BOOST_FOREACH(CMasternodeConfig::CMasternodeEntry mne, masternodeConfig.getEntries()) {
BOOST_FOREACH(CNodeEntry mne, masternodeConfig.getEntries()) {
LogPrintf(" %s %s\n", mne.getTxHash(), mne.getOutputIndex());
mnTxHash.SetHex(mne.getTxHash());
COutPoint outpoint = COutPoint(mnTxHash, boost::lexical_cast<unsigned int>(mne.getOutputIndex()));
......@@ -1606,7 +1617,7 @@ bool AppInit2(boost::thread_group& threadGroup)
LOCK(pwalletMain->cs_wallet);
LogPrintf("Locking Systemnodes:\n");
uint256 mnTxHash;
BOOST_FOREACH(CSystemnodeConfig::CSystemnodeEntry sne, systemnodeConfig.getEntries()) {
BOOST_FOREACH(CNodeEntry sne, systemnodeConfig.getEntries()) {
LogPrintf(" %s %s\n", sne.getTxHash(), sne.getOutputIndex());
mnTxHash.SetHex(sne.getTxHash());
COutPoint outpoint = COutPoint(mnTxHash, boost::lexical_cast<unsigned int>(sne.getOutputIndex()));
......
......@@ -18,7 +18,9 @@ class thread_group;
extern CWallet* pwalletMain;
void StartShutdown();
void StartRestart();
bool ShutdownRequested();
bool RestartRequested();
void Shutdown();
void PrepareShutdown();
bool AppInit2(boost::thread_group& threadGroup);
......
......@@ -85,7 +85,7 @@ bool CLegacySigner::SignMessage(std::string strMessage, std::string& errorMessag
return true;
}
bool CLegacySigner::VerifyMessage(CPubKey pubkey, vector<unsigned char>& vchSig, std::string strMessage, std::string& errorMessage)
bool CLegacySigner::VerifyMessage(CPubKey pubkey, const vector<unsigned char>& vchSig, std::string strMessage, std::string& errorMessage)
{
CHashWriter ss(SER_GETHASH, 0);
ss << strMessageMagic;
......
......@@ -47,7 +47,7 @@ public:
/// Sign the message, returns true if successful
bool SignMessage(std::string strMessage, std::string& errorMessage, std::vector<unsigned char>& vchSig, CKey key);
/// Verify the message, returns true if succcessful
bool VerifyMessage(CPubKey pubkey, std::vector<unsigned char>& vchSig, std::string strMessage, std::string& errorMessage);
bool VerifyMessage(CPubKey pubkey, const std::vector<unsigned char>& vchSig, std::string strMessage, std::string& errorMessage);
// where collateral should be made out to
CScript collateralPubKey;
CMasternode* pSubmittedToMasternode;
......
......@@ -13,7 +13,7 @@
#include <leveldb/filter_policy.h>
#include <memenv.h>
void HandleError(const leveldb::Status& status) throw(leveldb_error)
void HandleError(const leveldb::Status& status) // throw(leveldb_error)
{
if (status.ok())
return;
......@@ -81,7 +81,7 @@ CLevelDBWrapper::~CLevelDBWrapper()
options.env = NULL;
}
bool CLevelDBWrapper::WriteBatch(CLevelDBBatch& batch, bool fSync) throw(leveldb_error)
bool CLevelDBWrapper::WriteBatch(CLevelDBBatch& batch, bool fSync) // throw(leveldb_error)
{
leveldb::Status status = pdb->Write(fSync ? syncoptions : writeoptions, &batch.batch);
HandleError(status);
......
......@@ -22,7 +22,7 @@ public:
leveldb_error(const std::string& msg) : std::runtime_error(msg) {}
};
void HandleError(const leveldb::Status& status) throw(leveldb_error);
void HandleError(const leveldb::Status& status); // throw(leveldb_error)
/** Batch of changes queued to be written to a CLevelDBWrapper */
class CLevelDBBatch
......@@ -90,7 +90,7 @@ public:
~CLevelDBWrapper();
template <typename K, typename V>
bool Read(const K& key, V& value) const throw(leveldb_error)
bool Read(const K& key, V& value) const // throw(leveldb_error)
{
CDataStream ssKey(SER_DISK, CLIENT_VERSION);
ssKey.reserve(ssKey.GetSerializeSize(key));
......@@ -115,7 +115,7 @@ public:
}
template <typename K, typename V>
bool Write(const K& key, const V& value, bool fSync = false) throw(leveldb_error)
bool Write(const K& key, const V& value, bool fSync = false) // throw(leveldb_error)
{
CLevelDBBatch batch;
batch.Write(key, value);
......@@ -123,7 +123,7 @@ public:
}
template <typename K>
bool Exists(const K& key) const throw(leveldb_error)
bool Exists(const K& key) const // throw(leveldb_error)
{
CDataStream ssKey(SER_DISK, CLIENT_VERSION);
ssKey.reserve(ssKey.GetSerializeSize(key));
......@@ -142,14 +142,14 @@ public:
}
template <typename K>
bool Erase(const K& key, bool fSync = false) throw(leveldb_error)
bool Erase(const K& key, bool fSync = false) // throw(leveldb_error)
{
CLevelDBBatch batch;
batch.Erase(key);
return WriteBatch(batch, fSync);
}
bool WriteBatch(CLevelDBBatch& batch, bool fSync = false) throw(leveldb_error);
bool WriteBatch(CLevelDBBatch& batch, bool fSync = false); // throw(leveldb_error)
// not available for LevelDB; provide for compatibility with BDB
bool Flush()
......@@ -157,7 +157,7 @@ public:
return true;
}
bool Sync() throw(leveldb_error)
bool Sync() // throw(leveldb_error)
{
CLevelDBBatch batch;
return WriteBatch(batch, true);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment