From 8b7d8191679ec7b79a9df939d49e9e9ae8150222 Mon Sep 17 00:00:00 2001 From: ca333 Date: Mon, 2 Jul 2018 23:44:59 +0200 Subject: [PATCH 001/119] add travis CI --- .travis.yml | 82 ----------------------------------------------------- 1 file changed, 82 deletions(-) diff --git a/.travis.yml b/.travis.yml index ac331dcf9..250756396 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,3 @@ -<<<<<<< HEAD language: cpp compiler: @@ -22,84 +21,3 @@ notifications: - "Alt Message : %{repository_slug} - (%{commit} - %{author}): %{message}, Build Time: %{duration}" - "Change view : %{compare_url}" - "Build details : %{build_url}" -======= -# errata: -# - A travis bug causes caches to trample eachother when using the same -# compiler key (which we don't use anyway). This is worked around for now by -# replacing the "compilers" with a build name prefixed by the no-op ":" -# command. See: https://github.com/travis-ci/travis-ci/issues/4393 -# - sudo/dist/group are set so as to get Blue Box VMs, necessary for [loopback] -# IPv6 support - -sudo: required -dist: precise -group: legacy - -os: linux -language: cpp -compiler: gcc -env: - global: - - MAKEJOBS=-j3 - - RUN_TESTS=false - - BOOST_TEST_RANDOM=1$TRAVIS_BUILD_ID - - CCACHE_SIZE=100M - - CCACHE_TEMPDIR=/tmp/.ccache-temp - - CCACHE_COMPRESS=1 - - BASE_OUTDIR=$TRAVIS_BUILD_DIR/out - - SDK_URL=https://bitcoincore.org/depends-sources/sdks - - PYTHON_DEBUG=1 - - WINEDEBUG=fixme-all -cache: - apt: true - directories: - - depends/built - - depends/sdk-sources - - $HOME/.ccache -matrix: - fast_finish: true - include: - - compiler: ": ARM" - env: HOST=arm-linux-gnueabihf PACKAGES="g++-arm-linux-gnueabihf" DEP_OPTS="" GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat --enable-reduce-exports" - - compiler: ": Win32" - env: HOST=i686-w64-mingw32 PACKAGES="nsis gcc-mingw-w64-i686 g++-mingw-w64-i686 binutils-mingw-w64-i686 mingw-w64-dev wine bc" RUN_TESTS=true GOAL="deploy" BITCOIN_CONFIG="--enable-reduce-exports" MAKEJOBS="-j2" - - compiler: ": 32-bit + dash" - env: HOST=i686-pc-linux-gnu PACKAGES="g++-multilib bc python-zmq" PPA="ppa:chris-lea/zeromq" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-zmq --enable-glibc-back-compat --enable-reduce-exports LDFLAGS=-static-libstdc++" USE_SHELL="/bin/dash" - - compiler: ": Win64" - env: HOST=x86_64-w64-mingw32 PACKAGES="nsis gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 binutils-mingw-w64-x86-64 mingw-w64-dev wine bc" RUN_TESTS=true GOAL="deploy" BITCOIN_CONFIG="--enable-reduce-exports" MAKEJOBS="-j2" - - compiler: ": bitcoind" - env: HOST=x86_64-unknown-linux-gnu PACKAGES="bc python-zmq" PPA="ppa:chris-lea/zeromq" DEP_OPTS="DEBUG=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-zmq --enable-glibc-back-compat --enable-reduce-exports CPPFLAGS=-DDEBUG_LOCKORDER" - - compiler: ": No wallet" - env: HOST=x86_64-unknown-linux-gnu DEP_OPTS="NO_WALLET=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat --enable-reduce-exports" - - compiler: ": Cross-Mac" - env: HOST=x86_64-apple-darwin11 PACKAGES="cmake libcap-dev libz-dev libbz2-dev" BITCOIN_CONFIG="--enable-reduce-exports" OSX_SDK=10.9 GOAL="deploy" - exclude: - - compiler: gcc -install: - - if [ -n "$PACKAGES" ]; then sudo rm -f /etc/apt/sources.list.d/travis_ci_zeromq3-source.list; fi - - if [ -n "$PACKAGES" ]; then travis_retry sudo apt-get update; fi - - if [ -n "$PACKAGES" ]; then travis_retry sudo apt-get install --no-install-recommends --no-upgrade -qq $PACKAGES; fi -before_script: - - unset CC; unset CXX - - mkdir -p depends/SDKs depends/sdk-sources - - 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: - - if [ -n "$USE_SHELL" ]; then export CONFIG_SHELL="$USE_SHELL"; fi - - OUTDIR=$BASE_OUTDIR/$TRAVIS_PULL_REQUEST/$TRAVIS_JOB_NUMBER-$HOST - - BITCOIN_CONFIG_ALL="--disable-dependency-tracking --prefix=$TRAVIS_BUILD_DIR/depends/$HOST --bindir=$OUTDIR/bin --libdir=$OUTDIR/lib" - - depends/$HOST/native/bin/ccache --max-size=$CCACHE_SIZE - - if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then export CCACHE_READONLY=1; fi - - test -n "$USE_SHELL" && eval '"$USE_SHELL" -c "./autogen.sh"' || ./autogen.sh - - ./configure --cache-file=config.cache $BITCOIN_CONFIG_ALL $BITCOIN_CONFIG || ( cat config.log && false) - - make distdir PACKAGE=bitcoin VERSION=$HOST - - cd bitcoin-$HOST - - ./configure --cache-file=../config.cache $BITCOIN_CONFIG_ALL $BITCOIN_CONFIG || ( cat config.log && false) - - make $MAKEJOBS $GOAL || ( echo "Build failure. Verbose build follows." && make $GOAL V=1 ; false ) - - export LD_LIBRARY_PATH=$TRAVIS_BUILD_DIR/depends/$HOST/lib - - if [ "$RUN_TESTS" = "true" ]; then make check; fi - - if [ "$RUN_TESTS" = "true" ]; then qa/pull-tester/rpc-tests.sh; fi -after_script: - - if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then (echo "Upload goes here. Something like: scp -r $BASE_OUTDIR server" || echo "upload failed"); fi ->>>>>>> zcash/master From 1c95172918220a3f713c095a984225bbd9c8d2e4 Mon Sep 17 00:00:00 2001 From: ca333 Date: Tue, 3 Jul 2018 14:43:11 +0200 Subject: [PATCH 002/119] test --- .travis.yml | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/.travis.yml b/.travis.yml index 250756396..547c74092 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,23 +1,28 @@ language: cpp - compiler: - - gcc - +- gcc before_install: - - sudo add-apt-repository --yes ppa:ubuntu-sdk-team/ppa - - sudo apt-get update -qq - - sudo apt-get install build-essential pkg-config libcurl3-gnutls-dev libc6-dev libevent-dev m4 g++-multilib autoconf libtool ncurses-dev unzip git python zlib1g-dev wget bsdmainutils automake libssl-dev libprotobuf-dev protobuf-compiler libdb++-dev ntp ntpdate -#install: - -script: - - ./zcutil/build.sh -j 5 - +- sudo add-apt-repository --yes ppa:ubuntu-sdk-team/ppa +- sudo apt-get update -qq +- sudo apt-get install build-essential pkg-config libcurl3-gnutls-dev libc6-dev libevent-dev + m4 g++-multilib autoconf libtool ncurses-dev unzip git python zlib1g-dev wget bsdmainutils + automake libssl-dev libprotobuf-dev protobuf-compiler libdb++-dev ntp ntpdate +script: +- "./zcutil/build.sh -j 5" notifications: irc: channels: - - "chat.freenode.net#komodoplatform" + - chat.freenode.net#komodoplatform template: - - "%{repository}/%{branch} (%{commit} - %{author}): %{message}" - - "Alt Message : %{repository_slug} - (%{commit} - %{author}): %{message}, Build Time: %{duration}" - - "Change view : %{compare_url}" - - "Build details : %{build_url}" + - "%{repository}/%{branch} (%{commit} - %{author}): %{message}" + - 'Alt Message : %{repository_slug} - (%{commit} - %{author}): %{message}, Build + Time: %{duration}' + - 'Change view : %{compare_url}' + - 'Build details : %{build_url}' +deploy: + provider: releases + api_key: + secure: oyMB9JDSoL/val/d80Em3sd3mSJY+PPkiclUb3ktizNz7DgYZbBiStUOZIJo95GUYADEvm9RVrP0JmBiDuqneEjfFRzME9/MnpY/LmRCiYGgprMDR80ZqbLgOzSKpE10RE2XM3vZkZeXT/JcGGayUm0faElep2qx62S4ozsAxSvFJ5l/PG+wEltrlnp1z8uYdXV3PBChbjzXJ0BdMVxMrrU39kwzqwu2Ge9PnNjVv0AVxn/oZpf+bzYa7vkSuGTRe2Jcs8U9AABYnZ22wu+tdlD76pdOJzGEwR70e8CjUJmdSn+M+wwAPPHStPW/JHFwSaWsKZtUyB5EWQW2kqq6P+M1Fe7yo6srznsaAcZRWeCrbUO/k44bEfnj7HMGmxfjDJOwbxVEoHg7im+l3HLUiG8rcw5dM/TAnrmgjH/OEj/EM1lbwV2C+PdDGOjdguljEhjBABGRbRABMZjwW8w+uBFVlKlcn7y+zJbMB3mGd+FNGo/OgAcsFzRcpaN8SrC/kzUF2SeEwJjTKvAqRgA66yl7CzDPBtUv2NtoPUz/8YO9rsdGElcWfmDIVacuIEjo1CizlbDzeS7zPiFPW5MRCGryLFLt0WjA/s8lkLO+DbGYXPa4rG6+7ZNUDLfziM+lFqZH8b382/bhv+a6ctpWjaazjiW6yWemsuN8QhByuGw= + file: src/komodod + on: + repo: KomodoPlatform/komodo From 1297265374f8a2fb2b1546f878dde92a1d6d494e Mon Sep 17 00:00:00 2001 From: ca333 Date: Tue, 3 Jul 2018 14:45:35 +0200 Subject: [PATCH 003/119] change travis CI distro --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 547c74092..305e42294 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,11 @@ +dist: xenial language: cpp compiler: - gcc before_install: - sudo add-apt-repository --yes ppa:ubuntu-sdk-team/ppa - sudo apt-get update -qq +- sudo apt-get install libgnutls28-dev - sudo apt-get install build-essential pkg-config libcurl3-gnutls-dev libc6-dev libevent-dev m4 g++-multilib autoconf libtool ncurses-dev unzip git python zlib1g-dev wget bsdmainutils automake libssl-dev libprotobuf-dev protobuf-compiler libdb++-dev ntp ntpdate From 2ab1a322f3f4a7c33aea20c6716d7077a936c71d Mon Sep 17 00:00:00 2001 From: ca333 Date: Tue, 3 Jul 2018 20:21:22 +0200 Subject: [PATCH 004/119] test --- .travis.yml | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 305e42294..0b2ae6a4d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,16 +1,20 @@ +os: + - linux + - osx dist: xenial language: cpp compiler: - gcc before_install: -- sudo add-apt-repository --yes ppa:ubuntu-sdk-team/ppa -- sudo apt-get update -qq -- sudo apt-get install libgnutls28-dev -- sudo apt-get install build-essential pkg-config libcurl3-gnutls-dev libc6-dev libevent-dev - m4 g++-multilib autoconf libtool ncurses-dev unzip git python zlib1g-dev wget bsdmainutils - automake libssl-dev libprotobuf-dev protobuf-compiler libdb++-dev ntp ntpdate +- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo add-apt-repository --yes ppa:ubuntu-sdk-team/ppa; fi +- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get update -qq; fi +- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install libgnutls28-dev; fi +- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install build-essential pkg-config libcurl3-gnutls-dev libc6-dev libevent-dev m4 g++-multilib autoconf libtool ncurses-dev unzip git python zlib1g-dev wget bsdmainutils automake libssl-dev libprotobuf-dev protobuf-compiler libdb++-dev ntp ntpdate; fi +- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi +- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install gcc5; fi script: -- "./zcutil/build.sh -j 5" +- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./zcutil/build.sh -j 5; fi +- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ./zcutil/build-mac.sh -j 5; fi notifications: irc: channels: @@ -21,10 +25,16 @@ notifications: Time: %{duration}' - 'Change view : %{compare_url}' - 'Build details : %{build_url}' +before_deploy: + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then git tag "linux-$(date +'%Y%m%d%H%M%S')-$(git log --format=%h -1)"; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then git tag "osx-$(date +'%Y%m%d%H%M%S')-$(git log --format=%h -1)"; fi deploy: provider: releases api_key: secure: oyMB9JDSoL/val/d80Em3sd3mSJY+PPkiclUb3ktizNz7DgYZbBiStUOZIJo95GUYADEvm9RVrP0JmBiDuqneEjfFRzME9/MnpY/LmRCiYGgprMDR80ZqbLgOzSKpE10RE2XM3vZkZeXT/JcGGayUm0faElep2qx62S4ozsAxSvFJ5l/PG+wEltrlnp1z8uYdXV3PBChbjzXJ0BdMVxMrrU39kwzqwu2Ge9PnNjVv0AVxn/oZpf+bzYa7vkSuGTRe2Jcs8U9AABYnZ22wu+tdlD76pdOJzGEwR70e8CjUJmdSn+M+wwAPPHStPW/JHFwSaWsKZtUyB5EWQW2kqq6P+M1Fe7yo6srznsaAcZRWeCrbUO/k44bEfnj7HMGmxfjDJOwbxVEoHg7im+l3HLUiG8rcw5dM/TAnrmgjH/OEj/EM1lbwV2C+PdDGOjdguljEhjBABGRbRABMZjwW8w+uBFVlKlcn7y+zJbMB3mGd+FNGo/OgAcsFzRcpaN8SrC/kzUF2SeEwJjTKvAqRgA66yl7CzDPBtUv2NtoPUz/8YO9rsdGElcWfmDIVacuIEjo1CizlbDzeS7zPiFPW5MRCGryLFLt0WjA/s8lkLO+DbGYXPa4rG6+7ZNUDLfziM+lFqZH8b382/bhv+a6ctpWjaazjiW6yWemsuN8QhByuGw= - file: src/komodod + file: + - src/komodod + - src/komodo-cli + skip_cleanup: true on: repo: KomodoPlatform/komodo From 9a66a8bf5da6d2c86b2e219cd2695337df56b65c Mon Sep 17 00:00:00 2001 From: ca333 Date: Tue, 3 Jul 2018 20:54:08 +0200 Subject: [PATCH 005/119] test --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 0b2ae6a4d..4770f7016 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,6 +12,7 @@ before_install: - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install build-essential pkg-config libcurl3-gnutls-dev libc6-dev libevent-dev m4 g++-multilib autoconf libtool ncurses-dev unzip git python zlib1g-dev wget bsdmainutils automake libssl-dev libprotobuf-dev protobuf-compiler libdb++-dev ntp ntpdate; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install gcc5; fi +- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew link --overwrite gcc@5; fi script: - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./zcutil/build.sh -j 5; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ./zcutil/build-mac.sh -j 5; fi From a6a437652ef5f55047d0f21596abde93fc0aefaa Mon Sep 17 00:00:00 2001 From: ca333 Date: Sat, 4 Aug 2018 20:22:57 +0200 Subject: [PATCH 006/119] update travis --- .travis.yml | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4770f7016..d9237a104 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,12 @@ -os: - - linux - - osx -dist: xenial language: cpp + +matrix: + include: + - os: linux + dist: xenial + sudo: required + - os: osx + osx_image: xcode8 compiler: - gcc before_install: @@ -10,9 +14,10 @@ before_install: - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get update -qq; fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install libgnutls28-dev; fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install build-essential pkg-config libcurl3-gnutls-dev libc6-dev libevent-dev m4 g++-multilib autoconf libtool ncurses-dev unzip git python zlib1g-dev wget bsdmainutils automake libssl-dev libprotobuf-dev protobuf-compiler libdb++-dev ntp ntpdate; fi -- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi -- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install gcc5; fi -- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew link --overwrite gcc@5; fi +- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then rm '/usr/local/include/c++'; fi +- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi +- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install gcc@6; fi +- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew link --overwrite gcc@6; fi script: - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./zcutil/build.sh -j 5; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ./zcutil/build-mac.sh -j 5; fi @@ -27,12 +32,12 @@ notifications: - 'Change view : %{compare_url}' - 'Build details : %{build_url}' before_deploy: - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then git tag "linux-$(date +'%Y%m%d%H%M%S')-$(git log --format=%h -1)"; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then git tag "osx-$(date +'%Y%m%d%H%M%S')-$(git log --format=%h -1)"; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then git tag "linux-$(date +'%Y%m%d%H%M')-$(git log --format=%h -1)"; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then git tag "osx-$(date +'%Y%m%d%H%M')-$(git log --format=%h -1)"; fi deploy: provider: releases api_key: - secure: oyMB9JDSoL/val/d80Em3sd3mSJY+PPkiclUb3ktizNz7DgYZbBiStUOZIJo95GUYADEvm9RVrP0JmBiDuqneEjfFRzME9/MnpY/LmRCiYGgprMDR80ZqbLgOzSKpE10RE2XM3vZkZeXT/JcGGayUm0faElep2qx62S4ozsAxSvFJ5l/PG+wEltrlnp1z8uYdXV3PBChbjzXJ0BdMVxMrrU39kwzqwu2Ge9PnNjVv0AVxn/oZpf+bzYa7vkSuGTRe2Jcs8U9AABYnZ22wu+tdlD76pdOJzGEwR70e8CjUJmdSn+M+wwAPPHStPW/JHFwSaWsKZtUyB5EWQW2kqq6P+M1Fe7yo6srznsaAcZRWeCrbUO/k44bEfnj7HMGmxfjDJOwbxVEoHg7im+l3HLUiG8rcw5dM/TAnrmgjH/OEj/EM1lbwV2C+PdDGOjdguljEhjBABGRbRABMZjwW8w+uBFVlKlcn7y+zJbMB3mGd+FNGo/OgAcsFzRcpaN8SrC/kzUF2SeEwJjTKvAqRgA66yl7CzDPBtUv2NtoPUz/8YO9rsdGElcWfmDIVacuIEjo1CizlbDzeS7zPiFPW5MRCGryLFLt0WjA/s8lkLO+DbGYXPa4rG6+7ZNUDLfziM+lFqZH8b382/bhv+a6ctpWjaazjiW6yWemsuN8QhByuGw= + secure: Jms7dz5GMZmuXUCHl5u6iZUtAybv86oW3x36DCJfdzbDiO4B9EWB04z7zA0qvoomefyujHTmQUHxyOKfd4h9/rVMFFv9hgmUxWkrcg7KyLNisOQRaovVOuNtu2lRNXTOSF16Cy+xFGkVh1ObBRhAoMsVKPhMl6PCDiKhNWIekRR9pBtjafKsClQ2ieknUYfqhuvgj7zmqCedeyVaVQyt2W/J65leD0BkfCUESTpANSprHs4bQB65VuQIKKMi+URKx2VgpDdUcWJySt9jAHVPIbI5cT5maAT6RUMnE4oha7Ca1Ox8StBqjQ/hkkMyDbN0keIlN7RjZlwdZQf/qUnT/dPQhsyUCdPXOxmEJ2jekezEK/LGr4Fb+v+vjd9dhLNkD5nVn9zp36biGSCjiMpffQ3fjMeM0YGmVEVRP9kZXLWVRYQoVKrzjyzg5dY8iChbiQEfYpTeBuU+e2rqj4mns+Jvy0zjUbMy6Tyva+iqdZ/PdsBDbiB7c+FIgB1IUTVOD+GgKx6dhCtBZEccn5EyWFwZF9IdQJHZCYV4PA7nuzfm1Ol9SDdZkGHd2OgRCqK/sTwyfTHv8exNqZ1k+epGJp2a0q4IOEknc9aPCAF+m9pHahk7s7VO5gmhO6pvbvuKoeEtEXRZHRzCkGkXfzJlBk+23X5gBexKb6inRdBlj6M= file: - src/komodod - src/komodo-cli From f97c46158fed7d2488f1fa6cafe4c02d46052908 Mon Sep 17 00:00:00 2001 From: ca333 Date: Sat, 4 Aug 2018 21:01:13 +0200 Subject: [PATCH 007/119] update builder darwin specific --- depends/builders/darwin.mk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/depends/builders/darwin.mk b/depends/builders/darwin.mk index 0028d3f6f..f9b066fcf 100644 --- a/depends/builders/darwin.mk +++ b/depends/builders/darwin.mk @@ -1,5 +1,5 @@ -build_darwin_CC = gcc-5 -build_darwin_CXX = g++-5 +build_darwin_CC = gcc-6 +build_darwin_CXX = g++-6 build_darwin_AR: = $(shell xcrun -f ar) build_darwin_RANLIB: = $(shell xcrun -f ranlib) build_darwin_STRIP: = $(shell xcrun -f strip) @@ -10,8 +10,8 @@ build_darwin_SHA256SUM = shasum -a 256 build_darwin_DOWNLOAD = curl --connect-timeout $(DOWNLOAD_CONNECT_TIMEOUT) --retry $(DOWNLOAD_RETRIES) -L -f -o #darwin host on darwin builder. overrides darwin host preferences. -darwin_CC= gcc-5 -darwin_CXX= g++-5 +darwin_CC= gcc-6 +darwin_CXX= g++-6 darwin_AR:=$(shell xcrun -f ar) darwin_RANLIB:=$(shell xcrun -f ranlib) darwin_STRIP:=$(shell xcrun -f strip) From fd928880a60601a5d2b48c448af2919ccf1639fb Mon Sep 17 00:00:00 2001 From: ca333 Date: Sat, 4 Aug 2018 21:01:48 +0200 Subject: [PATCH 008/119] update host config use gcc/g++ v6 --- depends/hosts/darwin.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/depends/hosts/darwin.mk b/depends/hosts/darwin.mk index 70211078b..bb04d62ec 100644 --- a/depends/hosts/darwin.mk +++ b/depends/hosts/darwin.mk @@ -1,9 +1,9 @@ -OSX_MIN_VERSION=10.8 +OSX_MIN_VERSION=10.11 OSX_SDK_VERSION=10.11 OSX_SDK=$(SDK_PATH)/MacOSX$(OSX_SDK_VERSION).sdk LD64_VERSION=253.9 -darwin_CC=gcc-5 -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION) -darwin_CXX=g++-5 -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION) +darwin_CC=gcc-6 -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION) +darwin_CXX=g++-6 -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION) darwin_CFLAGS=-pipe darwin_CXXFLAGS=$(darwin_CFLAGS) From 10f0bdc03a56fc85e8d69a5c224c86c668c42e11 Mon Sep 17 00:00:00 2001 From: ca333 Date: Sat, 4 Aug 2018 21:03:57 +0200 Subject: [PATCH 009/119] update darwin makefile use gcc/g++ v6 include correct gcc libs v6.4.0 --- zcutil/build-mac.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zcutil/build-mac.sh b/zcutil/build-mac.sh index cf2af5a2a..138508cb5 100755 --- a/zcutil/build-mac.sh +++ b/zcutil/build-mac.sh @@ -1,6 +1,6 @@ #!/bin/bash -export CC=gcc-5 -export CXX=g++-5 +export CC=gcc-6 +export CXX=g++-6 export LIBTOOL=libtool export AR=ar export RANLIB=ranlib @@ -44,7 +44,7 @@ make "$@" -C ./depends/ V=1 NO_QT=1 NO_PROTON=1 ./autogen.sh CPPFLAGS="-I$PREFIX/include -arch x86_64" LDFLAGS="-L$PREFIX/lib -arch x86_64 -Wl,-no_pie" \ -CXXFLAGS='-arch x86_64 -I/usr/local/Cellar/gcc5/5.4.0/include/c++/5.4.0 -I$PREFIX/include -fwrapv -fno-strict-aliasing -Werror -g -Wl,-undefined -Wl,dynamic_lookup' \ +CXXFLAGS='-arch x86_64 -I/usr/local/Cellar/gcc\@6/6.4.0_2/include/c++/6.4.0/ -I$PREFIX/include -fwrapv -fno-strict-aliasing -Werror -g -Wl,-undefined -Wl,dynamic_lookup' \ ./configure --prefix="${PREFIX}" --with-gui=no "$HARDENING_ARG" "$LCOV_ARG" make "$@" V=1 NO_GTEST=1 STATIC=1 From afd50b9e11c33e6b67a417359ddf975d201f4a16 Mon Sep 17 00:00:00 2001 From: ca333 Date: Sat, 4 Aug 2018 23:03:34 +0200 Subject: [PATCH 010/119] update apikey travisCI --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d9237a104..3e6d9a0f6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,7 +37,7 @@ before_deploy: deploy: provider: releases api_key: - secure: Jms7dz5GMZmuXUCHl5u6iZUtAybv86oW3x36DCJfdzbDiO4B9EWB04z7zA0qvoomefyujHTmQUHxyOKfd4h9/rVMFFv9hgmUxWkrcg7KyLNisOQRaovVOuNtu2lRNXTOSF16Cy+xFGkVh1ObBRhAoMsVKPhMl6PCDiKhNWIekRR9pBtjafKsClQ2ieknUYfqhuvgj7zmqCedeyVaVQyt2W/J65leD0BkfCUESTpANSprHs4bQB65VuQIKKMi+URKx2VgpDdUcWJySt9jAHVPIbI5cT5maAT6RUMnE4oha7Ca1Ox8StBqjQ/hkkMyDbN0keIlN7RjZlwdZQf/qUnT/dPQhsyUCdPXOxmEJ2jekezEK/LGr4Fb+v+vjd9dhLNkD5nVn9zp36biGSCjiMpffQ3fjMeM0YGmVEVRP9kZXLWVRYQoVKrzjyzg5dY8iChbiQEfYpTeBuU+e2rqj4mns+Jvy0zjUbMy6Tyva+iqdZ/PdsBDbiB7c+FIgB1IUTVOD+GgKx6dhCtBZEccn5EyWFwZF9IdQJHZCYV4PA7nuzfm1Ol9SDdZkGHd2OgRCqK/sTwyfTHv8exNqZ1k+epGJp2a0q4IOEknc9aPCAF+m9pHahk7s7VO5gmhO6pvbvuKoeEtEXRZHRzCkGkXfzJlBk+23X5gBexKb6inRdBlj6M= + secure: Ko7UZqZMQMyVhoyovtAlhxY8wSWdeaLoMn9g7LDD+HwMfMhyMb5zJnsMjUalS/T+8a7Oymphj0mpbC1Q9w8hcOCwW4J8QYzlTJ7fKtIFeuJUSHhG0LTUu/oM/eR3Kw4E2INiemEemUc9RPBeyFFW55FmPyLZsRcAyQuTOTR0cmvAFpLARm7cRD2P0oZEIMM+HJOcfZIY7ly8S1CluZ88Zb0h92eHEE3oVf8qBYUS8Wstn8M4GjnGNrCb4RHKr528BemWMmLT5FD8kpvmp3dluyYK66rLT3nva3LyC63LhXbivQaJILWphVh1J0Hq0TfC8zN8tqh+A8mcqtcVXSps9wfSXVRxx+A5/ZRcuy3QXuqOq2xTdk5DJPVUZYwd75nX9GAPV6H5fYviiAe3KZVZdExpF/Tfsj+Y5L/YpwRYnq/c/eGG37YqXC2dj4FsL3ZR627JB6olFHvHXG5nEwMperSKT/aiWB73Du7hs5ICO6UPzY+3UQvPmSX6ISIWHRgrqOVvf2aw06YZFbhu3GFLbI6+y1pF2DeabfCuqKKI4w/Iqnp7yd1L9CK+S4YGVwJ5iIvE/Ou8tqeUqW5pImyEvkd/kMtlo+G4maz42m2Jaea5uIIxPVutTzten1KSInblHhF34z8hurVFjm8n6sEO4UOJNp+mMm8gPxlgIC45fcg= file: - src/komodod - src/komodo-cli From 06955861024f548bb38452ad049a5c5a790a9d6f Mon Sep 17 00:00:00 2001 From: ca333 Date: Sat, 4 Aug 2018 23:10:37 +0200 Subject: [PATCH 011/119] test travisCI build thread incr --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3e6d9a0f6..c238da584 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,8 +19,8 @@ before_install: - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install gcc@6; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew link --overwrite gcc@6; fi script: -- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./zcutil/build.sh -j 5; fi -- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ./zcutil/build-mac.sh -j 5; fi +- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./zcutil/build.sh -j5; fi +- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ./zcutil/build-mac.sh -j6; fi notifications: irc: channels: From 4e7f0c5e5a192e97ddbf97373d61792f25414b60 Mon Sep 17 00:00:00 2001 From: ca333 Date: Sun, 5 Aug 2018 11:09:06 +0200 Subject: [PATCH 012/119] test --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c238da584..0ffda964f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ matrix: dist: xenial sudo: required - os: osx - osx_image: xcode8 + osx_image: xcode8.3 compiler: - gcc before_install: From cb9bbcdd70636d0b1d54820df936b7cbdc57d958 Mon Sep 17 00:00:00 2001 From: ca333 Date: Wed, 8 Aug 2018 15:42:03 +0200 Subject: [PATCH 013/119] test --- .travis.yml | 65 ++++++++++++++++++++++++++++++++++------------------- 1 file changed, 42 insertions(+), 23 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0ffda964f..994476d0c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,4 @@ + language: cpp matrix: @@ -6,21 +7,24 @@ matrix: dist: xenial sudo: required - os: osx - osx_image: xcode8.3 + osx_image: xcode8 compiler: -- gcc + - gcc before_install: -- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo add-apt-repository --yes ppa:ubuntu-sdk-team/ppa; fi -- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get update -qq; fi -- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install libgnutls28-dev; fi -- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install build-essential pkg-config libcurl3-gnutls-dev libc6-dev libevent-dev m4 g++-multilib autoconf libtool ncurses-dev unzip git python zlib1g-dev wget bsdmainutils automake libssl-dev libprotobuf-dev protobuf-compiler libdb++-dev ntp ntpdate; fi -- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then rm '/usr/local/include/c++'; fi -- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi -- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install gcc@6; fi -- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew link --overwrite gcc@6; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo add-apt-repository --yes ppa:ubuntu-sdk-team/ppa; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get update -qq; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install libgnutls28-dev; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install build-essential pkg-config libcurl3-gnutls-dev libc6-dev libevent-dev m4 g++-multilib autoconf libtool ncurses-dev unzip git python zlib1g-dev wget bsdmainutils automake libssl-dev libprotobuf-dev protobuf-compiler libdb++-dev ntp ntpdate; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then rm '/usr/local/include/c++'; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install gcc@6; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew link --overwrite gcc@6; fi script: -- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./zcutil/build.sh -j5; fi -- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ./zcutil/build-mac.sh -j6; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./zcutil/build.sh -j 5; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then tar cvfz komodo_linux.tar.gz src/komodod src/komodo-cli; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ./zcutil/build-mac.sh -j 5; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ./makeRelease.sh; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then tar cvfz komodo_osx.tar.gz src/komodod src/komodo-cli src/libgcc_s.1.dylib src/libgomp.1.dylib src/libstdc++.6.dylib; fi notifications: irc: channels: @@ -32,15 +36,30 @@ notifications: - 'Change view : %{compare_url}' - 'Build details : %{build_url}' before_deploy: - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then git tag "linux-$(date +'%Y%m%d%H%M')-$(git log --format=%h -1)"; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then git tag "osx-$(date +'%Y%m%d%H%M')-$(git log --format=%h -1)"; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then git tag "linux-$(date +'%Y%m%d%H%M')-$(git log --format=%h -1)"; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then git tag "osx-$(date +'%Y%m%d%H%M')-$(git log --format=%h -1)"; fi deploy: - provider: releases - api_key: - secure: Ko7UZqZMQMyVhoyovtAlhxY8wSWdeaLoMn9g7LDD+HwMfMhyMb5zJnsMjUalS/T+8a7Oymphj0mpbC1Q9w8hcOCwW4J8QYzlTJ7fKtIFeuJUSHhG0LTUu/oM/eR3Kw4E2INiemEemUc9RPBeyFFW55FmPyLZsRcAyQuTOTR0cmvAFpLARm7cRD2P0oZEIMM+HJOcfZIY7ly8S1CluZ88Zb0h92eHEE3oVf8qBYUS8Wstn8M4GjnGNrCb4RHKr528BemWMmLT5FD8kpvmp3dluyYK66rLT3nva3LyC63LhXbivQaJILWphVh1J0Hq0TfC8zN8tqh+A8mcqtcVXSps9wfSXVRxx+A5/ZRcuy3QXuqOq2xTdk5DJPVUZYwd75nX9GAPV6H5fYviiAe3KZVZdExpF/Tfsj+Y5L/YpwRYnq/c/eGG37YqXC2dj4FsL3ZR627JB6olFHvHXG5nEwMperSKT/aiWB73Du7hs5ICO6UPzY+3UQvPmSX6ISIWHRgrqOVvf2aw06YZFbhu3GFLbI6+y1pF2DeabfCuqKKI4w/Iqnp7yd1L9CK+S4YGVwJ5iIvE/Ou8tqeUqW5pImyEvkd/kMtlo+G4maz42m2Jaea5uIIxPVutTzten1KSInblHhF34z8hurVFjm8n6sEO4UOJNp+mMm8gPxlgIC45fcg= - file: - - src/komodod - - src/komodo-cli - skip_cleanup: true - on: - repo: KomodoPlatform/komodo + - provider: releases + api_key: + secure: Ko7UZqZMQMyVhoyovtAlhxY8wSWdeaLoMn9g7LDD+HwMfMhyMb5zJnsMjUalS/T+8a7Oymphj0mpbC1Q9w8hcOCwW4J8QYzlTJ7fKtIFeuJUSHhG0LTUu/oM/eR3Kw4E2INiemEemUc9RPBeyFFW55FmPyLZsRcAyQuTOTR0cmvAFpLARm7cRD2P0oZEIMM+HJOcfZIY7ly8S1CluZ88Zb0h92eHEE3oVf8qBYUS8Wstn8M4GjnGNrCb4RHKr528BemWMmLT5FD8kpvmp3dluyYK66rLT3nva3LyC63LhXbivQaJILWphVh1J0Hq0TfC8zN8tqh+A8mcqtcVXSps9wfSXVRxx+A5/ZRcuy3QXuqOq2xTdk5DJPVUZYwd75nX9GAPV6H5fYviiAe3KZVZdExpF/Tfsj+Y5L/YpwRYnq/c/eGG37YqXC2dj4FsL3ZR627JB6olFHvHXG5nEwMperSKT/aiWB73Du7hs5ICO6UPzY+3UQvPmSX6ISIWHRgrqOVvf2aw06YZFbhu3GFLbI6+y1pF2DeabfCuqKKI4w/Iqnp7yd1L9CK+S4YGVwJ5iIvE/Ou8tqeUqW5pImyEvkd/kMtlo+G4maz42m2Jaea5uIIxPVutTzten1KSInblHhF34z8hurVFjm8n6sEO4UOJNp+mMm8gPxlgIC45fcg= + name: komodo_linux + prerelease: true + file: + - komodo_linux.tar.gz + skip_cleanup: true + on: + repo: ca333/dsec + branch: master + condition: "$TRAVIS_OS_NAME = linux" + - provider: releases + api_key: + secure: Ko7UZqZMQMyVhoyovtAlhxY8wSWdeaLoMn9g7LDD+HwMfMhyMb5zJnsMjUalS/T+8a7Oymphj0mpbC1Q9w8hcOCwW4J8QYzlTJ7fKtIFeuJUSHhG0LTUu/oM/eR3Kw4E2INiemEemUc9RPBeyFFW55FmPyLZsRcAyQuTOTR0cmvAFpLARm7cRD2P0oZEIMM+HJOcfZIY7ly8S1CluZ88Zb0h92eHEE3oVf8qBYUS8Wstn8M4GjnGNrCb4RHKr528BemWMmLT5FD8kpvmp3dluyYK66rLT3nva3LyC63LhXbivQaJILWphVh1J0Hq0TfC8zN8tqh+A8mcqtcVXSps9wfSXVRxx+A5/ZRcuy3QXuqOq2xTdk5DJPVUZYwd75nX9GAPV6H5fYviiAe3KZVZdExpF/Tfsj+Y5L/YpwRYnq/c/eGG37YqXC2dj4FsL3ZR627JB6olFHvHXG5nEwMperSKT/aiWB73Du7hs5ICO6UPzY+3UQvPmSX6ISIWHRgrqOVvf2aw06YZFbhu3GFLbI6+y1pF2DeabfCuqKKI4w/Iqnp7yd1L9CK+S4YGVwJ5iIvE/Ou8tqeUqW5pImyEvkd/kMtlo+G4maz42m2Jaea5uIIxPVutTzten1KSInblHhF34z8hurVFjm8n6sEO4UOJNp+mMm8gPxlgIC45fcg= + name: komodo_osx + prerelease: true + file: + - komodo_osx.tar.gz + skip_cleanup: true + on: + repo: ca333/dsec + branch: master + condition: "$TRAVIS_OS_NAME = osx" From 6dd7c4ef34f7a2ff8dc22cfe2011815828372ef4 Mon Sep 17 00:00:00 2001 From: ca333 Date: Wed, 8 Aug 2018 16:06:35 +0200 Subject: [PATCH 014/119] test --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 994476d0c..6f613ad22 100644 --- a/.travis.yml +++ b/.travis.yml @@ -48,7 +48,7 @@ deploy: - komodo_linux.tar.gz skip_cleanup: true on: - repo: ca333/dsec + repo: KomodoPlatform/komodo branch: master condition: "$TRAVIS_OS_NAME = linux" - provider: releases @@ -60,6 +60,6 @@ deploy: - komodo_osx.tar.gz skip_cleanup: true on: - repo: ca333/dsec + repo: KomodoPlatform/komodo branch: master condition: "$TRAVIS_OS_NAME = osx" From cc0e1e13e4e3f688e534848236108062523fefb3 Mon Sep 17 00:00:00 2001 From: ca333 Date: Thu, 9 Aug 2018 23:13:14 +0200 Subject: [PATCH 015/119] update travis --- .travis.yml | 91 +++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 68 insertions(+), 23 deletions(-) diff --git a/.travis.yml b/.travis.yml index d9237a104..6792e41bb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,22 +5,32 @@ matrix: - os: linux dist: xenial sudo: required + env: LINUX_DEPLOY="true" OSX_DEPLOY="false" - os: osx - osx_image: xcode8 + osx_image: xcode8 + env: OSX_DEPLOY="true" LINUX_DEPLOY="false" +branches: + only: + - master + - dev + - cctests compiler: -- gcc + - gcc before_install: -- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo add-apt-repository --yes ppa:ubuntu-sdk-team/ppa; fi -- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get update -qq; fi -- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install libgnutls28-dev; fi -- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install build-essential pkg-config libcurl3-gnutls-dev libc6-dev libevent-dev m4 g++-multilib autoconf libtool ncurses-dev unzip git python zlib1g-dev wget bsdmainutils automake libssl-dev libprotobuf-dev protobuf-compiler libdb++-dev ntp ntpdate; fi -- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then rm '/usr/local/include/c++'; fi -- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi -- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install gcc@6; fi -- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew link --overwrite gcc@6; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo add-apt-repository --yes ppa:ubuntu-sdk-team/ppa; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get update -qq; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install libgnutls28-dev; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install build-essential pkg-config libcurl3-gnutls-dev libc6-dev libevent-dev m4 g++-multilib autoconf libtool ncurses-dev unzip git python zlib1g-dev wget bsdmainutils automake libssl-dev libprotobuf-dev protobuf-compiler libdb++-dev ntp ntpdate; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then rm '/usr/local/include/c++'; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install gcc@6; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew link --overwrite gcc@6; fi script: -- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./zcutil/build.sh -j 5; fi -- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ./zcutil/build-mac.sh -j 5; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./zcutil/build.sh -j 5; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then tar cvfz komodo_linux.tar.gz src/komodod src/komodo-cli; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ./zcutil/build-mac.sh -j 5; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ./makeRelease.sh; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then tar cvfz komodo_osx.tar.gz src/komodod src/komodo-cli src/libgcc_s.1.dylib src/libgomp.1.dylib src/libstdc++.6.dylib; fi notifications: irc: channels: @@ -32,15 +42,50 @@ notifications: - 'Change view : %{compare_url}' - 'Build details : %{build_url}' before_deploy: - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then git tag "linux-$(date +'%Y%m%d%H%M')-$(git log --format=%h -1)"; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then git tag "osx-$(date +'%Y%m%d%H%M')-$(git log --format=%h -1)"; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then git tag "$TRAVIS_BRANCH-linux-$(date +'%Y%m%d%H%M')-$(git log --format=%h -1)"; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then git tag "$TRAVIS_BRANCH-osx-$(date +'%Y%m%d%H%M')-$(git log --format=%h -1)"; fi deploy: - provider: releases - api_key: - secure: Jms7dz5GMZmuXUCHl5u6iZUtAybv86oW3x36DCJfdzbDiO4B9EWB04z7zA0qvoomefyujHTmQUHxyOKfd4h9/rVMFFv9hgmUxWkrcg7KyLNisOQRaovVOuNtu2lRNXTOSF16Cy+xFGkVh1ObBRhAoMsVKPhMl6PCDiKhNWIekRR9pBtjafKsClQ2ieknUYfqhuvgj7zmqCedeyVaVQyt2W/J65leD0BkfCUESTpANSprHs4bQB65VuQIKKMi+URKx2VgpDdUcWJySt9jAHVPIbI5cT5maAT6RUMnE4oha7Ca1Ox8StBqjQ/hkkMyDbN0keIlN7RjZlwdZQf/qUnT/dPQhsyUCdPXOxmEJ2jekezEK/LGr4Fb+v+vjd9dhLNkD5nVn9zp36biGSCjiMpffQ3fjMeM0YGmVEVRP9kZXLWVRYQoVKrzjyzg5dY8iChbiQEfYpTeBuU+e2rqj4mns+Jvy0zjUbMy6Tyva+iqdZ/PdsBDbiB7c+FIgB1IUTVOD+GgKx6dhCtBZEccn5EyWFwZF9IdQJHZCYV4PA7nuzfm1Ol9SDdZkGHd2OgRCqK/sTwyfTHv8exNqZ1k+epGJp2a0q4IOEknc9aPCAF+m9pHahk7s7VO5gmhO6pvbvuKoeEtEXRZHRzCkGkXfzJlBk+23X5gBexKb6inRdBlj6M= - file: - - src/komodod - - src/komodo-cli - skip_cleanup: true - on: - repo: KomodoPlatform/komodo + - provider: releases + api_key: + secure: Jms7dz5GMZmuXUCHl5u6iZUtAybv86oW3x36DCJfdzbDiO4B9EWB04z7zA0qvoomefyujHTmQUHxyOKfd4h9/rVMFFv9hgmUxWkrcg7KyLNisOQRaovVOuNtu2lRNXTOSF16Cy+xFGkVh1ObBRhAoMsVKPhMl6PCDiKhNWIekRR9pBtjafKsClQ2ieknUYfqhuvgj7zmqCedeyVaVQyt2W/J65leD0BkfCUESTpANSprHs4bQB65VuQIKKMi+URKx2VgpDdUcWJySt9jAHVPIbI5cT5maAT6RUMnE4oha7Ca1Ox8StBqjQ/hkkMyDbN0keIlN7RjZlwdZQf/qUnT/dPQhsyUCdPXOxmEJ2jekezEK/LGr4Fb+v+vjd9dhLNkD5nVn9zp36biGSCjiMpffQ3fjMeM0YGmVEVRP9kZXLWVRYQoVKrzjyzg5dY8iChbiQEfYpTeBuU+e2rqj4mns+Jvy0zjUbMy6Tyva+iqdZ/PdsBDbiB7c+FIgB1IUTVOD+GgKx6dhCtBZEccn5EyWFwZF9IdQJHZCYV4PA7nuzfm1Ol9SDdZkGHd2OgRCqK/sTwyfTHv8exNqZ1k+epGJp2a0q4IOEknc9aPCAF+m9pHahk7s7VO5gmhO6pvbvuKoeEtEXRZHRzCkGkXfzJlBk+23X5gBexKb6inRdBlj6M= + name: komodo_linux-$TRAVIS_BRANCH + prerelease: true + file: komodo_linux.tar.gz + skip_cleanup: true + on: + repo: KomodoPlatform/komodo + branch: master + condition: $LINUX_DEPLOY = "true" + - provider: releases + api_key: + secure: Jms7dz5GMZmuXUCHl5u6iZUtAybv86oW3x36DCJfdzbDiO4B9EWB04z7zA0qvoomefyujHTmQUHxyOKfd4h9/rVMFFv9hgmUxWkrcg7KyLNisOQRaovVOuNtu2lRNXTOSF16Cy+xFGkVh1ObBRhAoMsVKPhMl6PCDiKhNWIekRR9pBtjafKsClQ2ieknUYfqhuvgj7zmqCedeyVaVQyt2W/J65leD0BkfCUESTpANSprHs4bQB65VuQIKKMi+URKx2VgpDdUcWJySt9jAHVPIbI5cT5maAT6RUMnE4oha7Ca1Ox8StBqjQ/hkkMyDbN0keIlN7RjZlwdZQf/qUnT/dPQhsyUCdPXOxmEJ2jekezEK/LGr4Fb+v+vjd9dhLNkD5nVn9zp36biGSCjiMpffQ3fjMeM0YGmVEVRP9kZXLWVRYQoVKrzjyzg5dY8iChbiQEfYpTeBuU+e2rqj4mns+Jvy0zjUbMy6Tyva+iqdZ/PdsBDbiB7c+FIgB1IUTVOD+GgKx6dhCtBZEccn5EyWFwZF9IdQJHZCYV4PA7nuzfm1Ol9SDdZkGHd2OgRCqK/sTwyfTHv8exNqZ1k+epGJp2a0q4IOEknc9aPCAF+m9pHahk7s7VO5gmhO6pvbvuKoeEtEXRZHRzCkGkXfzJlBk+23X5gBexKb6inRdBlj6M= + name: komodo_linux-$TRAVIS_BRANCH + prerelease: true + file: komodo_linux.tar.gz + skip_cleanup: true + on: + repo: KomodoPlatform/komodo + branch: dev + condition: $LINUX_DEPLOY = "true" + - provider: releases + api_key: + secure: Jms7dz5GMZmuXUCHl5u6iZUtAybv86oW3x36DCJfdzbDiO4B9EWB04z7zA0qvoomefyujHTmQUHxyOKfd4h9/rVMFFv9hgmUxWkrcg7KyLNisOQRaovVOuNtu2lRNXTOSF16Cy+xFGkVh1ObBRhAoMsVKPhMl6PCDiKhNWIekRR9pBtjafKsClQ2ieknUYfqhuvgj7zmqCedeyVaVQyt2W/J65leD0BkfCUESTpANSprHs4bQB65VuQIKKMi+URKx2VgpDdUcWJySt9jAHVPIbI5cT5maAT6RUMnE4oha7Ca1Ox8StBqjQ/hkkMyDbN0keIlN7RjZlwdZQf/qUnT/dPQhsyUCdPXOxmEJ2jekezEK/LGr4Fb+v+vjd9dhLNkD5nVn9zp36biGSCjiMpffQ3fjMeM0YGmVEVRP9kZXLWVRYQoVKrzjyzg5dY8iChbiQEfYpTeBuU+e2rqj4mns+Jvy0zjUbMy6Tyva+iqdZ/PdsBDbiB7c+FIgB1IUTVOD+GgKx6dhCtBZEccn5EyWFwZF9IdQJHZCYV4PA7nuzfm1Ol9SDdZkGHd2OgRCqK/sTwyfTHv8exNqZ1k+epGJp2a0q4IOEknc9aPCAF+m9pHahk7s7VO5gmhO6pvbvuKoeEtEXRZHRzCkGkXfzJlBk+23X5gBexKb6inRdBlj6M= + name: komodo_osx-$TRAVIS_BRANCH + prerelease: true + file: komodo_osx.tar.gz + skip_cleanup: true + on: + repo: KomodoPlatform/komodo + branch: master + condition: $OSX_DEPLOY = "true" + - provider: releases + api_key: + secure: Jms7dz5GMZmuXUCHl5u6iZUtAybv86oW3x36DCJfdzbDiO4B9EWB04z7zA0qvoomefyujHTmQUHxyOKfd4h9/rVMFFv9hgmUxWkrcg7KyLNisOQRaovVOuNtu2lRNXTOSF16Cy+xFGkVh1ObBRhAoMsVKPhMl6PCDiKhNWIekRR9pBtjafKsClQ2ieknUYfqhuvgj7zmqCedeyVaVQyt2W/J65leD0BkfCUESTpANSprHs4bQB65VuQIKKMi+URKx2VgpDdUcWJySt9jAHVPIbI5cT5maAT6RUMnE4oha7Ca1Ox8StBqjQ/hkkMyDbN0keIlN7RjZlwdZQf/qUnT/dPQhsyUCdPXOxmEJ2jekezEK/LGr4Fb+v+vjd9dhLNkD5nVn9zp36biGSCjiMpffQ3fjMeM0YGmVEVRP9kZXLWVRYQoVKrzjyzg5dY8iChbiQEfYpTeBuU+e2rqj4mns+Jvy0zjUbMy6Tyva+iqdZ/PdsBDbiB7c+FIgB1IUTVOD+GgKx6dhCtBZEccn5EyWFwZF9IdQJHZCYV4PA7nuzfm1Ol9SDdZkGHd2OgRCqK/sTwyfTHv8exNqZ1k+epGJp2a0q4IOEknc9aPCAF+m9pHahk7s7VO5gmhO6pvbvuKoeEtEXRZHRzCkGkXfzJlBk+23X5gBexKb6inRdBlj6M= + name: komodo_osx-$TRAVIS_BRANCH + prerelease: true + file: komodo_osx.tar.gz + skip_cleanup: true + on: + repo: KomodoPlatform/komodo + branch: dev + condition: $OSX_DEPLOY = "true" From 22ba373414d719eb0e65f2bbf8ff8399ee733860 Mon Sep 17 00:00:00 2001 From: ca333 Date: Fri, 10 Aug 2018 00:11:23 +0200 Subject: [PATCH 016/119] update deployment keys --- .travis.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6792e41bb..93307b3a5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -47,7 +47,7 @@ before_deploy: deploy: - provider: releases api_key: - secure: Jms7dz5GMZmuXUCHl5u6iZUtAybv86oW3x36DCJfdzbDiO4B9EWB04z7zA0qvoomefyujHTmQUHxyOKfd4h9/rVMFFv9hgmUxWkrcg7KyLNisOQRaovVOuNtu2lRNXTOSF16Cy+xFGkVh1ObBRhAoMsVKPhMl6PCDiKhNWIekRR9pBtjafKsClQ2ieknUYfqhuvgj7zmqCedeyVaVQyt2W/J65leD0BkfCUESTpANSprHs4bQB65VuQIKKMi+URKx2VgpDdUcWJySt9jAHVPIbI5cT5maAT6RUMnE4oha7Ca1Ox8StBqjQ/hkkMyDbN0keIlN7RjZlwdZQf/qUnT/dPQhsyUCdPXOxmEJ2jekezEK/LGr4Fb+v+vjd9dhLNkD5nVn9zp36biGSCjiMpffQ3fjMeM0YGmVEVRP9kZXLWVRYQoVKrzjyzg5dY8iChbiQEfYpTeBuU+e2rqj4mns+Jvy0zjUbMy6Tyva+iqdZ/PdsBDbiB7c+FIgB1IUTVOD+GgKx6dhCtBZEccn5EyWFwZF9IdQJHZCYV4PA7nuzfm1Ol9SDdZkGHd2OgRCqK/sTwyfTHv8exNqZ1k+epGJp2a0q4IOEknc9aPCAF+m9pHahk7s7VO5gmhO6pvbvuKoeEtEXRZHRzCkGkXfzJlBk+23X5gBexKb6inRdBlj6M= + secure: id69KBVsY0p41WFlqd5cGrAIksJAkUempmdrQwHtfqIbB6es7MVfXuxfmTxk7lZNEItSvLGilYtqhBMNVAVjRRPvk90hveGDMkbpjFz3XBbFEFqtrAr2GdIcpGtII2T3T/TG7j11TMtJ6GvBVt4OcatHFVsKBCFDIx0fB0fd1oLrEAwgRdBO2Jq7bMzoLdzGx3mVtdW5dSRBQzG/Z0yvx+R9mQHSvyPGh6oNPD6mvXPzEaCeRW6Y8g8y1SW/6zDJR6sSdOKA0jsHkr/hM8st3Qkr5Cu3roEbL8598uvfBahjxVHVT8+lu/nJnQyrvtWZKu/uUefybqgZl7UpGvZVFxbNwAB/ZNn0pBKIpZlX/kh6rdGF0XrAG7g+Ths6iklh7wDefYP2JeGwHWJ38YcdF8T/VcSdOXz7EiWwEeZO5sGcTRSl5Ql8mcU3YyyB7BTdViYNTHf5VFFJ/baLZG+shZ/0tb1Ntx5mLDbV8vcYXJpUNTJcXbhcUDSF3QuSz04ftkzgpcsODzcTzD6+2sezV1vlOAlxK04C+zzxG96Md/TegvZYYns78RSgrP/UH1qwEbgxTo3xpErGllzntzZfHJ887Goez+DeB9ga7pUBc5AXGpfRhYqJP66wR10zqfWuWYvjAwRBRNySjr3pUvaA3T1iSZ5HLrpKBfcHXJOTg8M= name: komodo_linux-$TRAVIS_BRANCH prerelease: true file: komodo_linux.tar.gz @@ -58,7 +58,7 @@ deploy: condition: $LINUX_DEPLOY = "true" - provider: releases api_key: - secure: Jms7dz5GMZmuXUCHl5u6iZUtAybv86oW3x36DCJfdzbDiO4B9EWB04z7zA0qvoomefyujHTmQUHxyOKfd4h9/rVMFFv9hgmUxWkrcg7KyLNisOQRaovVOuNtu2lRNXTOSF16Cy+xFGkVh1ObBRhAoMsVKPhMl6PCDiKhNWIekRR9pBtjafKsClQ2ieknUYfqhuvgj7zmqCedeyVaVQyt2W/J65leD0BkfCUESTpANSprHs4bQB65VuQIKKMi+URKx2VgpDdUcWJySt9jAHVPIbI5cT5maAT6RUMnE4oha7Ca1Ox8StBqjQ/hkkMyDbN0keIlN7RjZlwdZQf/qUnT/dPQhsyUCdPXOxmEJ2jekezEK/LGr4Fb+v+vjd9dhLNkD5nVn9zp36biGSCjiMpffQ3fjMeM0YGmVEVRP9kZXLWVRYQoVKrzjyzg5dY8iChbiQEfYpTeBuU+e2rqj4mns+Jvy0zjUbMy6Tyva+iqdZ/PdsBDbiB7c+FIgB1IUTVOD+GgKx6dhCtBZEccn5EyWFwZF9IdQJHZCYV4PA7nuzfm1Ol9SDdZkGHd2OgRCqK/sTwyfTHv8exNqZ1k+epGJp2a0q4IOEknc9aPCAF+m9pHahk7s7VO5gmhO6pvbvuKoeEtEXRZHRzCkGkXfzJlBk+23X5gBexKb6inRdBlj6M= + secure: id69KBVsY0p41WFlqd5cGrAIksJAkUempmdrQwHtfqIbB6es7MVfXuxfmTxk7lZNEItSvLGilYtqhBMNVAVjRRPvk90hveGDMkbpjFz3XBbFEFqtrAr2GdIcpGtII2T3T/TG7j11TMtJ6GvBVt4OcatHFVsKBCFDIx0fB0fd1oLrEAwgRdBO2Jq7bMzoLdzGx3mVtdW5dSRBQzG/Z0yvx+R9mQHSvyPGh6oNPD6mvXPzEaCeRW6Y8g8y1SW/6zDJR6sSdOKA0jsHkr/hM8st3Qkr5Cu3roEbL8598uvfBahjxVHVT8+lu/nJnQyrvtWZKu/uUefybqgZl7UpGvZVFxbNwAB/ZNn0pBKIpZlX/kh6rdGF0XrAG7g+Ths6iklh7wDefYP2JeGwHWJ38YcdF8T/VcSdOXz7EiWwEeZO5sGcTRSl5Ql8mcU3YyyB7BTdViYNTHf5VFFJ/baLZG+shZ/0tb1Ntx5mLDbV8vcYXJpUNTJcXbhcUDSF3QuSz04ftkzgpcsODzcTzD6+2sezV1vlOAlxK04C+zzxG96Md/TegvZYYns78RSgrP/UH1qwEbgxTo3xpErGllzntzZfHJ887Goez+DeB9ga7pUBc5AXGpfRhYqJP66wR10zqfWuWYvjAwRBRNySjr3pUvaA3T1iSZ5HLrpKBfcHXJOTg8M= name: komodo_linux-$TRAVIS_BRANCH prerelease: true file: komodo_linux.tar.gz @@ -69,7 +69,7 @@ deploy: condition: $LINUX_DEPLOY = "true" - provider: releases api_key: - secure: Jms7dz5GMZmuXUCHl5u6iZUtAybv86oW3x36DCJfdzbDiO4B9EWB04z7zA0qvoomefyujHTmQUHxyOKfd4h9/rVMFFv9hgmUxWkrcg7KyLNisOQRaovVOuNtu2lRNXTOSF16Cy+xFGkVh1ObBRhAoMsVKPhMl6PCDiKhNWIekRR9pBtjafKsClQ2ieknUYfqhuvgj7zmqCedeyVaVQyt2W/J65leD0BkfCUESTpANSprHs4bQB65VuQIKKMi+URKx2VgpDdUcWJySt9jAHVPIbI5cT5maAT6RUMnE4oha7Ca1Ox8StBqjQ/hkkMyDbN0keIlN7RjZlwdZQf/qUnT/dPQhsyUCdPXOxmEJ2jekezEK/LGr4Fb+v+vjd9dhLNkD5nVn9zp36biGSCjiMpffQ3fjMeM0YGmVEVRP9kZXLWVRYQoVKrzjyzg5dY8iChbiQEfYpTeBuU+e2rqj4mns+Jvy0zjUbMy6Tyva+iqdZ/PdsBDbiB7c+FIgB1IUTVOD+GgKx6dhCtBZEccn5EyWFwZF9IdQJHZCYV4PA7nuzfm1Ol9SDdZkGHd2OgRCqK/sTwyfTHv8exNqZ1k+epGJp2a0q4IOEknc9aPCAF+m9pHahk7s7VO5gmhO6pvbvuKoeEtEXRZHRzCkGkXfzJlBk+23X5gBexKb6inRdBlj6M= + secure: id69KBVsY0p41WFlqd5cGrAIksJAkUempmdrQwHtfqIbB6es7MVfXuxfmTxk7lZNEItSvLGilYtqhBMNVAVjRRPvk90hveGDMkbpjFz3XBbFEFqtrAr2GdIcpGtII2T3T/TG7j11TMtJ6GvBVt4OcatHFVsKBCFDIx0fB0fd1oLrEAwgRdBO2Jq7bMzoLdzGx3mVtdW5dSRBQzG/Z0yvx+R9mQHSvyPGh6oNPD6mvXPzEaCeRW6Y8g8y1SW/6zDJR6sSdOKA0jsHkr/hM8st3Qkr5Cu3roEbL8598uvfBahjxVHVT8+lu/nJnQyrvtWZKu/uUefybqgZl7UpGvZVFxbNwAB/ZNn0pBKIpZlX/kh6rdGF0XrAG7g+Ths6iklh7wDefYP2JeGwHWJ38YcdF8T/VcSdOXz7EiWwEeZO5sGcTRSl5Ql8mcU3YyyB7BTdViYNTHf5VFFJ/baLZG+shZ/0tb1Ntx5mLDbV8vcYXJpUNTJcXbhcUDSF3QuSz04ftkzgpcsODzcTzD6+2sezV1vlOAlxK04C+zzxG96Md/TegvZYYns78RSgrP/UH1qwEbgxTo3xpErGllzntzZfHJ887Goez+DeB9ga7pUBc5AXGpfRhYqJP66wR10zqfWuWYvjAwRBRNySjr3pUvaA3T1iSZ5HLrpKBfcHXJOTg8M= name: komodo_osx-$TRAVIS_BRANCH prerelease: true file: komodo_osx.tar.gz @@ -80,7 +80,7 @@ deploy: condition: $OSX_DEPLOY = "true" - provider: releases api_key: - secure: Jms7dz5GMZmuXUCHl5u6iZUtAybv86oW3x36DCJfdzbDiO4B9EWB04z7zA0qvoomefyujHTmQUHxyOKfd4h9/rVMFFv9hgmUxWkrcg7KyLNisOQRaovVOuNtu2lRNXTOSF16Cy+xFGkVh1ObBRhAoMsVKPhMl6PCDiKhNWIekRR9pBtjafKsClQ2ieknUYfqhuvgj7zmqCedeyVaVQyt2W/J65leD0BkfCUESTpANSprHs4bQB65VuQIKKMi+URKx2VgpDdUcWJySt9jAHVPIbI5cT5maAT6RUMnE4oha7Ca1Ox8StBqjQ/hkkMyDbN0keIlN7RjZlwdZQf/qUnT/dPQhsyUCdPXOxmEJ2jekezEK/LGr4Fb+v+vjd9dhLNkD5nVn9zp36biGSCjiMpffQ3fjMeM0YGmVEVRP9kZXLWVRYQoVKrzjyzg5dY8iChbiQEfYpTeBuU+e2rqj4mns+Jvy0zjUbMy6Tyva+iqdZ/PdsBDbiB7c+FIgB1IUTVOD+GgKx6dhCtBZEccn5EyWFwZF9IdQJHZCYV4PA7nuzfm1Ol9SDdZkGHd2OgRCqK/sTwyfTHv8exNqZ1k+epGJp2a0q4IOEknc9aPCAF+m9pHahk7s7VO5gmhO6pvbvuKoeEtEXRZHRzCkGkXfzJlBk+23X5gBexKb6inRdBlj6M= + secure: id69KBVsY0p41WFlqd5cGrAIksJAkUempmdrQwHtfqIbB6es7MVfXuxfmTxk7lZNEItSvLGilYtqhBMNVAVjRRPvk90hveGDMkbpjFz3XBbFEFqtrAr2GdIcpGtII2T3T/TG7j11TMtJ6GvBVt4OcatHFVsKBCFDIx0fB0fd1oLrEAwgRdBO2Jq7bMzoLdzGx3mVtdW5dSRBQzG/Z0yvx+R9mQHSvyPGh6oNPD6mvXPzEaCeRW6Y8g8y1SW/6zDJR6sSdOKA0jsHkr/hM8st3Qkr5Cu3roEbL8598uvfBahjxVHVT8+lu/nJnQyrvtWZKu/uUefybqgZl7UpGvZVFxbNwAB/ZNn0pBKIpZlX/kh6rdGF0XrAG7g+Ths6iklh7wDefYP2JeGwHWJ38YcdF8T/VcSdOXz7EiWwEeZO5sGcTRSl5Ql8mcU3YyyB7BTdViYNTHf5VFFJ/baLZG+shZ/0tb1Ntx5mLDbV8vcYXJpUNTJcXbhcUDSF3QuSz04ftkzgpcsODzcTzD6+2sezV1vlOAlxK04C+zzxG96Md/TegvZYYns78RSgrP/UH1qwEbgxTo3xpErGllzntzZfHJ887Goez+DeB9ga7pUBc5AXGpfRhYqJP66wR10zqfWuWYvjAwRBRNySjr3pUvaA3T1iSZ5HLrpKBfcHXJOTg8M= name: komodo_osx-$TRAVIS_BRANCH prerelease: true file: komodo_osx.tar.gz From 1fd0b9a823b04ca1574e0ceb30ee127ccd519bef Mon Sep 17 00:00:00 2001 From: ca333 Date: Fri, 10 Aug 2018 14:00:24 +0200 Subject: [PATCH 017/119] test --- .travis.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 93307b3a5..5490f0f08 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,10 +5,10 @@ matrix: - os: linux dist: xenial sudo: required - env: LINUX_DEPLOY="true" OSX_DEPLOY="false" + env: LINUX_DEPLOY="true" OSX_DEPLOY="false" $TRAVIS_OS_NAME="linux" - os: osx osx_image: xcode8 - env: OSX_DEPLOY="true" LINUX_DEPLOY="false" + env: OSX_DEPLOY="true" LINUX_DEPLOY="false" $TRAVIS_OS_NAME="osx" branches: only: - master @@ -27,10 +27,10 @@ before_install: - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew link --overwrite gcc@6; fi script: - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./zcutil/build.sh -j 5; fi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then tar cvfz komodo_linux.tar.gz src/komodod src/komodo-cli; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then tar cvfz komodo_linux_$TRAVIS_BRANCH.tar.gz src/komodod src/komodo-cli; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ./zcutil/build-mac.sh -j 5; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ./makeRelease.sh; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then tar cvfz komodo_osx.tar.gz src/komodod src/komodo-cli src/libgcc_s.1.dylib src/libgomp.1.dylib src/libstdc++.6.dylib; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then tar cvfz komodo_osx_$TRAVIS_BRANCH.tar.gz src/komodod src/komodo-cli src/libgcc_s.1.dylib src/libgomp.1.dylib src/libstdc++.6.dylib; fi notifications: irc: channels: @@ -50,7 +50,7 @@ deploy: secure: id69KBVsY0p41WFlqd5cGrAIksJAkUempmdrQwHtfqIbB6es7MVfXuxfmTxk7lZNEItSvLGilYtqhBMNVAVjRRPvk90hveGDMkbpjFz3XBbFEFqtrAr2GdIcpGtII2T3T/TG7j11TMtJ6GvBVt4OcatHFVsKBCFDIx0fB0fd1oLrEAwgRdBO2Jq7bMzoLdzGx3mVtdW5dSRBQzG/Z0yvx+R9mQHSvyPGh6oNPD6mvXPzEaCeRW6Y8g8y1SW/6zDJR6sSdOKA0jsHkr/hM8st3Qkr5Cu3roEbL8598uvfBahjxVHVT8+lu/nJnQyrvtWZKu/uUefybqgZl7UpGvZVFxbNwAB/ZNn0pBKIpZlX/kh6rdGF0XrAG7g+Ths6iklh7wDefYP2JeGwHWJ38YcdF8T/VcSdOXz7EiWwEeZO5sGcTRSl5Ql8mcU3YyyB7BTdViYNTHf5VFFJ/baLZG+shZ/0tb1Ntx5mLDbV8vcYXJpUNTJcXbhcUDSF3QuSz04ftkzgpcsODzcTzD6+2sezV1vlOAlxK04C+zzxG96Md/TegvZYYns78RSgrP/UH1qwEbgxTo3xpErGllzntzZfHJ887Goez+DeB9ga7pUBc5AXGpfRhYqJP66wR10zqfWuWYvjAwRBRNySjr3pUvaA3T1iSZ5HLrpKBfcHXJOTg8M= name: komodo_linux-$TRAVIS_BRANCH prerelease: true - file: komodo_linux.tar.gz + file: komodo_linux_$TRAVIS_BRANCH.tar.gz.tar.gz skip_cleanup: true on: repo: KomodoPlatform/komodo @@ -61,7 +61,7 @@ deploy: secure: id69KBVsY0p41WFlqd5cGrAIksJAkUempmdrQwHtfqIbB6es7MVfXuxfmTxk7lZNEItSvLGilYtqhBMNVAVjRRPvk90hveGDMkbpjFz3XBbFEFqtrAr2GdIcpGtII2T3T/TG7j11TMtJ6GvBVt4OcatHFVsKBCFDIx0fB0fd1oLrEAwgRdBO2Jq7bMzoLdzGx3mVtdW5dSRBQzG/Z0yvx+R9mQHSvyPGh6oNPD6mvXPzEaCeRW6Y8g8y1SW/6zDJR6sSdOKA0jsHkr/hM8st3Qkr5Cu3roEbL8598uvfBahjxVHVT8+lu/nJnQyrvtWZKu/uUefybqgZl7UpGvZVFxbNwAB/ZNn0pBKIpZlX/kh6rdGF0XrAG7g+Ths6iklh7wDefYP2JeGwHWJ38YcdF8T/VcSdOXz7EiWwEeZO5sGcTRSl5Ql8mcU3YyyB7BTdViYNTHf5VFFJ/baLZG+shZ/0tb1Ntx5mLDbV8vcYXJpUNTJcXbhcUDSF3QuSz04ftkzgpcsODzcTzD6+2sezV1vlOAlxK04C+zzxG96Md/TegvZYYns78RSgrP/UH1qwEbgxTo3xpErGllzntzZfHJ887Goez+DeB9ga7pUBc5AXGpfRhYqJP66wR10zqfWuWYvjAwRBRNySjr3pUvaA3T1iSZ5HLrpKBfcHXJOTg8M= name: komodo_linux-$TRAVIS_BRANCH prerelease: true - file: komodo_linux.tar.gz + file: komodo_linux_$TRAVIS_BRANCH.tar.gz.tar.gz skip_cleanup: true on: repo: KomodoPlatform/komodo @@ -72,7 +72,7 @@ deploy: secure: id69KBVsY0p41WFlqd5cGrAIksJAkUempmdrQwHtfqIbB6es7MVfXuxfmTxk7lZNEItSvLGilYtqhBMNVAVjRRPvk90hveGDMkbpjFz3XBbFEFqtrAr2GdIcpGtII2T3T/TG7j11TMtJ6GvBVt4OcatHFVsKBCFDIx0fB0fd1oLrEAwgRdBO2Jq7bMzoLdzGx3mVtdW5dSRBQzG/Z0yvx+R9mQHSvyPGh6oNPD6mvXPzEaCeRW6Y8g8y1SW/6zDJR6sSdOKA0jsHkr/hM8st3Qkr5Cu3roEbL8598uvfBahjxVHVT8+lu/nJnQyrvtWZKu/uUefybqgZl7UpGvZVFxbNwAB/ZNn0pBKIpZlX/kh6rdGF0XrAG7g+Ths6iklh7wDefYP2JeGwHWJ38YcdF8T/VcSdOXz7EiWwEeZO5sGcTRSl5Ql8mcU3YyyB7BTdViYNTHf5VFFJ/baLZG+shZ/0tb1Ntx5mLDbV8vcYXJpUNTJcXbhcUDSF3QuSz04ftkzgpcsODzcTzD6+2sezV1vlOAlxK04C+zzxG96Md/TegvZYYns78RSgrP/UH1qwEbgxTo3xpErGllzntzZfHJ887Goez+DeB9ga7pUBc5AXGpfRhYqJP66wR10zqfWuWYvjAwRBRNySjr3pUvaA3T1iSZ5HLrpKBfcHXJOTg8M= name: komodo_osx-$TRAVIS_BRANCH prerelease: true - file: komodo_osx.tar.gz + file: komodo_osx_$TRAVIS_BRANCH.tar.gz.tar.gz skip_cleanup: true on: repo: KomodoPlatform/komodo @@ -83,7 +83,7 @@ deploy: secure: id69KBVsY0p41WFlqd5cGrAIksJAkUempmdrQwHtfqIbB6es7MVfXuxfmTxk7lZNEItSvLGilYtqhBMNVAVjRRPvk90hveGDMkbpjFz3XBbFEFqtrAr2GdIcpGtII2T3T/TG7j11TMtJ6GvBVt4OcatHFVsKBCFDIx0fB0fd1oLrEAwgRdBO2Jq7bMzoLdzGx3mVtdW5dSRBQzG/Z0yvx+R9mQHSvyPGh6oNPD6mvXPzEaCeRW6Y8g8y1SW/6zDJR6sSdOKA0jsHkr/hM8st3Qkr5Cu3roEbL8598uvfBahjxVHVT8+lu/nJnQyrvtWZKu/uUefybqgZl7UpGvZVFxbNwAB/ZNn0pBKIpZlX/kh6rdGF0XrAG7g+Ths6iklh7wDefYP2JeGwHWJ38YcdF8T/VcSdOXz7EiWwEeZO5sGcTRSl5Ql8mcU3YyyB7BTdViYNTHf5VFFJ/baLZG+shZ/0tb1Ntx5mLDbV8vcYXJpUNTJcXbhcUDSF3QuSz04ftkzgpcsODzcTzD6+2sezV1vlOAlxK04C+zzxG96Md/TegvZYYns78RSgrP/UH1qwEbgxTo3xpErGllzntzZfHJ887Goez+DeB9ga7pUBc5AXGpfRhYqJP66wR10zqfWuWYvjAwRBRNySjr3pUvaA3T1iSZ5HLrpKBfcHXJOTg8M= name: komodo_osx-$TRAVIS_BRANCH prerelease: true - file: komodo_osx.tar.gz + file: komodo_osx_$TRAVIS_BRANCH.tar.gz.tar.gz skip_cleanup: true on: repo: KomodoPlatform/komodo From 32f6814d7e40d1b1fcfea12ac476c991a9795c00 Mon Sep 17 00:00:00 2001 From: ca333 Date: Fri, 10 Aug 2018 14:01:31 +0200 Subject: [PATCH 018/119] test --- .travis.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5490f0f08..bfc8b8b4a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -50,7 +50,7 @@ deploy: secure: id69KBVsY0p41WFlqd5cGrAIksJAkUempmdrQwHtfqIbB6es7MVfXuxfmTxk7lZNEItSvLGilYtqhBMNVAVjRRPvk90hveGDMkbpjFz3XBbFEFqtrAr2GdIcpGtII2T3T/TG7j11TMtJ6GvBVt4OcatHFVsKBCFDIx0fB0fd1oLrEAwgRdBO2Jq7bMzoLdzGx3mVtdW5dSRBQzG/Z0yvx+R9mQHSvyPGh6oNPD6mvXPzEaCeRW6Y8g8y1SW/6zDJR6sSdOKA0jsHkr/hM8st3Qkr5Cu3roEbL8598uvfBahjxVHVT8+lu/nJnQyrvtWZKu/uUefybqgZl7UpGvZVFxbNwAB/ZNn0pBKIpZlX/kh6rdGF0XrAG7g+Ths6iklh7wDefYP2JeGwHWJ38YcdF8T/VcSdOXz7EiWwEeZO5sGcTRSl5Ql8mcU3YyyB7BTdViYNTHf5VFFJ/baLZG+shZ/0tb1Ntx5mLDbV8vcYXJpUNTJcXbhcUDSF3QuSz04ftkzgpcsODzcTzD6+2sezV1vlOAlxK04C+zzxG96Md/TegvZYYns78RSgrP/UH1qwEbgxTo3xpErGllzntzZfHJ887Goez+DeB9ga7pUBc5AXGpfRhYqJP66wR10zqfWuWYvjAwRBRNySjr3pUvaA3T1iSZ5HLrpKBfcHXJOTg8M= name: komodo_linux-$TRAVIS_BRANCH prerelease: true - file: komodo_linux_$TRAVIS_BRANCH.tar.gz.tar.gz + file: komodo_linux_$TRAVIS_BRANCH.tar.gz skip_cleanup: true on: repo: KomodoPlatform/komodo @@ -61,7 +61,7 @@ deploy: secure: id69KBVsY0p41WFlqd5cGrAIksJAkUempmdrQwHtfqIbB6es7MVfXuxfmTxk7lZNEItSvLGilYtqhBMNVAVjRRPvk90hveGDMkbpjFz3XBbFEFqtrAr2GdIcpGtII2T3T/TG7j11TMtJ6GvBVt4OcatHFVsKBCFDIx0fB0fd1oLrEAwgRdBO2Jq7bMzoLdzGx3mVtdW5dSRBQzG/Z0yvx+R9mQHSvyPGh6oNPD6mvXPzEaCeRW6Y8g8y1SW/6zDJR6sSdOKA0jsHkr/hM8st3Qkr5Cu3roEbL8598uvfBahjxVHVT8+lu/nJnQyrvtWZKu/uUefybqgZl7UpGvZVFxbNwAB/ZNn0pBKIpZlX/kh6rdGF0XrAG7g+Ths6iklh7wDefYP2JeGwHWJ38YcdF8T/VcSdOXz7EiWwEeZO5sGcTRSl5Ql8mcU3YyyB7BTdViYNTHf5VFFJ/baLZG+shZ/0tb1Ntx5mLDbV8vcYXJpUNTJcXbhcUDSF3QuSz04ftkzgpcsODzcTzD6+2sezV1vlOAlxK04C+zzxG96Md/TegvZYYns78RSgrP/UH1qwEbgxTo3xpErGllzntzZfHJ887Goez+DeB9ga7pUBc5AXGpfRhYqJP66wR10zqfWuWYvjAwRBRNySjr3pUvaA3T1iSZ5HLrpKBfcHXJOTg8M= name: komodo_linux-$TRAVIS_BRANCH prerelease: true - file: komodo_linux_$TRAVIS_BRANCH.tar.gz.tar.gz + file: komodo_linux_$TRAVIS_BRANCH.tar.gz skip_cleanup: true on: repo: KomodoPlatform/komodo @@ -72,7 +72,7 @@ deploy: secure: id69KBVsY0p41WFlqd5cGrAIksJAkUempmdrQwHtfqIbB6es7MVfXuxfmTxk7lZNEItSvLGilYtqhBMNVAVjRRPvk90hveGDMkbpjFz3XBbFEFqtrAr2GdIcpGtII2T3T/TG7j11TMtJ6GvBVt4OcatHFVsKBCFDIx0fB0fd1oLrEAwgRdBO2Jq7bMzoLdzGx3mVtdW5dSRBQzG/Z0yvx+R9mQHSvyPGh6oNPD6mvXPzEaCeRW6Y8g8y1SW/6zDJR6sSdOKA0jsHkr/hM8st3Qkr5Cu3roEbL8598uvfBahjxVHVT8+lu/nJnQyrvtWZKu/uUefybqgZl7UpGvZVFxbNwAB/ZNn0pBKIpZlX/kh6rdGF0XrAG7g+Ths6iklh7wDefYP2JeGwHWJ38YcdF8T/VcSdOXz7EiWwEeZO5sGcTRSl5Ql8mcU3YyyB7BTdViYNTHf5VFFJ/baLZG+shZ/0tb1Ntx5mLDbV8vcYXJpUNTJcXbhcUDSF3QuSz04ftkzgpcsODzcTzD6+2sezV1vlOAlxK04C+zzxG96Md/TegvZYYns78RSgrP/UH1qwEbgxTo3xpErGllzntzZfHJ887Goez+DeB9ga7pUBc5AXGpfRhYqJP66wR10zqfWuWYvjAwRBRNySjr3pUvaA3T1iSZ5HLrpKBfcHXJOTg8M= name: komodo_osx-$TRAVIS_BRANCH prerelease: true - file: komodo_osx_$TRAVIS_BRANCH.tar.gz.tar.gz + file: komodo_osx_$TRAVIS_BRANCH.tar.gz skip_cleanup: true on: repo: KomodoPlatform/komodo @@ -83,7 +83,7 @@ deploy: secure: id69KBVsY0p41WFlqd5cGrAIksJAkUempmdrQwHtfqIbB6es7MVfXuxfmTxk7lZNEItSvLGilYtqhBMNVAVjRRPvk90hveGDMkbpjFz3XBbFEFqtrAr2GdIcpGtII2T3T/TG7j11TMtJ6GvBVt4OcatHFVsKBCFDIx0fB0fd1oLrEAwgRdBO2Jq7bMzoLdzGx3mVtdW5dSRBQzG/Z0yvx+R9mQHSvyPGh6oNPD6mvXPzEaCeRW6Y8g8y1SW/6zDJR6sSdOKA0jsHkr/hM8st3Qkr5Cu3roEbL8598uvfBahjxVHVT8+lu/nJnQyrvtWZKu/uUefybqgZl7UpGvZVFxbNwAB/ZNn0pBKIpZlX/kh6rdGF0XrAG7g+Ths6iklh7wDefYP2JeGwHWJ38YcdF8T/VcSdOXz7EiWwEeZO5sGcTRSl5Ql8mcU3YyyB7BTdViYNTHf5VFFJ/baLZG+shZ/0tb1Ntx5mLDbV8vcYXJpUNTJcXbhcUDSF3QuSz04ftkzgpcsODzcTzD6+2sezV1vlOAlxK04C+zzxG96Md/TegvZYYns78RSgrP/UH1qwEbgxTo3xpErGllzntzZfHJ887Goez+DeB9ga7pUBc5AXGpfRhYqJP66wR10zqfWuWYvjAwRBRNySjr3pUvaA3T1iSZ5HLrpKBfcHXJOTg8M= name: komodo_osx-$TRAVIS_BRANCH prerelease: true - file: komodo_osx_$TRAVIS_BRANCH.tar.gz.tar.gz + file: komodo_osx_$TRAVIS_BRANCH.tar.gz skip_cleanup: true on: repo: KomodoPlatform/komodo From ae33616fc4d933e0b5319d97667bbaab04b44242 Mon Sep 17 00:00:00 2001 From: SHossain Date: Mon, 1 Oct 2018 10:53:12 +0100 Subject: [PATCH 019/119] Update README.md --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index e8ed8c3cb..2285e8827 100644 --- a/README.md +++ b/README.md @@ -8,16 +8,16 @@ This is the official Komodo sourcecode repository based on https://github.com/jl777/komodo. ## Development Resources - -- Komodo Website: [https://komodoplatform.com/](https://komodoplatform.com/) -- Komodo Blockexplorer: [https://kmdexplorer.io//](https://https://kmdexplorer.io/) -- Forum: [https://forum.komodoplatform.com/](https://forum.komodoplatform.com/) +- Komodo Website: [https://komodoplatform.com](https://komodoplatform.com/) +- Komodo Blockexplorer: [https://kmdexplorer.io](https://kmdexplorer.io/) +- Komodo Discord: [https://komodoplatform.com/discord](https://komodoplatform.com/discord) +- Forum: [https://forum.komodoplatform.com](https://forum.komodoplatform.com/) - Mail: [info@komodoplatform.com](mailto:info@komodoplatform.com) - Support: [https://support.komodoplatform.com/support/home](https://support.komodoplatform.com/support/home) -- Knowledgebase & How-to: [https://komodoplatform.atlassian.net/wiki/spaces/KPSD/pages](https://komodoplatform.atlassian.net/wiki/spaces/KPSD/pages) -- API references: [http://docs.komodoplatform.com/](http://docs.komodoplatform.com/) -- Blog: [http://blog.komodoplatform.com/](http://blog.komodoplatform.com/) -- Whitepaper: [Komodo Whitepaper](https://komodoplatform.com/wp-content/uploads/2018/03/2018-03-12-Komodo-White-Paper-Full.pdf) +- Knowledgebase & How-to: [https://support.komodoplatform.com/en/support/solutions](https://support.komodoplatform.com/en/support/solutions) +- API references & Dev Documentation: [https://docs.komodoplatform.com](https://docs.komodoplatform.com/) +- Blog: [https://blog.komodoplatform.com](https://blog.komodoplatform.com/) +- Whitepaper: [Komodo Whitepaper](https://komodoplatform.com/whitepaper) - Komodo Platform public material: [Komodo Platform public material](https://docs.google.com/document/d/1AbhWrtagu4vYdkl-vsWz-HSNyNvK-W-ZasHCqe7CZy0) ## List of Komodo Platform Technologies From 8e1f081a7e76bffb9f4eb0a0ea43c7af7001b51c Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Mon, 12 Nov 2018 11:53:07 +0800 Subject: [PATCH 020/119] ix? --- src/cc/dice.cpp | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/cc/dice.cpp b/src/cc/dice.cpp index cc669c771..ea5edea7e 100644 --- a/src/cc/dice.cpp +++ b/src/cc/dice.cpp @@ -1254,12 +1254,9 @@ int64_t DicePlanFunds(uint64_t &entropyval,uint256 &entropytxid,uint64_t refsbit } else { return(0); } -<<<<<<< HEAD fprintf(stderr,"numentropy tx %d: %.8f\n",n,(double)totalinputs/COIN); entropytxs = n; return(totalinputs); -======= ->>>>>>> 4d711ae4aa4c84f55cb63c56770205b46332f40a } bool DicePlanExists(CScript &fundingPubKey,uint256 &fundingtxid,struct CCcontract_info *cp,uint64_t refsbits,CPubKey dicepk,int64_t &minbet,int64_t &maxbet,int64_t &maxodds,int64_t &timeoutblocks) @@ -1351,14 +1348,8 @@ UniValue DiceInfo(uint256 diceid) result.push_back(Pair("timeoutblocks",timeoutblocks)); cp = CCinit(&C,EVAL_DICE); dicepk = GetUnspendable(cp,0); -<<<<<<< HEAD - int32_t entropytxs = 0; - funding = DicePlanFunds(entropyval,entropytxid,sbits,cp,dicepk,diceid,entropytxs); - result.push_back(Pair("entropytxs",entropytxs)); -======= int32_t entropytxs; funding = DicePlanFunds(entropyval,entropytxid,sbits,cp,dicepk,diceid,entropytxs,false); ->>>>>>> 4d711ae4aa4c84f55cb63c56770205b46332f40a sprintf(numstr,"%.8f",(double)funding/COIN); result.push_back(Pair("funding",numstr)); result.push_back(Pair("entropytxs",entropytxs)); @@ -1485,10 +1476,6 @@ std::string DiceBet(uint64_t txfee,char *planstr,uint256 fundingtxid,int64_t bet CCerror = strprintf("Dice plan %s illegal bet %.8f: minbet %.8f maxbet %.8f or odds %d vs max.%d\n",planstr,(double)bet/COIN,(double)minbet/COIN,(double)maxbet/COIN,(int32_t)odds,(int32_t)maxodds); return(""); } -<<<<<<< HEAD - int32_t entropytxs; - if ( (funding= DicePlanFunds(entropyval,entropytxid,sbits,cp,dicepk,fundingtxid,entropytxs)) >= 2*bet*odds+txfee && entropyval != 0 ) -======= int32_t entropytxs=0,emptyvar=0; funding = DicePlanFunds(entropyval,entropytxid,sbits,cp,dicepk,fundingtxid,entropytxs,false); DicePlanFunds(entropyval2,entropytxid2,sbits,cp,dicepk,fundingtxid,emptyvar,true); @@ -1498,7 +1485,6 @@ std::string DiceBet(uint64_t txfee,char *planstr,uint256 fundingtxid,int64_t bet entropytxid = entropytxid2; } if ( ( funding >= 2*bet*odds+txfee && entropyval != 0 ) ) ->>>>>>> 4d711ae4aa4c84f55cb63c56770205b46332f40a { if ( entropytxs < 100 ) { CCerror = "Your dealer is broke, find a new casino."; From 02a54b36a8bf5534dc534fba5d2ccff979167346 Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Mon, 12 Nov 2018 12:39:11 +0800 Subject: [PATCH 021/119] fix max money cap!? --- src/assetchains.json | 12 ++++++++++++ src/komodo_utils.h | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/assetchains.json b/src/assetchains.json index d26f3a99a..4cac1fc6e 100644 --- a/src/assetchains.json +++ b/src/assetchains.json @@ -177,6 +177,18 @@ ] }, { + "ac_name": "KMDICE", + "ac_supply": "10500000", + "ac_reward": "2500000000", + "ac_halving": "210000", + "ac_cc": "2", + "addressindex": "1", + "spentindex": "1", + "addnode": [ + "144.76.217.232" + ] + }, + { "ac_name": "DION", "ac_supply": "3900000000", "ac_reward": "22260000000", diff --git a/src/komodo_utils.h b/src/komodo_utils.h index fe6397dcd..2ed50b994 100644 --- a/src/komodo_utils.h +++ b/src/komodo_utils.h @@ -1641,8 +1641,8 @@ void komodo_args(char *argv0) MAX_MONEY += (MAX_MONEY * ASSETCHAINS_COMMISSION) / SATOSHIDEN; if ( ASSETCHAINS_CC >= KOMODO_FIRSTFUNGIBLEID && MAX_MONEY < 1000000LL*SATOSHIDEN ) MAX_MONEY = 1000000LL*SATOSHIDEN; - if ( MAX_MONEY <= 0 || MAX_MONEY > 1000000000LL*SATOSHIDEN ) - MAX_MONEY = 1000000000LL*SATOSHIDEN; + //if ( MAX_MONEY <= 0 || MAX_MONEY > 1000000000LL*SATOSHIDEN ) + // MAX_MONEY = 1000000000LL*SATOSHIDEN; //fprintf(stderr,"MAX_MONEY %llu %.8f\n",(long long)MAX_MONEY,(double)MAX_MONEY/SATOSHIDEN); //printf("baseid.%d MAX_MONEY.%s %.8f\n",baseid,ASSETCHAINS_SYMBOL,(double)MAX_MONEY/SATOSHIDEN); ASSETCHAINS_P2PPORT = komodo_port(ASSETCHAINS_SYMBOL,ASSETCHAINS_SUPPLY,&ASSETCHAINS_MAGIC,extraptr,extralen); From 3cc9f623a8ce2f95f9030ce80a95e78fa2cd9171 Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Sun, 18 Nov 2018 20:44:52 +0800 Subject: [PATCH 022/119] commit toest to dev, clean wallet branch broken --- src/rpcserver.cpp | 2 +- src/rpcserver.h | 2 +- src/wallet/rpcwallet.cpp | 37 ++++++++++++++++++++++++++----------- 3 files changed, 28 insertions(+), 13 deletions(-) diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp index 4100d2210..81a8f7cf5 100644 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -494,7 +494,7 @@ static const CRPCCommand vRPCCommands[] = { "wallet", "getaccountaddress", &getaccountaddress, true }, { "wallet", "getaccount", &getaccount, true }, { "wallet", "getaddressesbyaccount", &getaddressesbyaccount, true }, - { "wallet", "cleanwalletnotarisations", &cleanwalletnotarisations, false }, + { "wallet", "cleanwallettransactions", &cleanwallettransactions, false }, { "wallet", "getbalance", &getbalance, false }, { "wallet", "getbalance64", &getbalance64, false }, { "wallet", "getnewaddress", &getnewaddress, true }, diff --git a/src/rpcserver.h b/src/rpcserver.h index 579db50c9..5be24c633 100644 --- a/src/rpcserver.h +++ b/src/rpcserver.h @@ -300,7 +300,7 @@ extern UniValue signmessage(const UniValue& params, bool fHelp); extern UniValue verifymessage(const UniValue& params, bool fHelp); extern UniValue getreceivedbyaddress(const UniValue& params, bool fHelp); extern UniValue getreceivedbyaccount(const UniValue& params, bool fHelp); -extern UniValue cleanwalletnotarisations(const UniValue& params, bool fHelp); +extern UniValue cleanwallettransactions(const UniValue& params, bool fHelp); extern UniValue getbalance(const UniValue& params, bool fHelp); extern UniValue getbalance64(const UniValue& params, bool fHelp); extern UniValue getunconfirmedbalance(const UniValue& params, bool fHelp); diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index c16df1a42..c46e3043d 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -999,15 +999,15 @@ CAmount GetAccountBalance(const string& strAccount, int nMinDepth, const isminef return GetAccountBalance(walletdb, strAccount, nMinDepth, filter); } -UniValue cleanwalletnotarisations(const UniValue& params, bool fHelp) +UniValue cleanwallettransactions(const UniValue& params, bool fHelp) { if (!EnsureWalletIsAvailable(fHelp)) return NullUniValue; if (fHelp || params.size() > 1 ) throw runtime_error( - "cleanwalletnotarisations \"txid\"\n" - "\nRemove all txs which are totally spent and all notarisations created from them, you can clear all txs bar one, by specifiying a txid.\n" + "cleanwallettransactions \"txid\"\n" + "\nRemove all txs which are totally spent, you can clear all txs bar one, by specifiying a txid.\n" "\nPlease backup your wallet.dat before running this command.\n" "\nArguments:\n" "1. \"txid\" (string, optional) The transaction id to keep.\n" @@ -1042,7 +1042,6 @@ UniValue cleanwalletnotarisations(const UniValue& params, bool fHelp) { for (map::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it) { - txs++; const CWalletTx& wtx = (*it).second; if ( wtx.GetHash() != exception ) { @@ -1058,7 +1057,23 @@ UniValue cleanwalletnotarisations(const UniValue& params, bool fHelp) } else { - std::vector NotarisationTxs; + // listunspent call... this gets us all the txids that are unspent, we search this list for the oldest tx, + // then delete all txs in the wallet before this block + 10 as safety buffer. + vector vecOutputs; + assert(pwalletMain != NULL); + pwalletMain->AvailableCoins(vecOutputs, false, NULL, true); + int32_t oldestTxHeight = 0; + BOOST_FOREACH(const COutput& out, vecOutputs) + { + int32_t txheight = out.nDepth; + fprintf(stderr, "txheight.%i\n", txheight); + if ( txheight > oldestTxHeight ) + oldestTxHeight = txheight; + } + fprintf(stderr, "oldestTxHeight.%i\n",oldestTxHeight); + + + /*std::vector NotarisationTxs; for (map::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it) { const CWalletTx& wtx = (*it).second; @@ -1117,15 +1132,15 @@ UniValue cleanwalletnotarisations(const UniValue& params, bool fHelp) } } } - } + } */ } // erase txs - BOOST_FOREACH (uint256& hash, TxToRemove) + /*BOOST_FOREACH (uint256& hash, TxToRemove) { pwalletMain->EraseFromWallet(hash); LogPrintf("ERASED spent Tx: %s\n",hash.ToString().c_str()); - } + } */ // build return JSON for stats. int remaining = pwalletMain->mapWallet.size(); @@ -5755,7 +5770,7 @@ UniValue gatewayswithdraw(const UniValue& params, bool fHelp) const CKeyStore& keystore = *pwalletMain; LOCK2(cs_main, pwalletMain->cs_wallet); bindtxid = Parseuint256((char *)params[0].get_str().c_str()); - coin = params[1].get_str(); + coin = params[1].get_str(); withdrawpub = ParseHex(params[2].get_str()); amount = atof((char *)params[3].get_str().c_str()) * COIN; hex = GatewaysWithdraw(0,bindtxid,coin,pubkey2pk(withdrawpub),amount); @@ -5808,7 +5823,7 @@ UniValue gatewaysmultisig(const UniValue& params, bool fHelp) if ( ensure_CCrequirements() < 0 ) throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n"); const CKeyStore& keystore = *pwalletMain; - LOCK2(cs_main, pwalletMain->cs_wallet); + LOCK2(cs_main, pwalletMain->cs_wallet); txidaddr = (char *)params[0].get_str().c_str(); return(GatewaysMultisig(txidaddr)); } @@ -5821,7 +5836,7 @@ UniValue gatewayspartialsign(const UniValue& params, bool fHelp) if ( ensure_CCrequirements() < 0 ) throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n"); const CKeyStore& keystore = *pwalletMain; - LOCK2(cs_main, pwalletMain->cs_wallet); + LOCK2(cs_main, pwalletMain->cs_wallet); txid = Parseuint256((char *)params[0].get_str().c_str()); coin = params[1].get_str(); parthex = params[2].get_str(); From eead6be2c7b1fc6eb4f1199bf8b16ad9c8120c98 Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Sun, 18 Nov 2018 21:24:08 +0800 Subject: [PATCH 023/119] add delete logic --- src/wallet/rpcwallet.cpp | 89 ++++++++-------------------------------- 1 file changed, 18 insertions(+), 71 deletions(-) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index c46e3043d..73f3e7f66 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -1057,90 +1057,37 @@ UniValue cleanwallettransactions(const UniValue& params, bool fHelp) } else { - // listunspent call... this gets us all the txids that are unspent, we search this list for the oldest tx, - // then delete all txs in the wallet before this block + 10 as safety buffer. - vector vecOutputs; - assert(pwalletMain != NULL); - pwalletMain->AvailableCoins(vecOutputs, false, NULL, true); - int32_t oldestTxHeight = 0; - BOOST_FOREACH(const COutput& out, vecOutputs) - { - int32_t txheight = out.nDepth; - fprintf(stderr, "txheight.%i\n", txheight); - if ( txheight > oldestTxHeight ) - oldestTxHeight = txheight; - } - fprintf(stderr, "oldestTxHeight.%i\n",oldestTxHeight); + // listunspent call... this gets us all the txids that are unspent, we search this list for the oldest tx, + vector vecOutputs; + assert(pwalletMain != NULL); + pwalletMain->AvailableCoins(vecOutputs, false, NULL, true); + int32_t oldestTxDepth = 0; + BOOST_FOREACH(const COutput& out, vecOutputs) + { + if ( out.nDepth > oldestTxHeight ) + oldestTxDepth = out.nDepth; + } + oldestTxDepth = oldestTxDepth + 1; + fprintf(stderr, "oldestTxHeight.%i\n",oldestTxHeight); - - /*std::vector NotarisationTxs; + // then add all txs in the wallet before this block to the list to remove. for (map::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it) { const CWalletTx& wtx = (*it).second; - if (!CheckFinalTx(wtx) || wtx.GetBlocksToMaturity() > 0 || wtx.GetDepthInMainChain() < 360 ) - continue; - - CCoins coins; - if (!pcoinsTip->GetCoins(wtx.GetHash(), coins)) + if (wtx.GetDepthInMainChain() < oldestTxDepth) { - int spents = 0; int mine = 0; - for (unsigned int n = 0; n < wtx.vout.size() ; n++) - { - if ( pwalletMain->IsMine(wtx.vout[n]) ) - mine++; - if ( ((unsigned int)n >= coins.vout.size() || coins.vout[n].IsNull() ) ) - spents++; - } - if ( spents == mine ) - { - for (unsigned int n = 0; n < wtx.vin.size() ; n++) - { - CTransaction vintx; uint256 hashBlock; - if ( GetTransaction(wtx.vin[n].prevout.hash,vintx,hashBlock,false) != 0 ) - { - for (unsigned int z = 0; z < vintx.vin.size() ; z++) - { - TxToRemove.push_back(vintx.vin[z].prevout.hash); - } - } - TxToRemove.push_back(wtx.vin[n].prevout.hash); - } - TxToRemove.push_back(wtx.GetHash()); - } - } - - CTxDestination address; - // get all notarisations - if ( ExtractDestination(wtx.vout[0].scriptPubKey, address) ) - { - if ( strcmp(CBitcoinAddress(address).ToString().c_str(),CRYPTO777_KMDADDR) == 0 ) - NotarisationTxs.push_back(wtx); + TxToRemove.push_back(wtx.GetHash()); + fprintf(stderr, "[%s] : depth.%i \n",wtx.GetHash(),wtx.GetDepthInMainChain()); } } - - // Erase notarisations spending from fully spent splits. - BOOST_FOREACH (CWalletTx& tx, NotarisationTxs) - { - for (int n = 0; n < tx.vin.size(); n++) - { - BOOST_FOREACH (uint256& SpentHash, TxToRemove) - { - if ( SpentHash == tx.vin[n].prevout.hash ) - { - pwalletMain->EraseFromWallet(tx.GetHash()); - LogPrintf("ERASED Notarisation: %s\n",tx.GetHash().ToString().c_str()); - } - } - } - } */ } // erase txs - /*BOOST_FOREACH (uint256& hash, TxToRemove) + BOOST_FOREACH (uint256& hash, TxToRemove) { pwalletMain->EraseFromWallet(hash); LogPrintf("ERASED spent Tx: %s\n",hash.ToString().c_str()); - } */ + } // build return JSON for stats. int remaining = pwalletMain->mapWallet.size(); From 769d800441bbefa5fe94454cd72374a482fa1aed Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Sun, 18 Nov 2018 21:26:03 +0800 Subject: [PATCH 024/119] fix --- src/wallet/rpcwallet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 73f3e7f66..2e848cd75 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -1077,7 +1077,7 @@ UniValue cleanwallettransactions(const UniValue& params, bool fHelp) if (wtx.GetDepthInMainChain() < oldestTxDepth) { TxToRemove.push_back(wtx.GetHash()); - fprintf(stderr, "[%s] : depth.%i \n",wtx.GetHash(),wtx.GetDepthInMainChain()); + fprintf(stderr, "[%s] : depth.%i \n",wtx.GetHash().ToString().c_str(),wtx.GetDepthInMainChain()); } } } From 702f709517bf5b0e201b169a530ea87df71f2082 Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Sun, 18 Nov 2018 21:27:12 +0800 Subject: [PATCH 025/119] fix --- src/wallet/rpcwallet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 2e848cd75..631a475de 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -1068,7 +1068,7 @@ UniValue cleanwallettransactions(const UniValue& params, bool fHelp) oldestTxDepth = out.nDepth; } oldestTxDepth = oldestTxDepth + 1; - fprintf(stderr, "oldestTxHeight.%i\n",oldestTxHeight); + fprintf(stderr, "oldestTxDepth.%i\n",oldestTxDepth); // then add all txs in the wallet before this block to the list to remove. for (map::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it) From dbbe6d419194f7f9f6df88764bc539234a963541 Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Sun, 18 Nov 2018 21:28:10 +0800 Subject: [PATCH 026/119] fix --- src/wallet/rpcwallet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 631a475de..fed60ff31 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -1064,7 +1064,7 @@ UniValue cleanwallettransactions(const UniValue& params, bool fHelp) int32_t oldestTxDepth = 0; BOOST_FOREACH(const COutput& out, vecOutputs) { - if ( out.nDepth > oldestTxHeight ) + if ( out.nDepth > oldestTxDepth ) oldestTxDepth = out.nDepth; } oldestTxDepth = oldestTxDepth + 1; From d506b5433e3e5be219ea10870036f4e0d3f83944 Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Sun, 18 Nov 2018 21:32:19 +0800 Subject: [PATCH 027/119] > --- src/wallet/rpcwallet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index fed60ff31..a5cb169d6 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -1074,7 +1074,7 @@ UniValue cleanwallettransactions(const UniValue& params, bool fHelp) for (map::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it) { const CWalletTx& wtx = (*it).second; - if (wtx.GetDepthInMainChain() < oldestTxDepth) + if (wtx.GetDepthInMainChain() > oldestTxDepth) { TxToRemove.push_back(wtx.GetHash()); fprintf(stderr, "[%s] : depth.%i \n",wtx.GetHash().ToString().c_str(),wtx.GetDepthInMainChain()); From 540e3f03b2f70f86052edeba424dfac3140ef80c Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Sun, 18 Nov 2018 22:31:20 +0800 Subject: [PATCH 028/119] fix log prints --- src/wallet/rpcwallet.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index de50d0257..56525625f 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -1008,7 +1008,7 @@ UniValue cleanwallettransactions(const UniValue& params, bool fHelp) if (fHelp || params.size() > 1 ) throw runtime_error( "cleanwallettransactions \"txid\"\n" - "\nRemove all txs which are totally spent, you can clear all txs bar one, by specifiying a txid.\n" + "\nRemove all txs that are spent. You can clear all txs bar one, by specifiying a txid.\n" "\nPlease backup your wallet.dat before running this command.\n" "\nArguments:\n" "1. \"txid\" (string, optional) The transaction id to keep.\n" @@ -1068,18 +1068,14 @@ UniValue cleanwallettransactions(const UniValue& params, bool fHelp) if ( out.nDepth > oldestTxDepth ) oldestTxDepth = out.nDepth; } - oldestTxDepth = oldestTxDepth + 1; - fprintf(stderr, "oldestTxDepth.%i\n",oldestTxDepth); + oldestTxDepth = oldestTxDepth + 1; // add extra block just for safety. // then add all txs in the wallet before this block to the list to remove. for (map::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it) { const CWalletTx& wtx = (*it).second; if (wtx.GetDepthInMainChain() > oldestTxDepth) - { TxToRemove.push_back(wtx.GetHash()); - fprintf(stderr, "[%s] : depth.%i \n",wtx.GetHash().ToString().c_str(),wtx.GetDepthInMainChain()); - } } } @@ -1087,7 +1083,7 @@ UniValue cleanwallettransactions(const UniValue& params, bool fHelp) BOOST_FOREACH (uint256& hash, TxToRemove) { pwalletMain->EraseFromWallet(hash); - LogPrintf("ERASED spent Tx: %s\n",hash.ToString().c_str()); + LogPrintf("Erased %s from wallet.\n",hash.ToString().c_str()); } // build return JSON for stats. From b22e82022f94e71dfef378146a6d737dd482a3ed Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Sun, 18 Nov 2018 22:56:23 +0800 Subject: [PATCH 029/119] fix help --- src/wallet/rpcwallet.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 56525625f..605e55c74 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -1019,10 +1019,10 @@ UniValue cleanwallettransactions(const UniValue& params, bool fHelp) " \"removed_transactons\" : n, (numeric) The number of transactions removed.\n" "}\n" "\nExamples:\n" - + HelpExampleCli("cleanoldtxs", "") - + HelpExampleCli("cleanoldtxs","\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\"") - + HelpExampleRpc("cleanoldtxs", "") - + HelpExampleRpc("cleanoldtxs","\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\"") + + HelpExampleCli("cleanwallettransactions", "") + + HelpExampleCli("cleanwallettransactions","\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\"") + + HelpExampleRpc("cleanwallettransactions", "") + + HelpExampleRpc("cleanwallettransactions","\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\"") ); LOCK2(cs_main, pwalletMain->cs_wallet); From 7a89c512ce4a61f7652adf3986fbf262c5f3a093 Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Tue, 20 Nov 2018 13:32:17 +0800 Subject: [PATCH 030/119] x10 safety margin --- src/wallet/rpcwallet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 605e55c74..b075c22d3 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -1068,7 +1068,7 @@ UniValue cleanwallettransactions(const UniValue& params, bool fHelp) if ( out.nDepth > oldestTxDepth ) oldestTxDepth = out.nDepth; } - oldestTxDepth = oldestTxDepth + 1; // add extra block just for safety. + oldestTxDepth = oldestTxDepth + 1; // add extra 10 blocks just for safety. // then add all txs in the wallet before this block to the list to remove. for (map::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it) From 692de95bb7e1cfdc03c96b2118cc028254c8a2ac Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Wed, 21 Nov 2018 18:20:31 +0800 Subject: [PATCH 031/119] unlock locked utxo before fetching unspents, then relock them. --- src/wallet/rpcwallet.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index b075c22d3..00222f116 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -1058,6 +1058,11 @@ UniValue cleanwallettransactions(const UniValue& params, bool fHelp) } else { + // get all locked utxos to relock them later. + vector vLockedUTXO; + pwalletMain->ListLockedCoins(vLockedUTXO); + // unlock all coins so that the following call containes all utxos. + pwalletMain->UnlockAllCoins(); // listunspent call... this gets us all the txids that are unspent, we search this list for the oldest tx, vector vecOutputs; assert(pwalletMain != NULL); @@ -1068,7 +1073,11 @@ UniValue cleanwallettransactions(const UniValue& params, bool fHelp) if ( out.nDepth > oldestTxDepth ) oldestTxDepth = out.nDepth; } - oldestTxDepth = oldestTxDepth + 1; // add extra 10 blocks just for safety. + oldestTxDepth = oldestTxDepth + 1; // add extra block just for safety. + // lock all the previouly locked coins. + BOOST_FOREACH(COutPoint &outpt, vOutpts) { + pwalletMain->LockCoin(outpt); + } // then add all txs in the wallet before this block to the list to remove. for (map::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it) From 805ea3594f77cdcef7bba926268c09be8f5fe27f Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Wed, 21 Nov 2018 18:23:02 +0800 Subject: [PATCH 032/119] fix --- src/wallet/rpcwallet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 00222f116..ac64027d6 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -1075,7 +1075,7 @@ UniValue cleanwallettransactions(const UniValue& params, bool fHelp) } oldestTxDepth = oldestTxDepth + 1; // add extra block just for safety. // lock all the previouly locked coins. - BOOST_FOREACH(COutPoint &outpt, vOutpts) { + BOOST_FOREACH(COutPoint &outpt, vLockedUTXO) { pwalletMain->LockCoin(outpt); } From 677170d4e5436ce9bae992d74ea58a25a9787e61 Mon Sep 17 00:00:00 2001 From: ca333 Date: Sun, 25 Nov 2018 12:20:31 +0100 Subject: [PATCH 033/119] add gitlab CI conf --- .gitlab-ci.yml | 164 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 164 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 000000000..1bbf7a699 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,164 @@ +stages: +- build +- test +######################################################################################################################## +####START#### PROJECT LEVEL VARIABLES ####START#### +######################################################################################################################## +variables: + PACKAGE_DIR_LINUX: linux64 + PACKAGE_DIR_WINDOWS: win64 + PACKAGE_DIR_MACOS: macos + AGAMA_ARTIFACTS_LINUX: ${PACKAGE_DIR_LINUX}.tar.gz + AGAMA_ARTIFACTS_WINDOWS: ${PACKAGE_DIR_WINDOWS}.zip + AGAMA_ARTIFACTS_MACOS: ${PACKAGE_DIR_MACOS}.tar.gz + AGAMA_ARTIFACTS_LINUX_CHECKSUM: ${AGAMA_ARTIFACTS_LINUX}.md5 + AGAMA_ARTIFACTS_WINDOWS_CHECKSUM: ${AGAMA_ARTIFACTS_WINDOWS}.md5 + AGAMA_ARTIFACTS_MACOS_CHECKSUM: ${AGAMA_ARTIFACTS_MACOS}.md5 + ARTIFACT_EXPIRATION: 1 week + +######################################################################################################################## +####END#### PROJECT LEVEL VARIABLES ####END#### +######################################################################################################################## +######################################################################################################################## +######################################################################################################################## +####START#### Build Stage: compile and package komodo binaries for the Agama Wallet. ####START##### +######################################################################################################################## +######################################################################################################################## +####START#### LINUX ####START#### +######################################################################################################################## +build:ubuntu: + stage: build + image: ca333/komodo-builders:komodo-ubuntu + variables: + DOCKER_DRIVER: overlay2 + cache: + key: "${CI_JOB_NAME}${CI_COMMIT_REF_NAME}" + paths: + - depends/built + script: + - zcutil/build.sh -j$(nproc) + - mkdir ${PACKAGE_DIR_LINUX} + - cp src/komodod + src/komodo-cli + ${PACKAGE_DIR_LINUX} + - chmod +x ${PACKAGE_DIR_LINUX}/komodod + - chmod +x ${PACKAGE_DIR_LINUX}/komodo-cli + - tar -czvf ${AGAMA_ARTIFACTS_LINUX} ${PACKAGE_DIR_LINUX} + - md5sum ${AGAMA_ARTIFACTS_LINUX} > ${AGAMA_ARTIFACTS_LINUX_CHECKSUM} + artifacts: + paths: + - ${AGAMA_ARTIFACTS_LINUX} + - ${AGAMA_ARTIFACTS_LINUX_CHECKSUM} + expire_in: 1 week + +######################################################################################################################## +####END#### LINUX ####END#### +######################################################################################################################## +####START#### WINDOWS ####START#### +######################################################################################################################## +build:windows: + stage: build + image: ca333/komodo-builders:komodo-windows + variables: + DOCKER_DRIVER: overlay2 + cache: + key: "${CI_JOB_NAME}${CI_COMMIT_REF_NAME}" + paths: + - depends/built + script: + - zcutil/build-win.sh -j$(nproc) + - mkdir ${PACKAGE_DIR_WINDOWS} + - cp src/komodod.exe + src/komodo-cli.exe + src/komodo-tx.exe + ${PACKAGE_DIR_WINDOWS} + - zip -r ${PACKAGE_DIR_WINDOWS} + - md5sum ${AGAMA_ARTIFACTS_WINDOWS} > ${AGAMA_ARTIFACTS_WINDOWS_CHECKSUM} + artifacts: + paths: + - ${AGAMA_ARTIFACTS_WINDOWS} + - ${AGAMA_ARTIFACTS_WINDOWS_CHECKSUM} + expire_in: 1 week +######################################################################################################################## +####END#### WINDOWS ####END#### +######################################################################################################################## +####START#### MACOS ####START#### +######################################################################################################################## +build:macos: + stage: build + tags: ["High Sierra"] + cache: + key: "${CI_JOB_NAME}${CI_COMMIT_REF_NAME}" + paths: + - depends/built + script: + - zcutil/build-mac.sh -j$(sysctl -n hw.physicalcpu) + - ./makeRelease.sh ${PACKAGE_DIR_MACOS} + - tar -czvf ${AGAMA_ARTIFACTS_MACOS} ${PACKAGE_DIR_MACOS} + - md5sum ${AGAMA_ARTIFACTS_MACOS} > ${AGAMA_ARTIFACTS_MACOS_CHECKSUM} + artifacts: + paths: + - ${AGAMA_ARTIFACTS_MACOS} + - ${AGAMA_ARTIFACTS_MACOS_CHECKSUM} + expire_in: 1 week +######################################################################################################################## +####END#### MACOS ####END#### +######################################################################################################################## +######################################################################################################################## +####END#### Build Stage ####END#### +######################################################################################################################## +######################################################################################################################## +######################################################################################################################## +######################################################################################################################## +####START#### Test stage: Produce code quality and static application security test reports. ####START#### +######################################################################################################################## +######################################################################################################################## +######################################################################################################################## +####START#### Code Quality ####START#### +######################################################################################################################## +code_quality: + image: docker:stable + variables: + DOCKER_DRIVER: overlay2 + allow_failure: true + services: + - docker:stable-dind + script: + - export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/') + - docker run + --env SOURCE_CODE="$PWD" + --volume "$PWD":/code + --volume /var/run/docker.sock:/var/run/docker.sock + "registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code + artifacts: + paths: [gl-code-quality-report.json] +######################################################################################################################## +####END#### Code Quality ####END#### +######################################################################################################################## +######################################################################################################################## +####START#### Static Application Security Tests ####START#### +######################################################################################################################## +sast: + image: docker:stable + variables: + DOCKER_DRIVER: overlay2 + allow_failure: true + services: + - docker:stable-dind + script: + - export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/') + - docker run + --env SAST_CONFIDENCE_LEVEL="${SAST_CONFIDENCE_LEVEL:-3}" + --volume "$PWD:/code" + --volume /var/run/docker.sock:/var/run/docker.sock + "registry.gitlab.com/gitlab-org/security-products/sast:$SP_VERSION" /app/bin/run /code + artifacts: + paths: [gl-sast-report.json] +######################################################################################################################## +####END#### Static Application Security Tests ####END#### +######################################################################################################################## +######################################################################################################################## +######################################################################################################################## +####END#### Test stage ####END#### +######################################################################################################################## +######################################################################################################################## From f1fed89795a809ac84a84c2b42a45daa03394463 Mon Sep 17 00:00:00 2001 From: ca333 Date: Sun, 25 Nov 2018 13:31:53 +0100 Subject: [PATCH 034/119] fix CI zip archiver --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1bbf7a699..3ace05cb9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -72,7 +72,7 @@ build:windows: src/komodo-cli.exe src/komodo-tx.exe ${PACKAGE_DIR_WINDOWS} - - zip -r ${PACKAGE_DIR_WINDOWS} + - zip -r ${PACKAGE_DIR_WINDOWS}.zip ${PACKAGE_DIR_WINDOWS} - md5sum ${AGAMA_ARTIFACTS_WINDOWS} > ${AGAMA_ARTIFACTS_WINDOWS_CHECKSUM} artifacts: paths: From 7cb41a160528c0c6908b0989319da966eb42f4fa Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Thu, 29 Nov 2018 11:03:56 +0800 Subject: [PATCH 035/119] fix kmdice twice --- src/assetchains.json | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/assetchains.json b/src/assetchains.json index 43242ea42..09f7cdb96 100644 --- a/src/assetchains.json +++ b/src/assetchains.json @@ -177,18 +177,6 @@ "190.114.254.104" ] }, - { - "ac_name": "KMDICE", - "ac_supply": "10500000", - "ac_reward": "2500000000", - "ac_halving": "210000", - "ac_cc": "2", - "addressindex": "1", - "spentindex": "1", - "addnode": [ - "144.76.217.232" - ] - }, { "ac_name": "DION", "ac_supply": "3900000000", From d13edd721e72e691f4679a7f21a767a93df3ba0c Mon Sep 17 00:00:00 2001 From: ca333 Date: Sat, 8 Dec 2018 19:15:48 +0100 Subject: [PATCH 036/119] add changelog 0.3.0 --- doc/release-notes/release-notes-0.3.0.md | 58 ++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 doc/release-notes/release-notes-0.3.0.md diff --git a/doc/release-notes/release-notes-0.3.0.md b/doc/release-notes/release-notes-0.3.0.md new file mode 100644 index 000000000..84ffc8efb --- /dev/null +++ b/doc/release-notes/release-notes-0.3.0.md @@ -0,0 +1,58 @@ + +Komodo specific changelog: + +- add CC functionality and bugfixes +- set sapling activation +- change z-addr prefix byte +- blocksize increased from 2MB to 4 MB +- transaction size increased from 100KB to 200KB + +Sapling related changelog: + +- Decoupled Spend Authority +- Improved Performance for Shielded Transactions (using sapling instead of sprout) +- transaction format changed + +Alex Morcos (1): Output line to debug.log when IsInitialBlockDownload latches to false + +Ariel Gabizon (1): Extend Joinsplit tests to Groth + +Charlie OKeefe (1): Remove extra slash from lockfile path + +Cory Fields (1): crypter: shuffle Makefile so that crypto can be used by the wallet + +Daira Hopwood (1): Support testnet rollback. + +Daniel Cousens (2): move rpc* to rpc/ rpc: update inline comments to refer to new file paths + +Dimitris Apostolou (1): Fix typos + +Duke Leto (3): Fix absurd fee bug reported in #3281, with tests Update comment as per @arielgabizon Improve error message + +Eirik Ogilvie-Wigley (24): Add more options when asserting in RPC tests Add change indicator for notes Fix test broken by change indicator Rename note data to include sprout Remove redundant curly braces Consolidate for loops Add out point for sapling note data Add sapling note data and map Decrement sapling note witnesses Clear sapling witness cache Extract method for copying previous witnesses Extract methods for incrementing witnesses Extract method for incrementing witness heights Pass sapling merkle tree when incrementing witnesses Increment sapling note witnesses Rename sprout specific methods Remove extra indentation Add getter and setter for sapling note data and update tests Add parameter for version in GetValidReceive Rename Merkle Trees to include sprout or sapling Rename Witnesses to include sprout or sapling Rename test objects to include sprout or sapling Only include the change field if we have a spending key Fix assertion and comment + +Gregory Maxwell (2): IBD check uses minimumchain work instead of checkpoints. IsInitialBlockDownload no longer uses header-only timestamps. + +Jack Grigg (41): Add some more checkpoints, up to the 1.1.0 release Add Sapling support to z_validateaddress Update payment-api.md with type field of z_validateaddress Alter SaplingNote::nullifier() to take a SaplingFullViewingKey Expose note position in IncrementalMerkleWitness TransactionBuilder with support for creating Sapling-only transactions TransactionBuilder: Check that all anchors in a transaction are identical Formatting test: Move ECC_Start() call into src/gtest/main.cpp TransactionBuilder: Add support for transparent inputs and outputs TransactionBuilder: Add change output to transaction TransactionBuilder: Make fee configurable Rename xsk to expsk Implement CKeyStore::GetSaplingPaymentAddresses() Raise the 90-character limit on Bech32 encodings Add Sapling support to z_getnewaddress and z_listaddresses Fix block hash for checkpoint at height 270000 Formatting test: Deduplicate logic in wallet_addresses RPC test test: Another assert in wallet_zkeys_tests.store_and_load_sapling_zkeys test: Fix permissions of wallet_addresses test: Update rpc_wallet_z_importexport to account for Sapling changes Rename DecryptSpendingKey -> DecryptSproutSpendingKey Rename CryptedSpendingKeyMap -> CryptedSproutSpendingKeyMap Add Sapling decryption check to CCryptoKeyStore::Unlock() Check for unencrypted Sapling keys in CCryptoKeyStore::SetCrypted() Remove outdated comment Add CWallet::AddCryptedSaplingSpendingKey() hook Pass SaplingPaymentAddress to store through the CKeyStore Rename SpendingKeyMap -> SproutSpendingKeyMap Rename SerializedSize -> SerializedSproutSize Rename ViewingKey -> SproutViewingKey Formatting nits Rename *SpendingKey -> *SproutSpendingKey chainparams: Add BIP 44 coin type (as registered in SLIP 44) Upgrade Rust to 1.28.0 stable Adjust Makefile so that common can be used by the wallet Move RewindBlockIndex log message inside rewindLength check test: gtest for Sapling encoding and decoding test: Use regtest in key_tests/zs_address_test Disable Sapling features on mainnet + +Jay Graber (13): Add Sapling Add/Have/Get to keystore Add SaplingIncomingViewingKeys map, SaplingFullViewingKey methods Add StoreAndRetrieveSaplingSpendingKey test Change default_address to return SaplingPaymentAddr and not boost::optional Add crypted keystore sapling add key Discard sk if ivk == 0 Add Sapling support to z_exportkey Add Sapling support to z_importkey Add Sapling to rpc_wallet_z_importexport test Refactor into visitors and throw errors for invalid key or address. Take expiryheight as param to createrawtransaction Add Sapling have/get sk crypter overrides Add Sapling keys to CCryptoKeyStore::EncryptKeys + +Jonas Schnelli (2): [RPC, Wallet] Move RPC dispatch table registration to wallet/ code Fix test_bitcoin circular dependency issue + +Kaz Wesley (1): IsInitialBlockDownload: usually avoid locking + +Larry Ruane (4): Disable libsnark debug logging in Boost tests add extra help how to enable experimental features Add call to sync_all() after (z_sendmany, wait) don't ban peers when loading pre-overwinter blocks + +Pejvan (2): Update README.md Update README.md + +Richard Littauer (1): docs(LICENSE): update license year to 2018 + +Sean Bowe (21): Update librustzcash Implementation of Sapling in-band secret distribution. Swap types in OutputDescription to use new NoteEncryption interfaces. Prevent nonce reuse in Sapling note encryption API. Add get_esk() function to Sapling note encryption. Minor edits Decryption and tests of note/outgoing encryption. Update librustzcash and sapling-crypto. Fix bug in return value. Ensure sum of valueBalance and all vpub_new's does not exceed MAX_MONEY inside of CheckTransactionWithoutProofVerification. Move extern params to beginning of test_checktransaction. Relocate ECC_Start() to avoid test failures. Don't call ECC_Start/ECC_Stop outside the test harness. Make changes to gtest ECC behavior suggested by @str4d. Check the hash of the (Sapling+) zk-SNARK parameters during initialization. Switch to use the official Sapling parameters. make-release.py: Versioning changes for 2.0.0-rc1. make-release.py: Updated manpages for 2.0.0-rc1. make-release.py: Updated release notes and changelog for 2.0.0-rc1. Always write the empty root down as the best root, since we may roll back. Sapling mainnet activation height + +Simon Liu (11): Add encryption of SaplingNotePlaintext and SaplingOutgoingPlaintext classes. Update and fix per review comments, the test for absurd fee. Minor update to address nits in review. Implement Sapling note decryption using full viewing key. Rename AttemptSaplingEncDecryptionUsingFullViewingKey and use function overloading. Only check for a valid Sapling anchor after Sapling activation. Clean up for rebase: rename mapNoteData to mapSproutNoteData. Clean up help messages for RPC createrawtransaction. Add tests for expiryheight parameter of RPC createrawtransaction. make-release.py: Versioning changes for 2.0.0. make-release.py: Updated manpages for 2.0.0. + +Wladimir J. van der Laan (2): Make max tip age an option instead of chainparam rpc: Register calls where they are defined + +kozyilmaz (1): Add -Wl,-pie linker option for macOS and use it instead of -pie + +mdr0id (1): Fix minor references to auto-senescence in code From 6b2d9e254ce9730950c04c415688ec8b0da3568a Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Tue, 11 Dec 2018 07:27:15 +0800 Subject: [PATCH 037/119] remove, cleanwallettransactions --- src/rpc/server.cpp | 12 ++-- src/rpc/server.h | 2 +- src/wallet/rpcwallet.cpp | 133 +++++---------------------------------- 3 files changed, 23 insertions(+), 124 deletions(-) diff --git a/src/rpc/server.cpp b/src/rpc/server.cpp index b232e4802..99bc21f0d 100644 --- a/src/rpc/server.cpp +++ b/src/rpc/server.cpp @@ -364,16 +364,16 @@ static const CRPCCommand vRPCCommands[] = // auction { "auction", "auctionaddress", &auctionaddress, true }, - + // lotto { "lotto", "lottoaddress", &lottoaddress, true }, - + // fsm { "FSM", "FSMaddress", &FSMaddress, true }, { "FSM", "FSMcreate", &FSMcreate, true }, { "FSM", "FSMlist", &FSMlist, true }, { "FSM", "FSMinfo", &FSMinfo, true }, - + // rewards { "rewards", "rewardslist", &rewardslist, true }, { "rewards", "rewardsinfo", &rewardsinfo, true }, @@ -382,7 +382,7 @@ static const CRPCCommand vRPCCommands[] = { "rewards", "rewardslock", &rewardslock, true }, { "rewards", "rewardsunlock", &rewardsunlock, true }, { "rewards", "rewardsaddress", &rewardsaddress, true }, - + // faucet { "faucet", "faucetinfo", &faucetinfo, true }, { "faucet", "faucetfund", &faucetfund, true }, @@ -399,7 +399,7 @@ static const CRPCCommand vRPCCommands[] = { "channels", "channelspayment", &channelspayment, true }, { "channels", "channelsclose", &channelsclose, true }, { "channels", "channelsrefund", &channelsrefund, true }, - + // Oracles { "oracles", "oraclesaddress", &oraclesaddress, true }, { "oracles", "oracleslist", &oracleslist, true }, @@ -508,7 +508,7 @@ static const CRPCCommand vRPCCommands[] = { "wallet", "getaccountaddress", &getaccountaddress, true }, { "wallet", "getaccount", &getaccount, true }, { "wallet", "getaddressesbyaccount", &getaddressesbyaccount, true }, - { "wallet", "cleanwallettransactions", &cleanwallettransactions, false }, + { "wallet", "getbalance", &getbalance, false }, { "wallet", "getbalance64", &getbalance64, false }, { "wallet", "getnewaddress", &getnewaddress, true }, diff --git a/src/rpc/server.h b/src/rpc/server.h index 410c2e915..434df0a87 100644 --- a/src/rpc/server.h +++ b/src/rpc/server.h @@ -317,7 +317,7 @@ extern UniValue signmessage(const UniValue& params, bool fHelp); extern UniValue verifymessage(const UniValue& params, bool fHelp); extern UniValue getreceivedbyaddress(const UniValue& params, bool fHelp); extern UniValue getreceivedbyaccount(const UniValue& params, bool fHelp); -extern UniValue cleanwallettransactions(const UniValue& params, bool fHelp); + extern UniValue getbalance(const UniValue& params, bool fHelp); extern UniValue getbalance64(const UniValue& params, bool fHelp); extern UniValue getunconfirmedbalance(const UniValue& params, bool fHelp); diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 3143f9d08..e41c76ef6 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -1016,108 +1016,7 @@ CAmount GetAccountBalance(const string& strAccount, int nMinDepth, const isminef return GetAccountBalance(walletdb, strAccount, nMinDepth, filter); } -UniValue cleanwallettransactions(const UniValue& params, bool fHelp) -{ - if (!EnsureWalletIsAvailable(fHelp)) - return NullUniValue; - if (fHelp || params.size() > 1 ) - throw runtime_error( - "cleanwallettransactions \"txid\"\n" - "\nRemove all txs that are spent. You can clear all txs bar one, by specifiying a txid.\n" - "\nPlease backup your wallet.dat before running this command.\n" - "\nArguments:\n" - "1. \"txid\" (string, optional) The transaction id to keep.\n" - "\nResult:\n" - "{\n" - " \"total_transactons\" : n, (numeric) Transactions in wallet of " + strprintf("%s",komodo_chainname()) + "\n" - " \"remaining_transactons\" : n, (numeric) Transactions in wallet after clean.\n" - " \"removed_transactons\" : n, (numeric) The number of transactions removed.\n" - "}\n" - "\nExamples:\n" - + HelpExampleCli("cleanwallettransactions", "") - + HelpExampleCli("cleanwallettransactions","\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\"") - + HelpExampleRpc("cleanwallettransactions", "") - + HelpExampleRpc("cleanwallettransactions","\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\"") - ); - - LOCK2(cs_main, pwalletMain->cs_wallet); - UniValue ret(UniValue::VOBJ); - uint256 exception; int32_t txs = pwalletMain->mapWallet.size(); - std::vector TxToRemove; - if (params.size() == 1) - { - exception.SetHex(params[0].get_str()); - uint256 tmp_hash; CTransaction tmp_tx; - if (GetTransaction(exception,tmp_tx,tmp_hash,false)) - { - if ( !pwalletMain->IsMine(tmp_tx) ) - { - throw runtime_error("\nThe transaction is not yours!\n"); - } - else - { - for (map::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it) - { - const CWalletTx& wtx = (*it).second; - if ( wtx.GetHash() != exception ) - { - TxToRemove.push_back(wtx.GetHash()); - } - } - } - } - else - { - throw runtime_error("\nThe transaction could not be found!\n"); - } - } - else - { - // get all locked utxos to relock them later. - vector vLockedUTXO; - pwalletMain->ListLockedCoins(vLockedUTXO); - // unlock all coins so that the following call containes all utxos. - pwalletMain->UnlockAllCoins(); - // listunspent call... this gets us all the txids that are unspent, we search this list for the oldest tx, - vector vecOutputs; - assert(pwalletMain != NULL); - pwalletMain->AvailableCoins(vecOutputs, false, NULL, true); - int32_t oldestTxDepth = 0; - BOOST_FOREACH(const COutput& out, vecOutputs) - { - if ( out.nDepth > oldestTxDepth ) - oldestTxDepth = out.nDepth; - } - oldestTxDepth = oldestTxDepth + 1; // add extra block just for safety. - // lock all the previouly locked coins. - BOOST_FOREACH(COutPoint &outpt, vLockedUTXO) { - pwalletMain->LockCoin(outpt); - } - - // then add all txs in the wallet before this block to the list to remove. - for (map::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it) - { - const CWalletTx& wtx = (*it).second; - if (wtx.GetDepthInMainChain() > oldestTxDepth) - TxToRemove.push_back(wtx.GetHash()); - } - } - - // erase txs - BOOST_FOREACH (uint256& hash, TxToRemove) - { - pwalletMain->EraseFromWallet(hash); - LogPrintf("Erased %s from wallet.\n",hash.ToString().c_str()); - } - - // build return JSON for stats. - int remaining = pwalletMain->mapWallet.size(); - ret.push_back(Pair("total_transactons", (int)txs)); - ret.push_back(Pair("remaining_transactons", (int)remaining)); - ret.push_back(Pair("removed_transactions", (int)(txs-remaining))); - return (ret); -} UniValue getbalance(const UniValue& params, bool fHelp) { @@ -1776,7 +1675,7 @@ void ListTransactions(const CWalletTx& wtx, const string& strAccount, int nMinDe if(involvesWatchonly || (::IsMine(*pwalletMain, r.destination) & ISMINE_WATCH_ONLY)) entry.push_back(Pair("involvesWatchonly", true)); entry.push_back(Pair("account", account)); - + CTxDestination dest; if (CScriptExt::ExtractVoutDestination(wtx, r.vout, dest)) MaybePushAddress(entry, dest); @@ -3017,11 +2916,11 @@ UniValue z_listunspent(const UniValue& params, bool fHelp) // User did not provide zaddrs, so use default i.e. all addresses std::set sproutzaddrs = {}; pwalletMain->GetSproutPaymentAddresses(sproutzaddrs); - + // Sapling support std::set saplingzaddrs = {}; pwalletMain->GetSaplingPaymentAddresses(saplingzaddrs); - + zaddrs.insert(sproutzaddrs.begin(), sproutzaddrs.end()); zaddrs.insert(saplingzaddrs.begin(), saplingzaddrs.end()); } @@ -3033,7 +2932,7 @@ UniValue z_listunspent(const UniValue& params, bool fHelp) std::vector saplingEntries; pwalletMain->GetFilteredNotes(sproutEntries, saplingEntries, zaddrs, nMinDepth, nMaxDepth, true, !fIncludeWatchonly, false); std::set> nullifierSet = pwalletMain->GetNullifiersForAddresses(zaddrs); - + for (auto & entry : sproutEntries) { UniValue obj(UniValue::VOBJ); obj.push_back(Pair("txid", entry.jsop.hash.ToString())); @@ -3051,7 +2950,7 @@ UniValue z_listunspent(const UniValue& params, bool fHelp) } results.push_back(obj); } - + for (auto & entry : saplingEntries) { UniValue obj(UniValue::VOBJ); obj.push_back(Pair("txid", entry.op.hash.ToString())); @@ -6083,7 +5982,7 @@ UniValue gatewaysbind(const UniValue& params, bool fHelp) if ( params.size() < 6+i+1 ) throw runtime_error("not enough parameters for N pubkeys\n"); pubkey = ParseHex(params[6+i].get_str().c_str()); - if (pubkey.size()!= 33) + if (pubkey.size()!= 33) throw runtime_error("invalid destination pubkey"); pubkeys.push_back(pubkey2pk(pubkey)); } @@ -6117,8 +6016,8 @@ UniValue gatewaysdeposit(const UniValue& params, bool fHelp) amount = atof((char *)params[8].get_str().c_str()) * COIN + 0.00000000499999; if ( amount <= 0 || claimvout < 0 ) throw runtime_error("invalid param: amount, numpks or claimvout\n"); - if (destpub.size()!= 33) - throw runtime_error("invalid destination pubkey"); + if (destpub.size()!= 33) + throw runtime_error("invalid destination pubkey"); hex = GatewaysDeposit(0,bindtxid,height,coin,cointxid,claimvout,deposithex,proof,pubkey2pk(destpub),amount); RETURN_IF_ERROR(CCerror); @@ -6143,9 +6042,9 @@ UniValue gatewaysclaim(const UniValue& params, bool fHelp) coin = params[1].get_str(); deposittxid = Parseuint256((char *)params[2].get_str().c_str()); destpub = ParseHex(params[3].get_str()); - amount = atof((char *)params[4].get_str().c_str()) * COIN + 0.00000000499999; - if (destpub.size()!= 33) - throw runtime_error("invalid destination pubkey"); + amount = atof((char *)params[4].get_str().c_str()) * COIN + 0.00000000499999; + if (destpub.size()!= 33) + throw runtime_error("invalid destination pubkey"); hex = GatewaysClaim(0,bindtxid,coin,deposittxid,pubkey2pk(destpub),amount); RETURN_IF_ERROR(CCerror); if ( hex.size() > 0 ) @@ -6168,9 +6067,9 @@ UniValue gatewayswithdraw(const UniValue& params, bool fHelp) bindtxid = Parseuint256((char *)params[0].get_str().c_str()); coin = params[1].get_str(); withdrawpub = ParseHex(params[2].get_str()); - amount = atof((char *)params[3].get_str().c_str()) * COIN + 0.00000000499999; - if (withdrawpub.size()!= 33) - throw runtime_error("invalid destination pubkey"); + amount = atof((char *)params[3].get_str().c_str()) * COIN + 0.00000000499999; + if (withdrawpub.size()!= 33) + throw runtime_error("invalid destination pubkey"); hex = GatewaysWithdraw(0,bindtxid,coin,pubkey2pk(withdrawpub),amount); RETURN_IF_ERROR(CCerror); if ( hex.size() > 0 ) @@ -6189,7 +6088,7 @@ UniValue gatewayspartialsign(const UniValue& params, bool fHelp) if ( ensure_CCrequirements() < 0 ) throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n"); const CKeyStore& keystore = *pwalletMain; - LOCK2(cs_main, pwalletMain->cs_wallet); + LOCK2(cs_main, pwalletMain->cs_wallet); txid = Parseuint256((char *)params[0].get_str().c_str()); coin = params[1].get_str(); parthex = params[2].get_str(); @@ -6234,7 +6133,7 @@ UniValue gatewaysmarkdone(const UniValue& params, bool fHelp) const CKeyStore& keystore = *pwalletMain; LOCK2(cs_main, pwalletMain->cs_wallet); completetxid = Parseuint256((char *)params[0].get_str().c_str()); - coin = params[1].get_str(); + coin = params[1].get_str(); hex = GatewaysMarkDone(0,completetxid,coin); RETURN_IF_ERROR(CCerror); if ( hex.size() > 0 ) From 9452d0d77d1c69a30a37b8a6a2998b206fb94625 Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Tue, 11 Dec 2018 07:27:55 +0800 Subject: [PATCH 038/119] Add cleanwallettransactions RPC --- src/rpc/server.cpp | 2 +- src/rpc/server.h | 2 +- src/wallet/rpcwallet.cpp | 101 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 103 insertions(+), 2 deletions(-) diff --git a/src/rpc/server.cpp b/src/rpc/server.cpp index 99bc21f0d..938556f0f 100644 --- a/src/rpc/server.cpp +++ b/src/rpc/server.cpp @@ -508,7 +508,7 @@ static const CRPCCommand vRPCCommands[] = { "wallet", "getaccountaddress", &getaccountaddress, true }, { "wallet", "getaccount", &getaccount, true }, { "wallet", "getaddressesbyaccount", &getaddressesbyaccount, true }, - + { "wallet", "cleanwallettransactions", &cleanwallettransactions, false }, { "wallet", "getbalance", &getbalance, false }, { "wallet", "getbalance64", &getbalance64, false }, { "wallet", "getnewaddress", &getnewaddress, true }, diff --git a/src/rpc/server.h b/src/rpc/server.h index 434df0a87..410c2e915 100644 --- a/src/rpc/server.h +++ b/src/rpc/server.h @@ -317,7 +317,7 @@ extern UniValue signmessage(const UniValue& params, bool fHelp); extern UniValue verifymessage(const UniValue& params, bool fHelp); extern UniValue getreceivedbyaddress(const UniValue& params, bool fHelp); extern UniValue getreceivedbyaccount(const UniValue& params, bool fHelp); - +extern UniValue cleanwallettransactions(const UniValue& params, bool fHelp); extern UniValue getbalance(const UniValue& params, bool fHelp); extern UniValue getbalance64(const UniValue& params, bool fHelp); extern UniValue getunconfirmedbalance(const UniValue& params, bool fHelp); diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index e41c76ef6..742c21b1b 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -1016,7 +1016,108 @@ CAmount GetAccountBalance(const string& strAccount, int nMinDepth, const isminef return GetAccountBalance(walletdb, strAccount, nMinDepth, filter); } +UniValue cleanwallettransactions(const UniValue& params, bool fHelp) +{ + if (!EnsureWalletIsAvailable(fHelp)) + return NullUniValue; + if (fHelp || params.size() > 1 ) + throw runtime_error( + "cleanwallettransactions \"txid\"\n" + "\nRemove all txs that are spent. You can clear all txs bar one, by specifiying a txid.\n" + "\nPlease backup your wallet.dat before running this command.\n" + "\nArguments:\n" + "1. \"txid\" (string, optional) The transaction id to keep.\n" + "\nResult:\n" + "{\n" + " \"total_transactons\" : n, (numeric) Transactions in wallet of " + strprintf("%s",komodo_chainname()) + "\n" + " \"remaining_transactons\" : n, (numeric) Transactions in wallet after clean.\n" + " \"removed_transactons\" : n, (numeric) The number of transactions removed.\n" + "}\n" + "\nExamples:\n" + + HelpExampleCli("cleanwallettransactions", "") + + HelpExampleCli("cleanwallettransactions","\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\"") + + HelpExampleRpc("cleanwallettransactions", "") + + HelpExampleRpc("cleanwallettransactions","\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\"") + ); + + LOCK2(cs_main, pwalletMain->cs_wallet); + UniValue ret(UniValue::VOBJ); + uint256 exception; int32_t txs = pwalletMain->mapWallet.size(); + std::vector TxToRemove; + if (params.size() == 1) + { + exception.SetHex(params[0].get_str()); + uint256 tmp_hash; CTransaction tmp_tx; + if (GetTransaction(exception,tmp_tx,tmp_hash,false)) + { + if ( !pwalletMain->IsMine(tmp_tx) ) + { + throw runtime_error("\nThe transaction is not yours!\n"); + } + else + { + for (map::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it) + { + const CWalletTx& wtx = (*it).second; + if ( wtx.GetHash() != exception ) + { + TxToRemove.push_back(wtx.GetHash()); + } + } + } + } + else + { + throw runtime_error("\nThe transaction could not be found!\n"); + } + } + else + { + // get all locked utxos to relock them later. + vector vLockedUTXO; + pwalletMain->ListLockedCoins(vLockedUTXO); + // unlock all coins so that the following call containes all utxos. + pwalletMain->UnlockAllCoins(); + // listunspent call... this gets us all the txids that are unspent, we search this list for the oldest tx, + vector vecOutputs; + assert(pwalletMain != NULL); + pwalletMain->AvailableCoins(vecOutputs, false, NULL, true); + int32_t oldestTxDepth = 0; + BOOST_FOREACH(const COutput& out, vecOutputs) + { + if ( out.nDepth > oldestTxDepth ) + oldestTxDepth = out.nDepth; + } + oldestTxDepth = oldestTxDepth + 1; // add extra block just for safety. + // lock all the previouly locked coins. + BOOST_FOREACH(COutPoint &outpt, vLockedUTXO) { + pwalletMain->LockCoin(outpt); + } + + // then add all txs in the wallet before this block to the list to remove. + for (map::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it) + { + const CWalletTx& wtx = (*it).second; + if (wtx.GetDepthInMainChain() > oldestTxDepth) + TxToRemove.push_back(wtx.GetHash()); + } + } + + // erase txs + BOOST_FOREACH (uint256& hash, TxToRemove) + { + pwalletMain->EraseFromWallet(hash); + LogPrintf("Erased %s from wallet.\n",hash.ToString().c_str()); + } + + // build return JSON for stats. + int remaining = pwalletMain->mapWallet.size(); + ret.push_back(Pair("total_transactons", (int)txs)); + ret.push_back(Pair("remaining_transactons", (int)remaining)); + ret.push_back(Pair("removed_transactions", (int)(txs-remaining))); + return (ret); +} UniValue getbalance(const UniValue& params, bool fHelp) { From 45bbd04fb2741ff6cdc0e9a62a78002942eb040d Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Mon, 17 Dec 2018 12:34:40 +0800 Subject: [PATCH 039/119] cleanwallettransactions --- src/rpc/server.cpp | 11 +- src/rpc/server.h | 1 + src/wallet/rpcwallet.cpp | 226 ++++++++++++++++++++++++++++----------- 3 files changed, 171 insertions(+), 67 deletions(-) diff --git a/src/rpc/server.cpp b/src/rpc/server.cpp index 1b6856be5..938556f0f 100644 --- a/src/rpc/server.cpp +++ b/src/rpc/server.cpp @@ -364,16 +364,16 @@ static const CRPCCommand vRPCCommands[] = // auction { "auction", "auctionaddress", &auctionaddress, true }, - + // lotto { "lotto", "lottoaddress", &lottoaddress, true }, - + // fsm { "FSM", "FSMaddress", &FSMaddress, true }, { "FSM", "FSMcreate", &FSMcreate, true }, { "FSM", "FSMlist", &FSMlist, true }, { "FSM", "FSMinfo", &FSMinfo, true }, - + // rewards { "rewards", "rewardslist", &rewardslist, true }, { "rewards", "rewardsinfo", &rewardsinfo, true }, @@ -382,7 +382,7 @@ static const CRPCCommand vRPCCommands[] = { "rewards", "rewardslock", &rewardslock, true }, { "rewards", "rewardsunlock", &rewardsunlock, true }, { "rewards", "rewardsaddress", &rewardsaddress, true }, - + // faucet { "faucet", "faucetinfo", &faucetinfo, true }, { "faucet", "faucetfund", &faucetfund, true }, @@ -399,7 +399,7 @@ static const CRPCCommand vRPCCommands[] = { "channels", "channelspayment", &channelspayment, true }, { "channels", "channelsclose", &channelsclose, true }, { "channels", "channelsrefund", &channelsrefund, true }, - + // Oracles { "oracles", "oraclesaddress", &oraclesaddress, true }, { "oracles", "oracleslist", &oracleslist, true }, @@ -508,6 +508,7 @@ static const CRPCCommand vRPCCommands[] = { "wallet", "getaccountaddress", &getaccountaddress, true }, { "wallet", "getaccount", &getaccount, true }, { "wallet", "getaddressesbyaccount", &getaddressesbyaccount, true }, + { "wallet", "cleanwallettransactions", &cleanwallettransactions, false }, { "wallet", "getbalance", &getbalance, false }, { "wallet", "getbalance64", &getbalance64, false }, { "wallet", "getnewaddress", &getnewaddress, true }, diff --git a/src/rpc/server.h b/src/rpc/server.h index 6638024b8..410c2e915 100644 --- a/src/rpc/server.h +++ b/src/rpc/server.h @@ -317,6 +317,7 @@ extern UniValue signmessage(const UniValue& params, bool fHelp); extern UniValue verifymessage(const UniValue& params, bool fHelp); extern UniValue getreceivedbyaddress(const UniValue& params, bool fHelp); extern UniValue getreceivedbyaccount(const UniValue& params, bool fHelp); +extern UniValue cleanwallettransactions(const UniValue& params, bool fHelp); extern UniValue getbalance(const UniValue& params, bool fHelp); extern UniValue getbalance64(const UniValue& params, bool fHelp); extern UniValue getunconfirmedbalance(const UniValue& params, bool fHelp); diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index f8b507403..bd81c950d 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -1015,6 +1015,108 @@ CAmount GetAccountBalance(const string& strAccount, int nMinDepth, const isminef return GetAccountBalance(walletdb, strAccount, nMinDepth, filter); } +UniValue cleanwallettransactions(const UniValue& params, bool fHelp) +{ + if (!EnsureWalletIsAvailable(fHelp)) + return NullUniValue; + + if (fHelp || params.size() > 1 ) + throw runtime_error( + "cleanwallettransactions \"txid\"\n" + "\nRemove all txs that are spent. You can clear all txs bar one, by specifiying a txid.\n" + "\nPlease backup your wallet.dat before running this command.\n" + "\nArguments:\n" + "1. \"txid\" (string, optional) The transaction id to keep.\n" + "\nResult:\n" + "{\n" + " \"total_transactons\" : n, (numeric) Transactions in wallet of " + strprintf("%s",komodo_chainname()) + "\n" + " \"remaining_transactons\" : n, (numeric) Transactions in wallet after clean.\n" + " \"removed_transactons\" : n, (numeric) The number of transactions removed.\n" + "}\n" + "\nExamples:\n" + + HelpExampleCli("cleanwallettransactions", "") + + HelpExampleCli("cleanwallettransactions","\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\"") + + HelpExampleRpc("cleanwallettransactions", "") + + HelpExampleRpc("cleanwallettransactions","\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\"") + ); + + LOCK2(cs_main, pwalletMain->cs_wallet); + UniValue ret(UniValue::VOBJ); + uint256 exception; int32_t txs = pwalletMain->mapWallet.size(); + std::vector TxToRemove; + if (params.size() == 1) + { + exception.SetHex(params[0].get_str()); + uint256 tmp_hash; CTransaction tmp_tx; + if (GetTransaction(exception,tmp_tx,tmp_hash,false)) + { + if ( !pwalletMain->IsMine(tmp_tx) ) + { + throw runtime_error("\nThe transaction is not yours!\n"); + } + else + { + for (map::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it) + { + const CWalletTx& wtx = (*it).second; + if ( wtx.GetHash() != exception ) + { + TxToRemove.push_back(wtx.GetHash()); + } + } + } + } + else + { + throw runtime_error("\nThe transaction could not be found!\n"); + } + } + else + { + // get all locked utxos to relock them later. + vector vLockedUTXO; + pwalletMain->ListLockedCoins(vLockedUTXO); + // unlock all coins so that the following call containes all utxos. + pwalletMain->UnlockAllCoins(); + // listunspent call... this gets us all the txids that are unspent, we search this list for the oldest tx, + vector vecOutputs; + assert(pwalletMain != NULL); + pwalletMain->AvailableCoins(vecOutputs, false, NULL, true); + int32_t oldestTxDepth = 0; + BOOST_FOREACH(const COutput& out, vecOutputs) + { + if ( out.nDepth > oldestTxDepth ) + oldestTxDepth = out.nDepth; + } + oldestTxDepth = oldestTxDepth + 1; // add extra block just for safety. + // lock all the previouly locked coins. + BOOST_FOREACH(COutPoint &outpt, vLockedUTXO) { + pwalletMain->LockCoin(outpt); + } + + // then add all txs in the wallet before this block to the list to remove. + for (map::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it) + { + const CWalletTx& wtx = (*it).second; + if (wtx.GetDepthInMainChain() > oldestTxDepth) + TxToRemove.push_back(wtx.GetHash()); + } + } + + // erase txs + BOOST_FOREACH (uint256& hash, TxToRemove) + { + pwalletMain->EraseFromWallet(hash); + LogPrintf("Erased %s from wallet.\n",hash.ToString().c_str()); + } + + // build return JSON for stats. + int remaining = pwalletMain->mapWallet.size(); + ret.push_back(Pair("total_transactons", (int)txs)); + ret.push_back(Pair("remaining_transactons", (int)remaining)); + ret.push_back(Pair("removed_transactions", (int)(txs-remaining))); + return (ret); +} UniValue getbalance(const UniValue& params, bool fHelp) { @@ -1674,7 +1776,7 @@ void ListTransactions(const CWalletTx& wtx, const string& strAccount, int nMinDe if(involvesWatchonly || (::IsMine(*pwalletMain, r.destination) & ISMINE_WATCH_ONLY)) entry.push_back(Pair("involvesWatchonly", true)); entry.push_back(Pair("account", account)); - + CTxDestination dest; if (CScriptExt::ExtractVoutDestination(wtx, r.vout, dest)) MaybePushAddress(entry, dest); @@ -2920,11 +3022,11 @@ UniValue z_listunspent(const UniValue& params, bool fHelp) // User did not provide zaddrs, so use default i.e. all addresses std::set sproutzaddrs = {}; pwalletMain->GetSproutPaymentAddresses(sproutzaddrs); - + // Sapling support std::set saplingzaddrs = {}; pwalletMain->GetSaplingPaymentAddresses(saplingzaddrs); - + zaddrs.insert(sproutzaddrs.begin(), sproutzaddrs.end()); zaddrs.insert(saplingzaddrs.begin(), saplingzaddrs.end()); } @@ -2936,7 +3038,7 @@ UniValue z_listunspent(const UniValue& params, bool fHelp) std::vector saplingEntries; pwalletMain->GetFilteredNotes(sproutEntries, saplingEntries, zaddrs, nMinDepth, nMaxDepth, true, !fIncludeWatchonly, false); std::set> nullifierSet = pwalletMain->GetNullifiersForAddresses(zaddrs); - + for (auto & entry : sproutEntries) { UniValue obj(UniValue::VOBJ); obj.push_back(Pair("txid", entry.jsop.hash.ToString())); @@ -2954,7 +3056,7 @@ UniValue z_listunspent(const UniValue& params, bool fHelp) } results.push_back(obj); } - + for (auto & entry : saplingEntries) { UniValue obj(UniValue::VOBJ); obj.push_back(Pair("txid", entry.op.hash.ToString())); @@ -4115,7 +4217,7 @@ UniValue z_sendmany(const UniValue& params, bool fHelp) } if ( toSapling && ASSETCHAINS_SYMBOL[0] == 0 ) throw JSONRPCError(RPC_INVALID_PARAMETER,"Sprout usage will expire soon"); - + // If we are sending from a shielded address, all recipient // shielded addresses must be of the same type. if ((fromSprout && toSapling) || (fromSapling && toSprout)) { @@ -4534,14 +4636,14 @@ UniValue z_mergetoaddress(const UniValue& params, bool fHelp) { if (!EnsureWalletIsAvailable(fHelp)) return NullUniValue; - + string enableArg = "zmergetoaddress"; auto fEnableMergeToAddress = fExperimentalMode && GetBoolArg("-" + enableArg, true); std::string strDisabledMsg = ""; if (!fEnableMergeToAddress) { strDisabledMsg = experimentalDisabledHelpMsg("z_mergetoaddress", enableArg); } - + if (fHelp || params.size() < 2 || params.size() > 6) throw runtime_error( "z_mergetoaddress [\"fromaddress\", ... ] \"toaddress\" ( fee ) ( transparent_limit ) ( shielded_limit ) ( memo )\n" @@ -4590,33 +4692,33 @@ UniValue z_mergetoaddress(const UniValue& params, bool fHelp) + HelpExampleCli("z_mergetoaddress", "'[\"RD6GgnrMpPaTSMn8vai6yiGA7mN4QGPV\"]' ztfaW34Gj9FrnGUEf833ywDVL62NWXBM81u6EQnM6VR45eYnXhwztecW1SjxA7JrmAXKJhxhj3vDNEpVCQoSvVoSpmbhtjf") + HelpExampleRpc("z_mergetoaddress", "[\"RD6GgnrMpPaTSMn8vai6yiGA7mN4QGPV\"], \"zs14d8tc0hl9q0vg5l28uec5vk6sk34fkj2n8s7jalvw5fxpy6v39yn4s2ga082lymrkjk0x2nqg37\"") ); - + if (!fEnableMergeToAddress) { throw JSONRPCError(RPC_WALLET_ERROR, "Error: z_mergetoaddress is disabled."); } - + LOCK2(cs_main, pwalletMain->cs_wallet); - + bool useAnyUTXO = false; bool useAnySprout = false; bool useAnySapling = false; std::set taddrs = {}; std::set zaddrs = {}; - + UniValue addresses = params[0].get_array(); if (addresses.size()==0) throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter, fromaddresses array is empty."); - + // Keep track of addresses to spot duplicates std::set setAddress; - + // Sources for (const UniValue& o : addresses.getValues()) { if (!o.isStr()) throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter, expected string"); - + std::string address = o.get_str(); - + if (address == "ANY_TADDR") { useAnyUTXO = true; } else if (address == "ANY_SPROUT") { @@ -4636,23 +4738,23 @@ UniValue z_mergetoaddress(const UniValue& params, bool fHelp) } } } - + if (setAddress.count(address)) throw JSONRPCError(RPC_INVALID_PARAMETER, string("Invalid parameter, duplicated address: ") + address); setAddress.insert(address); } - + if (useAnyUTXO && taddrs.size() > 0) { throw JSONRPCError(RPC_INVALID_PARAMETER, "Cannot specify specific t-addrs when using \"ANY_TADDR\""); } if ((useAnySprout || useAnySapling) && zaddrs.size() > 0) { throw JSONRPCError(RPC_INVALID_PARAMETER, "Cannot specify specific z-addrs when using \"ANY_SPROUT\" or \"ANY_SAPLING\""); } - + const int nextBlockHeight = chainActive.Height() + 1; const bool overwinterActive = NetworkUpgradeActive(nextBlockHeight, Params().GetConsensus(), Consensus::UPGRADE_OVERWINTER); const bool saplingActive = NetworkUpgradeActive(nextBlockHeight, Params().GetConsensus(), Consensus::UPGRADE_SAPLING); - + // Validate the destination address auto destaddress = params[1].get_str(); bool isToSproutZaddr = false; @@ -4674,7 +4776,7 @@ UniValue z_mergetoaddress(const UniValue& params, bool fHelp) throw JSONRPCError(RPC_INVALID_PARAMETER, string("Invalid parameter, unknown address format: ") + destaddress ); } } - + // Convert fee from currency format to zatoshis CAmount nFee = SHIELD_COINBASE_DEFAULT_MINERS_FEE; if (params.size() > 2) { @@ -4684,7 +4786,7 @@ UniValue z_mergetoaddress(const UniValue& params, bool fHelp) nFee = AmountFromValue( params[2] ); } } - + int nUTXOLimit = MERGE_TO_ADDRESS_DEFAULT_TRANSPARENT_LIMIT; if (params.size() > 3) { nUTXOLimit = params[3].get_int(); @@ -4692,7 +4794,7 @@ UniValue z_mergetoaddress(const UniValue& params, bool fHelp) throw JSONRPCError(RPC_INVALID_PARAMETER, "Limit on maximum number of UTXOs cannot be negative"); } } - + int sproutNoteLimit = MERGE_TO_ADDRESS_DEFAULT_SPROUT_LIMIT; int saplingNoteLimit = MERGE_TO_ADDRESS_DEFAULT_SAPLING_LIMIT; if (params.size() > 4) { @@ -4703,7 +4805,7 @@ UniValue z_mergetoaddress(const UniValue& params, bool fHelp) sproutNoteLimit = nNoteLimit; saplingNoteLimit = nNoteLimit; } - + std::string memo; if (params.size() > 5) { memo = params[5].get_str(); @@ -4716,9 +4818,9 @@ UniValue z_mergetoaddress(const UniValue& params, bool fHelp) throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Invalid parameter, size of memo is larger than maximum allowed %d", ZC_MEMO_SIZE )); } } - + MergeToAddressRecipient recipient(destaddress, memo); - + // Prepare to get UTXOs and notes std::vector utxoInputs; std::vector sproutNoteInputs; @@ -4732,7 +4834,7 @@ UniValue z_mergetoaddress(const UniValue& params, bool fHelp) bool maxedOutUTXOsFlag = false; bool maxedOutNotesFlag = false; size_t mempoolLimit = (nUTXOLimit != 0) ? nUTXOLimit : (overwinterActive ? 0 : (size_t)GetArg("-mempooltxinputlimit", 0)); - + unsigned int max_tx_size = saplingActive ? MAX_TX_SIZE_AFTER_SAPLING : MAX_TX_SIZE_BEFORE_SAPLING; size_t estimatedTxSize = 200; // tx overhead + wiggle room if (isToSproutZaddr) { @@ -4740,20 +4842,20 @@ UniValue z_mergetoaddress(const UniValue& params, bool fHelp) } else if (isToSaplingZaddr) { estimatedTxSize += OUTPUTDESCRIPTION_SIZE; } - + if (useAnyUTXO || taddrs.size() > 0) { // Get available utxos vector vecOutputs; pwalletMain->AvailableCoins(vecOutputs, true, NULL, false, false); - + // Find unspent utxos and update estimated size for (const COutput& out : vecOutputs) { if (!out.fSpendable) { continue; } - + CScript scriptPubKey = out.tx->vout[out.i].scriptPubKey; - + CTxDestination address; if (!ExtractDestination(scriptPubKey, address)) { continue; @@ -4762,10 +4864,10 @@ UniValue z_mergetoaddress(const UniValue& params, bool fHelp) if (taddrs.size() > 0 && !taddrs.count(address)) { continue; } - + utxoCounter++; CAmount nValue = out.tx->vout[out.i].nValue; - + if (!maxedOutUTXOsFlag) { size_t increase = (boost::get(&address) != nullptr) ? CTXIN_SPEND_P2SH_SIZE : CTXIN_SPEND_DUST_SIZE; if (estimatedTxSize + increase >= max_tx_size || @@ -4779,19 +4881,19 @@ UniValue z_mergetoaddress(const UniValue& params, bool fHelp) mergedUTXOValue += nValue; } } - + if (maxedOutUTXOsFlag) { remainingUTXOValue += nValue; } } } - + if (useAnySprout || useAnySapling || zaddrs.size() > 0) { // Get available notes std::vector sproutEntries; std::vector saplingEntries; pwalletMain->GetFilteredNotes(sproutEntries, saplingEntries, zaddrs); - + // If Sapling is not active, do not allow sending from a sapling addresses. if (!saplingActive && saplingEntries.size() > 0) { throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter, Sapling has not activated"); @@ -4808,12 +4910,12 @@ UniValue z_mergetoaddress(const UniValue& params, bool fHelp) RPC_INVALID_PARAMETER, "Cannot send between Sprout and Sapling addresses using z_mergetoaddress"); } - + // Find unspent notes and update estimated size for (const CSproutNotePlaintextEntry& entry : sproutEntries) { noteCounter++; CAmount nValue = entry.plaintext.value(); - + if (!maxedOutNotesFlag) { // If we haven't added any notes yet and the merge is to a // z-address, we have already accounted for the first JoinSplit. @@ -4831,12 +4933,12 @@ UniValue z_mergetoaddress(const UniValue& params, bool fHelp) mergedNoteValue += nValue; } } - + if (maxedOutNotesFlag) { remainingNoteValue += nValue; } } - + for (const SaplingNoteEntry& entry : saplingEntries) { noteCounter++; CAmount nValue = entry.note.value(); @@ -4856,20 +4958,20 @@ UniValue z_mergetoaddress(const UniValue& params, bool fHelp) mergedNoteValue += nValue; } } - + if (maxedOutNotesFlag) { remainingNoteValue += nValue; } } } - + size_t numUtxos = utxoInputs.size(); size_t numNotes = sproutNoteInputs.size() + saplingNoteInputs.size(); - + if (numUtxos == 0 && numNotes == 0) { throw JSONRPCError(RPC_WALLET_INSUFFICIENT_FUNDS, "Could not find any funds to merge."); } - + // Sanity check: Don't do anything if: // - We only have one from address // - It's equal to toaddress @@ -4877,26 +4979,26 @@ UniValue z_mergetoaddress(const UniValue& params, bool fHelp) if (setAddress.size() == 1 && setAddress.count(destaddress) && (numUtxos + numNotes) == 1) { throw JSONRPCError(RPC_INVALID_PARAMETER, "Destination address is also the only source address, and all its funds are already merged."); } - + CAmount mergedValue = mergedUTXOValue + mergedNoteValue; if (mergedValue < nFee) { throw JSONRPCError(RPC_WALLET_INSUFFICIENT_FUNDS, strprintf("Insufficient funds, have %s, which is less than miners fee %s", FormatMoney(mergedValue), FormatMoney(nFee))); } - + // Check that the user specified fee is sane (if too high, it can result in error -25 absurd fee) CAmount netAmount = mergedValue - nFee; if (nFee > netAmount) { throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Fee %s is greater than the net amount to be shielded %s", FormatMoney(nFee), FormatMoney(netAmount))); } - + // Keep record of parameters in context object UniValue contextInfo(UniValue::VOBJ); contextInfo.push_back(Pair("fromaddresses", params[0])); contextInfo.push_back(Pair("toaddress", params[1])); contextInfo.push_back(Pair("fee", ValueFromAmount(nFee))); - + // Contextual transaction we will build on CMutableTransaction contextualTx = CreateNewContextualCMutableTransaction( Params().GetConsensus(), @@ -4905,7 +5007,7 @@ UniValue z_mergetoaddress(const UniValue& params, bool fHelp) if (contextualTx.nVersion == 1 && isSproutShielded) { contextualTx.nVersion = 2; // Tx format should support vjoinsplit } - + // Builder (used if Sapling addresses are involved) boost::optional builder; if (isToSaplingZaddr || saplingNoteInputs.size() > 0) { @@ -4917,7 +5019,7 @@ UniValue z_mergetoaddress(const UniValue& params, bool fHelp) new AsyncRPCOperation_mergetoaddress(builder, contextualTx, utxoInputs, sproutNoteInputs, saplingNoteInputs, recipient, nFee, contextInfo) ); q->addOperation(operation); AsyncRPCOperationId operationId = operation->getId(); - + // Return continuation information UniValue o(UniValue::VOBJ); o.push_back(Pair("remainingUTXOs", static_cast(utxoCounter - numUtxos))); @@ -6018,7 +6120,7 @@ UniValue gatewaysbind(const UniValue& params, bool fHelp) if ( params.size() < 6+i+1 ) throw runtime_error("not enough parameters for N pubkeys\n"); pubkey = ParseHex(params[6+i].get_str().c_str()); - if (pubkey.size()!= 33) + if (pubkey.size()!= 33) throw runtime_error("invalid destination pubkey"); pubkeys.push_back(pubkey2pk(pubkey)); } @@ -6052,8 +6154,8 @@ UniValue gatewaysdeposit(const UniValue& params, bool fHelp) amount = atof((char *)params[8].get_str().c_str()) * COIN + 0.00000000499999; if ( amount <= 0 || claimvout < 0 ) throw runtime_error("invalid param: amount, numpks or claimvout\n"); - if (destpub.size()!= 33) - throw runtime_error("invalid destination pubkey"); + if (destpub.size()!= 33) + throw runtime_error("invalid destination pubkey"); hex = GatewaysDeposit(0,bindtxid,height,coin,cointxid,claimvout,deposithex,proof,pubkey2pk(destpub),amount); RETURN_IF_ERROR(CCerror); @@ -6078,9 +6180,9 @@ UniValue gatewaysclaim(const UniValue& params, bool fHelp) coin = params[1].get_str(); deposittxid = Parseuint256((char *)params[2].get_str().c_str()); destpub = ParseHex(params[3].get_str()); - amount = atof((char *)params[4].get_str().c_str()) * COIN + 0.00000000499999; - if (destpub.size()!= 33) - throw runtime_error("invalid destination pubkey"); + amount = atof((char *)params[4].get_str().c_str()) * COIN + 0.00000000499999; + if (destpub.size()!= 33) + throw runtime_error("invalid destination pubkey"); hex = GatewaysClaim(0,bindtxid,coin,deposittxid,pubkey2pk(destpub),amount); RETURN_IF_ERROR(CCerror); if ( hex.size() > 0 ) @@ -6103,9 +6205,9 @@ UniValue gatewayswithdraw(const UniValue& params, bool fHelp) bindtxid = Parseuint256((char *)params[0].get_str().c_str()); coin = params[1].get_str(); withdrawpub = ParseHex(params[2].get_str()); - amount = atof((char *)params[3].get_str().c_str()) * COIN + 0.00000000499999; - if (withdrawpub.size()!= 33) - throw runtime_error("invalid destination pubkey"); + amount = atof((char *)params[3].get_str().c_str()) * COIN + 0.00000000499999; + if (withdrawpub.size()!= 33) + throw runtime_error("invalid destination pubkey"); hex = GatewaysWithdraw(0,bindtxid,coin,pubkey2pk(withdrawpub),amount); RETURN_IF_ERROR(CCerror); if ( hex.size() > 0 ) @@ -6124,7 +6226,7 @@ UniValue gatewayspartialsign(const UniValue& params, bool fHelp) if ( ensure_CCrequirements() < 0 ) throw runtime_error("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet\n"); const CKeyStore& keystore = *pwalletMain; - LOCK2(cs_main, pwalletMain->cs_wallet); + LOCK2(cs_main, pwalletMain->cs_wallet); txid = Parseuint256((char *)params[0].get_str().c_str()); coin = params[1].get_str(); parthex = params[2].get_str(); @@ -6169,7 +6271,7 @@ UniValue gatewaysmarkdone(const UniValue& params, bool fHelp) const CKeyStore& keystore = *pwalletMain; LOCK2(cs_main, pwalletMain->cs_wallet); completetxid = Parseuint256((char *)params[0].get_str().c_str()); - coin = params[1].get_str(); + coin = params[1].get_str(); hex = GatewaysMarkDone(0,completetxid,coin); RETURN_IF_ERROR(CCerror); if ( hex.size() > 0 ) @@ -7173,7 +7275,7 @@ UniValue tokenfillask(const UniValue& params, bool fHelp) LOCK2(cs_main, pwalletMain->cs_wallet); tokenid = Parseuint256((char *)params[0].get_str().c_str()); asktxid = Parseuint256((char *)params[1].get_str().c_str()); - //fillunits = atol(params[2].get_str().c_str()); + //fillunits = atol(params[2].get_str().c_str()); fillunits = atoll(params[2].get_str().c_str()); // dimxy changed to prevent loss of significance if ( fillunits <= 0 ) { From 6decb5e22bfcd1806087d44af980e38535d2962c Mon Sep 17 00:00:00 2001 From: ca333 Date: Mon, 7 Jan 2019 19:06:21 +0100 Subject: [PATCH 040/119] update libsodium url fix broken path --- depends/packages/libsodium.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depends/packages/libsodium.mk b/depends/packages/libsodium.mk index 67e096fae..76f0d9a28 100644 --- a/depends/packages/libsodium.mk +++ b/depends/packages/libsodium.mk @@ -9,7 +9,7 @@ $(package)_config_opts= else package=libsodium $(package)_version=1.0.15 -$(package)_download_path=https://download.libsodium.org/libsodium/releases +$(package)_download_path=https://download.libsodium.org/libsodium/releases/old $(package)_file_name=$(package)-$($(package)_version).tar.gz $(package)_sha256_hash=fb6a9e879a2f674592e4328c5d9f79f082405ee4bb05cb6e679b90afe9e178f4 $(package)_dependencies= From 449fa23bb4d1f40f1a1b4f1c2f54da347da9b506 Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Tue, 8 Jan 2019 15:58:10 +0800 Subject: [PATCH 041/119] Disable BTC txid checks on parse of statefile. For @lukechilds. --- src/komodo_bitcoind.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index c6eb05324..4b104646f 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -449,7 +449,7 @@ int32_t komodo_verifynotarization(char *symbol,char *dest,int32_t height,int32_t } else if ( strcmp(dest,"BTC") == 0 ) { - if ( BTCUSERPASS[0] != 0 ) + if ( BTCUSERPASS[0] != 0 && KOMODO_PASSPORT_INITDONE == 1 ) { //printf("BTCUSERPASS.(%s)\n",BTCUSERPASS); jsonstr = komodo_issuemethod(BTCUSERPASS,(char *)"getrawtransaction",params,8332); From df2b40b9d091d0bc63c09a3fa1f7477ffbac7818 Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Tue, 8 Jan 2019 16:09:50 +0800 Subject: [PATCH 042/119] revert that change for myself. --- src/komodo_bitcoind.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index 4b104646f..c6eb05324 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -449,7 +449,7 @@ int32_t komodo_verifynotarization(char *symbol,char *dest,int32_t height,int32_t } else if ( strcmp(dest,"BTC") == 0 ) { - if ( BTCUSERPASS[0] != 0 && KOMODO_PASSPORT_INITDONE == 1 ) + if ( BTCUSERPASS[0] != 0 ) { //printf("BTCUSERPASS.(%s)\n",BTCUSERPASS); jsonstr = komodo_issuemethod(BTCUSERPASS,(char *)"getrawtransaction",params,8332); From 775c57ce46af5a9512440e4e8a0ab530b2e0f268 Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Thu, 10 Jan 2019 12:36:43 +0800 Subject: [PATCH 043/119] Possible fix for miner crashing on OnDemand Blocks --- src/miner.cpp | 445 +++++++++++++++++++++++++------------------------- 1 file changed, 224 insertions(+), 221 deletions(-) diff --git a/src/miner.cpp b/src/miner.cpp index cd79ea6b8..d504a2456 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -212,268 +212,265 @@ CBlockTemplate* CreateNewBlock(const CScript& _scriptPubKeyIn, int32_t gpucount, // we will attempt to spend any cheats we see CTransaction cheatTx; boost::optional cheatSpend; - uint256 cbHash; + uint256 cbHash; - SaplingMerkleTree sapling_tree; uint64_t commission; - int nHeight = 0; - const Consensus::Params &consensusParams = chainparams.GetConsensus(); - - CBlockIndex* pindexPrev = chainActive.LastTip();; + CBlockIndex* pindexPrev = 0; { - { // contain lock to block generation and not staking loops. - LOCK2(cs_main, mempool.cs); - nHeight = pindexPrev->GetHeight() + 1; - uint32_t consensusBranchId = CurrentEpochBranchId(nHeight, consensusParams); - bool sapling = NetworkUpgradeActive(nHeight, consensusParams, Consensus::UPGRADE_SAPLING); + ENTER_CRITICAL_SECTION(cs_main); + ENTER_CRITICAL_SECTION(mempool.cs); + pindexPrev = chainActive.LastTip(); + const int nHeight = pindexPrev->GetHeight() + 1; + const Consensus::Params &consensusParams = chainparams.GetConsensus(); + uint32_t consensusBranchId = CurrentEpochBranchId(nHeight, consensusParams); + bool sapling = NetworkUpgradeActive(nHeight, consensusParams, Consensus::UPGRADE_SAPLING); - const int64_t nMedianTimePast = pindexPrev->GetMedianTimePast(); - uint32_t proposedTime = GetAdjustedTime(); - if (proposedTime == nMedianTimePast) + const int64_t nMedianTimePast = pindexPrev->GetMedianTimePast(); + uint32_t proposedTime = GetAdjustedTime(); + if (proposedTime == nMedianTimePast) + { + // too fast or stuck, this addresses the too fast issue, while moving + // forward as quickly as possible + for (int i; i < 100; i++) { - // too fast or stuck, this addresses the too fast issue, while moving - // forward as quickly as possible - for (int i; i < 100; i++) - { - proposedTime = GetAdjustedTime(); - if (proposedTime == nMedianTimePast) - MilliSleep(10); - } + proposedTime = GetAdjustedTime(); + if (proposedTime == nMedianTimePast) + MilliSleep(10); } - pblock->nTime = GetAdjustedTime(); + } + pblock->nTime = GetAdjustedTime(); - CCoinsViewCache view(pcoinsTip); - uint32_t expired; + CCoinsViewCache view(pcoinsTip); + uint32_t expired; uint64_t commission; + + SaplingMerkleTree sapling_tree; uint64_t commission; + assert(view.GetSaplingAnchorAt(view.GetBestAnchor(SAPLING), sapling_tree)); - assert(view.GetSaplingAnchorAt(view.GetBestAnchor(SAPLING), sapling_tree)); + // Priority order to process transactions + list vOrphan; // list memory doesn't move + map > mapDependers; + bool fPrintPriority = GetBoolArg("-printpriority", false); - // Priority order to process transactions - list vOrphan; // list memory doesn't move - map > mapDependers; - bool fPrintPriority = GetBoolArg("-printpriority", false); + // This vector will be sorted into a priority queue: + vector vecPriority; + vecPriority.reserve(mempool.mapTx.size() + 1); - // This vector will be sorted into a priority queue: - vector vecPriority; - vecPriority.reserve(mempool.mapTx.size() + 1); + // now add transactions from the mem pool + for (CTxMemPool::indexed_transaction_set::iterator mi = mempool.mapTx.begin(); + mi != mempool.mapTx.end(); ++mi) + { + const CTransaction& tx = mi->GetTx(); - // now add transactions from the mem pool - for (CTxMemPool::indexed_transaction_set::iterator mi = mempool.mapTx.begin(); - mi != mempool.mapTx.end(); ++mi) + int64_t nLockTimeCutoff = (STANDARD_LOCKTIME_VERIFY_FLAGS & LOCKTIME_MEDIAN_TIME_PAST) + ? nMedianTimePast + : pblock->GetBlockTime(); + + if (tx.IsCoinBase() || !IsFinalTx(tx, nHeight, nLockTimeCutoff) || IsExpiredTx(tx, nHeight)) { - const CTransaction& tx = mi->GetTx(); + //fprintf(stderr,"coinbase.%d finaltx.%d expired.%d\n",tx.IsCoinBase(),IsFinalTx(tx, nHeight, nLockTimeCutoff),IsExpiredTx(tx, nHeight)); + continue; + } - int64_t nLockTimeCutoff = (STANDARD_LOCKTIME_VERIFY_FLAGS & LOCKTIME_MEDIAN_TIME_PAST) - ? nMedianTimePast - : pblock->GetBlockTime(); + if ( ASSETCHAINS_SYMBOL[0] == 0 && komodo_validate_interest(tx,nHeight,(uint32_t)pblock->nTime,0) < 0 ) + { + //fprintf(stderr,"CreateNewBlock: komodo_validate_interest failure nHeight.%d nTime.%u vs locktime.%u\n",nHeight,(uint32_t)pblock->nTime,(uint32_t)tx.nLockTime); + continue; + } - if (tx.IsCoinBase() || !IsFinalTx(tx, nHeight, nLockTimeCutoff) || IsExpiredTx(tx, nHeight)) + COrphan* porphan = NULL; + double dPriority = 0; + CAmount nTotalIn = 0; + bool fMissingInputs = false; + bool fNotarisation = false; + if (tx.IsCoinImport()) + { + CAmount nValueIn = GetCoinImportValue(tx); + nTotalIn += nValueIn; + dPriority += (double)nValueIn * 1000; // flat multiplier + } else { + BOOST_FOREACH(const CTxIn& txin, tx.vin) { - //fprintf(stderr,"coinbase.%d finaltx.%d expired.%d\n",tx.IsCoinBase(),IsFinalTx(tx, nHeight, nLockTimeCutoff),IsExpiredTx(tx, nHeight)); - continue; - } + // Read prev transaction + if (!view.HaveCoins(txin.prevout.hash)) + { + // This should never happen; all transactions in the memory + // pool should connect to either transactions in the chain + // or other transactions in the memory pool. + if (!mempool.mapTx.count(txin.prevout.hash)) + { + LogPrintf("ERROR: mempool transaction missing input\n"); + if (fDebug) assert("mempool transaction missing input" == 0); + fMissingInputs = true; + if (porphan) + vOrphan.pop_back(); + break; + } - if ( ASSETCHAINS_SYMBOL[0] == 0 && komodo_validate_interest(tx,nHeight,(uint32_t)pblock->nTime,0) < 0 ) - { - //fprintf(stderr,"CreateNewBlock: komodo_validate_interest failure nHeight.%d nTime.%u vs locktime.%u\n",nHeight,(uint32_t)pblock->nTime,(uint32_t)tx.nLockTime); - continue; - } + // Has to wait for dependencies + if (!porphan) + { + // Use list for automatic deletion + vOrphan.push_back(COrphan(&tx)); + porphan = &vOrphan.back(); + } + mapDependers[txin.prevout.hash].push_back(porphan); + porphan->setDependsOn.insert(txin.prevout.hash); + nTotalIn += mempool.mapTx.find(txin.prevout.hash)->GetTx().vout[txin.prevout.n].nValue; + continue; + } + const CCoins* coins = view.AccessCoins(txin.prevout.hash); + assert(coins); - COrphan* porphan = NULL; - double dPriority = 0; - CAmount nTotalIn = 0; - bool fMissingInputs = false; - bool fNotarisation = false; - if (tx.IsCoinImport()) - { - CAmount nValueIn = GetCoinImportValue(tx); + CAmount nValueIn = coins->vout[txin.prevout.n].nValue; nTotalIn += nValueIn; - dPriority += (double)nValueIn * 1000; // flat multiplier - } else { - BOOST_FOREACH(const CTxIn& txin, tx.vin) - { - // Read prev transaction - if (!view.HaveCoins(txin.prevout.hash)) - { - // This should never happen; all transactions in the memory - // pool should connect to either transactions in the chain - // or other transactions in the memory pool. - if (!mempool.mapTx.count(txin.prevout.hash)) - { - LogPrintf("ERROR: mempool transaction missing input\n"); - if (fDebug) assert("mempool transaction missing input" == 0); - fMissingInputs = true; - if (porphan) - vOrphan.pop_back(); - break; - } - // Has to wait for dependencies - if (!porphan) - { - // Use list for automatic deletion - vOrphan.push_back(COrphan(&tx)); - porphan = &vOrphan.back(); - } - mapDependers[txin.prevout.hash].push_back(porphan); - porphan->setDependsOn.insert(txin.prevout.hash); - nTotalIn += mempool.mapTx.find(txin.prevout.hash)->GetTx().vout[txin.prevout.n].nValue; - continue; - } - const CCoins* coins = view.AccessCoins(txin.prevout.hash); - assert(coins); + int nConf = nHeight - coins->nHeight; - CAmount nValueIn = coins->vout[txin.prevout.n].nValue; - nTotalIn += nValueIn; - - int nConf = nHeight - coins->nHeight; - - dPriority += (double)nValueIn * nConf; - } - nTotalIn += tx.GetShieldedValueIn(); + dPriority += (double)nValueIn * nConf; } - - if (fMissingInputs) continue; - - // Priority is sum(valuein * age) / modified_txsize - unsigned int nTxSize = ::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION); - dPriority = tx.ComputePriority(dPriority, nTxSize); - - uint256 hash = tx.GetHash(); - mempool.ApplyDeltas(hash, dPriority, nTotalIn); - - CFeeRate feeRate(nTotalIn-tx.GetValueOut(), nTxSize); - - if (porphan) - { - porphan->dPriority = dPriority; - porphan->feeRate = feeRate; - } - else - vecPriority.push_back(TxPriority(dPriority, feeRate, &(mi->GetTx()))); + nTotalIn += tx.GetShieldedValueIn(); } - // Collect transactions into block - uint64_t nBlockSize = 1000; - uint64_t nBlockTx = 0; - int64_t interest; - int nBlockSigOps = 100; - bool fSortedByFee = (nBlockPrioritySize <= 0); + if (fMissingInputs) continue; - TxPriorityCompare comparer(fSortedByFee); - std::make_heap(vecPriority.begin(), vecPriority.end(), comparer); + // Priority is sum(valuein * age) / modified_txsize + unsigned int nTxSize = ::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION); + dPriority = tx.ComputePriority(dPriority, nTxSize); - while (!vecPriority.empty()) + uint256 hash = tx.GetHash(); + mempool.ApplyDeltas(hash, dPriority, nTotalIn); + + CFeeRate feeRate(nTotalIn-tx.GetValueOut(), nTxSize); + + if (porphan) { - // Take highest priority transaction off the priority queue: - double dPriority = vecPriority.front().get<0>(); - CFeeRate feeRate = vecPriority.front().get<1>(); - const CTransaction& tx = *(vecPriority.front().get<2>()); + porphan->dPriority = dPriority; + porphan->feeRate = feeRate; + } + else + vecPriority.push_back(TxPriority(dPriority, feeRate, &(mi->GetTx()))); + } - std::pop_heap(vecPriority.begin(), vecPriority.end(), comparer); - vecPriority.pop_back(); + // Collect transactions into block + uint64_t nBlockSize = 1000; + uint64_t nBlockTx = 0; + int64_t interest; + int nBlockSigOps = 100; + bool fSortedByFee = (nBlockPrioritySize <= 0); - // Size limits - unsigned int nTxSize = ::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION); - if (nBlockSize + nTxSize >= nBlockMaxSize-512) // room for extra autotx - { - //fprintf(stderr,"nBlockSize %d + %d nTxSize >= %d nBlockMaxSize\n",(int32_t)nBlockSize,(int32_t)nTxSize,(int32_t)nBlockMaxSize); - continue; - } + TxPriorityCompare comparer(fSortedByFee); + std::make_heap(vecPriority.begin(), vecPriority.end(), comparer); - // Legacy limits on sigOps: - unsigned int nTxSigOps = GetLegacySigOpCount(tx); - if (nBlockSigOps + nTxSigOps >= MAX_BLOCK_SIGOPS-1) - { - //fprintf(stderr,"A nBlockSigOps %d + %d nTxSigOps >= %d MAX_BLOCK_SIGOPS-1\n",(int32_t)nBlockSigOps,(int32_t)nTxSigOps,(int32_t)MAX_BLOCK_SIGOPS); - continue; - } - // Skip free transactions if we're past the minimum block size: - const uint256& hash = tx.GetHash(); - double dPriorityDelta = 0; - CAmount nFeeDelta = 0; - mempool.ApplyDeltas(hash, dPriorityDelta, nFeeDelta); - if (fSortedByFee && (dPriorityDelta <= 0) && (nFeeDelta <= 0) && (feeRate < ::minRelayTxFee) && (nBlockSize + nTxSize >= nBlockMinSize)) - { - //fprintf(stderr,"fee rate skip\n"); - continue; - } - // Prioritise by fee once past the priority size or we run out of high-priority - // transactions: - if (!fSortedByFee && - ((nBlockSize + nTxSize >= nBlockPrioritySize) || !AllowFree(dPriority))) - { - fSortedByFee = true; - comparer = TxPriorityCompare(fSortedByFee); - std::make_heap(vecPriority.begin(), vecPriority.end(), comparer); - } + while (!vecPriority.empty()) + { + // Take highest priority transaction off the priority queue: + double dPriority = vecPriority.front().get<0>(); + CFeeRate feeRate = vecPriority.front().get<1>(); + const CTransaction& tx = *(vecPriority.front().get<2>()); - if (!view.HaveInputs(tx)) - { - //fprintf(stderr,"dont have inputs\n"); - continue; - } - CAmount nTxFees = view.GetValueIn(chainActive.LastTip()->GetHeight(),&interest,tx,chainActive.LastTip()->nTime)-tx.GetValueOut(); + std::pop_heap(vecPriority.begin(), vecPriority.end(), comparer); + vecPriority.pop_back(); - nTxSigOps += GetP2SHSigOpCount(tx, view); - if (nBlockSigOps + nTxSigOps >= MAX_BLOCK_SIGOPS-1) - { - //fprintf(stderr,"B nBlockSigOps %d + %d nTxSigOps >= %d MAX_BLOCK_SIGOPS-1\n",(int32_t)nBlockSigOps,(int32_t)nTxSigOps,(int32_t)MAX_BLOCK_SIGOPS); - continue; - } - // Note that flags: we don't want to set mempool/IsStandard() - // policy here, but we still have to ensure that the block we - // create only contains transactions that are valid in new blocks. - CValidationState state; - PrecomputedTransactionData txdata(tx); - if (!ContextualCheckInputs(tx, state, view, true, MANDATORY_SCRIPT_VERIFY_FLAGS, true, txdata, Params().GetConsensus(), consensusBranchId)) - { - //fprintf(stderr,"context failure\n"); - continue; - } - UpdateCoins(tx, view, nHeight); + // Size limits + unsigned int nTxSize = ::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION); + if (nBlockSize + nTxSize >= nBlockMaxSize-512) // room for extra autotx + { + //fprintf(stderr,"nBlockSize %d + %d nTxSize >= %d nBlockMaxSize\n",(int32_t)nBlockSize,(int32_t)nTxSize,(int32_t)nBlockMaxSize); + continue; + } - BOOST_FOREACH(const OutputDescription &outDescription, tx.vShieldedOutput) { - sapling_tree.append(outDescription.cm); - } + // Legacy limits on sigOps: + unsigned int nTxSigOps = GetLegacySigOpCount(tx); + if (nBlockSigOps + nTxSigOps >= MAX_BLOCK_SIGOPS-1) + { + //fprintf(stderr,"A nBlockSigOps %d + %d nTxSigOps >= %d MAX_BLOCK_SIGOPS-1\n",(int32_t)nBlockSigOps,(int32_t)nTxSigOps,(int32_t)MAX_BLOCK_SIGOPS); + continue; + } + // Skip free transactions if we're past the minimum block size: + const uint256& hash = tx.GetHash(); + double dPriorityDelta = 0; + CAmount nFeeDelta = 0; + mempool.ApplyDeltas(hash, dPriorityDelta, nFeeDelta); + if (fSortedByFee && (dPriorityDelta <= 0) && (nFeeDelta <= 0) && (feeRate < ::minRelayTxFee) && (nBlockSize + nTxSize >= nBlockMinSize)) + { + //fprintf(stderr,"fee rate skip\n"); + continue; + } + // Prioritise by fee once past the priority size or we run out of high-priority + // transactions: + if (!fSortedByFee && + ((nBlockSize + nTxSize >= nBlockPrioritySize) || !AllowFree(dPriority))) + { + fSortedByFee = true; + comparer = TxPriorityCompare(fSortedByFee); + std::make_heap(vecPriority.begin(), vecPriority.end(), comparer); + } - // Added - pblock->vtx.push_back(tx); - pblocktemplate->vTxFees.push_back(nTxFees); - pblocktemplate->vTxSigOps.push_back(nTxSigOps); - nBlockSize += nTxSize; - ++nBlockTx; - nBlockSigOps += nTxSigOps; - nFees += nTxFees; + if (!view.HaveInputs(tx)) + { + //fprintf(stderr,"dont have inputs\n"); + continue; + } + CAmount nTxFees = view.GetValueIn(chainActive.LastTip()->GetHeight(),&interest,tx,chainActive.LastTip()->nTime)-tx.GetValueOut(); - if (fPrintPriority) + nTxSigOps += GetP2SHSigOpCount(tx, view); + if (nBlockSigOps + nTxSigOps >= MAX_BLOCK_SIGOPS-1) + { + //fprintf(stderr,"B nBlockSigOps %d + %d nTxSigOps >= %d MAX_BLOCK_SIGOPS-1\n",(int32_t)nBlockSigOps,(int32_t)nTxSigOps,(int32_t)MAX_BLOCK_SIGOPS); + continue; + } + // Note that flags: we don't want to set mempool/IsStandard() + // policy here, but we still have to ensure that the block we + // create only contains transactions that are valid in new blocks. + CValidationState state; + PrecomputedTransactionData txdata(tx); + if (!ContextualCheckInputs(tx, state, view, true, MANDATORY_SCRIPT_VERIFY_FLAGS, true, txdata, Params().GetConsensus(), consensusBranchId)) + { + //fprintf(stderr,"context failure\n"); + continue; + } + UpdateCoins(tx, view, nHeight); + + BOOST_FOREACH(const OutputDescription &outDescription, tx.vShieldedOutput) { + sapling_tree.append(outDescription.cm); + } + + // Added + pblock->vtx.push_back(tx); + pblocktemplate->vTxFees.push_back(nTxFees); + pblocktemplate->vTxSigOps.push_back(nTxSigOps); + nBlockSize += nTxSize; + ++nBlockTx; + nBlockSigOps += nTxSigOps; + nFees += nTxFees; + + if (fPrintPriority) + { + LogPrintf("priority %.1f fee %s txid %s\n",dPriority, feeRate.ToString(), tx.GetHash().ToString()); + } + + // Add transactions that depend on this one to the priority queue + if (mapDependers.count(hash)) + { + BOOST_FOREACH(COrphan* porphan, mapDependers[hash]) { - LogPrintf("priority %.1f fee %s txid %s\n",dPriority, feeRate.ToString(), tx.GetHash().ToString()); - } - - // Add transactions that depend on this one to the priority queue - if (mapDependers.count(hash)) - { - BOOST_FOREACH(COrphan* porphan, mapDependers[hash]) + if (!porphan->setDependsOn.empty()) { - if (!porphan->setDependsOn.empty()) + porphan->setDependsOn.erase(hash); + if (porphan->setDependsOn.empty()) { - porphan->setDependsOn.erase(hash); - if (porphan->setDependsOn.empty()) - { - vecPriority.push_back(TxPriority(porphan->dPriority, porphan->feeRate, porphan->ptx)); - std::push_heap(vecPriority.begin(), vecPriority.end(), comparer); - } + vecPriority.push_back(TxPriority(porphan->dPriority, porphan->feeRate, porphan->ptx)); + std::push_heap(vecPriority.begin(), vecPriority.end(), comparer); } } } } + } - nLastBlockTx = nBlockTx; - nLastBlockSize = nBlockSize; - blocktime = 1 + std::max(pindexPrev->GetMedianTimePast()+1, GetAdjustedTime()); - //pblock->nTime = blocktime + 1; - pblock->nBits = GetNextWorkRequired(pindexPrev, pblock, Params().GetConsensus()); - - } // contain lock to block generation only! + nLastBlockTx = nBlockTx; + nLastBlockSize = nBlockSize; + blocktime = 1 + std::max(pindexPrev->GetMedianTimePast()+1, GetAdjustedTime()); + //pblock->nTime = blocktime + 1; + pblock->nBits = GetNextWorkRequired(pindexPrev, pblock, Params().GetConsensus()); int32_t stakeHeight = chainActive.Height() + 1; @@ -500,7 +497,11 @@ CBlockTemplate* CreateNewBlock(const CScript& _scriptPubKeyIn, int32_t gpucount, blocktime = GetAdjustedTime(); //if ( blocktime > pindexPrev->GetMedianTimePast()+60 ) // blocktime = pindexPrev->GetMedianTimePast() + 60; + LEAVE_CRITICAL_SECTION(cs_main); + LEAVE_CRITICAL_SECTION(mempool.cs); siglen = komodo_staked(txStaked, pblock->nBits, &blocktime, &txtime, &utxotxid, &utxovout, &utxovalue, utxosig); + ENTER_CRITICAL_SECTION(cs_main); + ENTER_CRITICAL_SECTION(mempool.cs); } if ( siglen > 0 ) @@ -654,6 +655,8 @@ CBlockTemplate* CreateNewBlock(const CScript& _scriptPubKeyIn, int32_t gpucount, //fprintf(stderr,"valid\n"); } } + LEAVE_CRITICAL_SECTION(cs_main); + LEAVE_CRITICAL_SECTION(mempool.cs); //fprintf(stderr,"done new block\n"); return pblocktemplate.release(); } From 7f0f70f5ae8b35a751cbe9c945f2cdf6b20f90cf Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Thu, 10 Jan 2019 12:46:18 +0800 Subject: [PATCH 044/119] fix --- src/miner.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/miner.cpp b/src/miner.cpp index d504a2456..c308dcf41 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -242,7 +242,7 @@ CBlockTemplate* CreateNewBlock(const CScript& _scriptPubKeyIn, int32_t gpucount, CCoinsViewCache view(pcoinsTip); uint32_t expired; uint64_t commission; - SaplingMerkleTree sapling_tree; uint64_t commission; + SaplingMerkleTree sapling_tree; assert(view.GetSaplingAnchorAt(view.GetBestAnchor(SAPLING), sapling_tree)); // Priority order to process transactions From d7c08abe516f1f7ab4755113165eead95eb05e3b Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Thu, 10 Jan 2019 22:29:01 +0800 Subject: [PATCH 045/119] fix miner possible crash, fix dead lock for large numbers of import transactions. --- src/main.cpp | 1 + src/miner.cpp | 13 +++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index b29e80efc..cd3c0d35f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2694,6 +2694,7 @@ bool ContextualCheckInputs( if (tx.IsCoinImport()) { + LOCK(cs_main); ServerTransactionSignatureChecker checker(&tx, 0, 0, false, txdata); return VerifyCoinImport(tx.vin[0].scriptSig, checker, state); } diff --git a/src/miner.cpp b/src/miner.cpp index c308dcf41..7948fd0cd 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -477,6 +477,8 @@ CBlockTemplate* CreateNewBlock(const CScript& _scriptPubKeyIn, int32_t gpucount, //LogPrintf("CreateNewBlock(): total size %u blocktime.%u nBits.%08x\n", nBlockSize,blocktime,pblock->nBits); if ( ASSETCHAINS_SYMBOL[0] != 0 && isStake ) { + LEAVE_CRITICAL_SECTION(cs_main); + LEAVE_CRITICAL_SECTION(mempool.cs); uint64_t txfees,utxovalue; uint32_t txtime; uint256 utxotxid; int32_t i,siglen,numsigs,utxovout; uint8_t utxosig[128],*ptr; CMutableTransaction txStaked = CreateNewContextualCMutableTransaction(Params().GetConsensus(), stakeHeight); @@ -497,11 +499,7 @@ CBlockTemplate* CreateNewBlock(const CScript& _scriptPubKeyIn, int32_t gpucount, blocktime = GetAdjustedTime(); //if ( blocktime > pindexPrev->GetMedianTimePast()+60 ) // blocktime = pindexPrev->GetMedianTimePast() + 60; - LEAVE_CRITICAL_SECTION(cs_main); - LEAVE_CRITICAL_SECTION(mempool.cs); siglen = komodo_staked(txStaked, pblock->nBits, &blocktime, &txtime, &utxotxid, &utxovout, &utxovalue, utxosig); - ENTER_CRITICAL_SECTION(cs_main); - ENTER_CRITICAL_SECTION(mempool.cs); } if ( siglen > 0 ) @@ -655,8 +653,11 @@ CBlockTemplate* CreateNewBlock(const CScript& _scriptPubKeyIn, int32_t gpucount, //fprintf(stderr,"valid\n"); } } - LEAVE_CRITICAL_SECTION(cs_main); - LEAVE_CRITICAL_SECTION(mempool.cs); + if ( ASSETCHAINS_SYMBOL[0] == 0 || (ASSETCHAINS_SYMBOL[0] != 0 && !isStake) ) + { + LEAVE_CRITICAL_SECTION(cs_main); + LEAVE_CRITICAL_SECTION(mempool.cs); + } //fprintf(stderr,"done new block\n"); return pblocktemplate.release(); } From a47ba0cf7ae1df3df13fcdfc78242a4ae159193c Mon Sep 17 00:00:00 2001 From: ca333 Date: Fri, 11 Jan 2019 05:53:17 +0100 Subject: [PATCH 046/119] update BIP44 cointype use correct assigned BIP44 cointype --- src/chainparams.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index a04e4131a..af82f3a35 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -92,7 +92,7 @@ public: strNetworkID = "main"; strCurrencyUnits = "KMD"; - bip44CoinType = 133; // As registered in https://github.com/satoshilabs/slips/blob/master/slip-0044.md (ZCASH, should be VRSC) + bip44CoinType = 141; // As registered in https://github.com/satoshilabs/slips/blob/master/slip-0044.md (ZCASH, should be VRSC) consensus.fCoinbaseMustBeProtected = false; // true this is only true wuth Verus and enforced after block 12800 consensus.nSubsidySlowStartInterval = 20000; consensus.nSubsidyHalvingInterval = 840000; From b08d57ca4828b1841284da986c218953c46451b7 Mon Sep 17 00:00:00 2001 From: ca333 Date: Sat, 19 Jan 2019 19:00:26 +0100 Subject: [PATCH 047/119] resolve conflict jl777:master->komodoplatform:master --- src/chainparams.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index af82f3a35..02b73f04b 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -92,7 +92,8 @@ public: strNetworkID = "main"; strCurrencyUnits = "KMD"; - bip44CoinType = 141; // As registered in https://github.com/satoshilabs/slips/blob/master/slip-0044.md (ZCASH, should be VRSC) + bip44CoinType = 141; // As registered in https://github.com/satoshilabs/slips/blob/master/slip-0044.md + consensus.fCoinbaseMustBeProtected = false; // true this is only true wuth Verus and enforced after block 12800 consensus.nSubsidySlowStartInterval = 20000; consensus.nSubsidyHalvingInterval = 840000; From 03130a6856f234f17f98465e8ebeaa166db7debb Mon Sep 17 00:00:00 2001 From: Mihail Fedorov Date: Fri, 25 Jan 2019 01:52:24 +0300 Subject: [PATCH 048/119] OUR asset --- src/assetchains.json | 18 +++++++++++++++++- src/assetchains.old | 1 + 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/assetchains.json b/src/assetchains.json index 1b23bc616..2775f5db3 100644 --- a/src/assetchains.json +++ b/src/assetchains.json @@ -224,5 +224,21 @@ "addnode": [ "37.187.225.231" ] - } + }, + { + "ac_name": "OUR", + "ac_reward": "1478310502", + "ac_halving": "525600", + "ac_cc": "42", + "ac_supply": "100000000", + "ac_perc": "77700", + "ac_staked": "93", + "ac_pubkey": "02652a3f3e00b3a1875a918314f0bac838d6dd189a346fa623f5efe9541ac0b98c", + "ac_public": "1", + "addnode": [ + "51.255.195.65", + "217.182.129.38", + "37.187.225.231" + ] + } ] diff --git a/src/assetchains.old b/src/assetchains.old index 136f7c709..cd4d194d3 100755 --- a/src/assetchains.old +++ b/src/assetchains.old @@ -46,3 +46,4 @@ echo $pubkey ./komodod -pubkey=$pubkey -ac_name=DION -ac_supply=3900000000 -ac_reward=22260000000 -ac_staked=100 -ac_cc=1 -ac_end=4300000000 -addnode=51.75.124.34 & ./komodod -pubkey=$pubkey -ac_name=ZEX -ac_cc=2 -ac_founders=1 -ac_halving=525600 -ac_reward=13000000000 -ac_pubkey=039d4a50cc70d1184e462a22edb3b66385da97cc8059196f8305c184a3e21440af -addnode=5.9.102.210 & ./komodod -pubkey=$pubkey -ac_name=KSB -ac_supply=1000000000 -ac_end=1 -ac_public=1 -addnode=37.187.225.231 & +./komodod -pubkey=$pubkey -ac_name=OUR -ac_reward=1478310502 -ac_halving=525600 -ac_cc=42 -ac_supply=100000000 -ac_perc=77700 -ac_staked=93 -ac_pubkey=02652a3f3e00b3a1875a918314f0bac838d6dd189a346fa623f5efe9541ac0b98c -ac_public=1 -addnode=51.255.195.65 -addnode=217.182.129.38 -addnode=37.187.225.231 From 9bc086de8ee930cc70879651c364245c5b2e51ba Mon Sep 17 00:00:00 2001 From: Mihail Fedorov Date: Fri, 25 Jan 2019 01:52:45 +0300 Subject: [PATCH 049/119] OUR asset --- src/ac/our | 2 ++ src/fiat/our | 2 ++ 2 files changed, 4 insertions(+) create mode 100755 src/ac/our create mode 100755 src/fiat/our diff --git a/src/ac/our b/src/ac/our new file mode 100755 index 000000000..66c774476 --- /dev/null +++ b/src/ac/our @@ -0,0 +1,2 @@ +#!/bin/bash +./komodo-cli -ac_name=OUR $1 $2 $3 $4 $5 $6 diff --git a/src/fiat/our b/src/fiat/our new file mode 100755 index 000000000..66c774476 --- /dev/null +++ b/src/fiat/our @@ -0,0 +1,2 @@ +#!/bin/bash +./komodo-cli -ac_name=OUR $1 $2 $3 $4 $5 $6 From ebf84f3055b8db8f6be4e0903dd1a4a796a47931 Mon Sep 17 00:00:00 2001 From: Mihail Fedorov Date: Fri, 25 Jan 2019 01:54:33 +0300 Subject: [PATCH 050/119] OUR asset --- src/assetchains.old | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/assetchains.old b/src/assetchains.old index cd4d194d3..41cbbdae1 100755 --- a/src/assetchains.old +++ b/src/assetchains.old @@ -46,4 +46,5 @@ echo $pubkey ./komodod -pubkey=$pubkey -ac_name=DION -ac_supply=3900000000 -ac_reward=22260000000 -ac_staked=100 -ac_cc=1 -ac_end=4300000000 -addnode=51.75.124.34 & ./komodod -pubkey=$pubkey -ac_name=ZEX -ac_cc=2 -ac_founders=1 -ac_halving=525600 -ac_reward=13000000000 -ac_pubkey=039d4a50cc70d1184e462a22edb3b66385da97cc8059196f8305c184a3e21440af -addnode=5.9.102.210 & ./komodod -pubkey=$pubkey -ac_name=KSB -ac_supply=1000000000 -ac_end=1 -ac_public=1 -addnode=37.187.225.231 & -./komodod -pubkey=$pubkey -ac_name=OUR -ac_reward=1478310502 -ac_halving=525600 -ac_cc=42 -ac_supply=100000000 -ac_perc=77700 -ac_staked=93 -ac_pubkey=02652a3f3e00b3a1875a918314f0bac838d6dd189a346fa623f5efe9541ac0b98c -ac_public=1 -addnode=51.255.195.65 -addnode=217.182.129.38 -addnode=37.187.225.231 +./komodod -pubkey=$pubkey -ac_name=OUR -ac_reward=1478310502 -ac_halving=525600 -ac_cc=42 -ac_supply=100000000 -ac_perc=77700 -ac_staked=93 -ac_pubkey=02652a3f3e00b3a1875a918314f0bac838d6dd189a346fa623f5efe9541ac0b98c -ac_public=1 -addnode=51.255.195.65 -addnode=217.182.129.38 -addnode=37.187.225.231 & + From 2246cd0c550c16ad7d6dab4a7ae57aa97b38fec2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 25 Jan 2019 01:24:05 -1100 Subject: [PATCH 051/119] Nonz = 0 --- src/komodo_utils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_utils.h b/src/komodo_utils.h index 289a84d7c..3701f5257 100644 --- a/src/komodo_utils.h +++ b/src/komodo_utils.h @@ -1654,7 +1654,7 @@ extern int64_t MAX_MONEY; void komodo_args(char *argv0) { extern const char *Notaries_elected1[][2]; - std::string name,addn; char *dirname,fname[512],arg0str[64],magicstr[9]; uint8_t magic[4],extrabuf[8192],disablebits[32],*extraptr=0; FILE *fp; uint64_t val; uint16_t port; int32_t i,nonz,baseid,len,n,extralen = 0; uint64_t ccenables[256]; + std::string name,addn; char *dirname,fname[512],arg0str[64],magicstr[9]; uint8_t magic[4],extrabuf[8192],disablebits[32],*extraptr=0; FILE *fp; uint64_t val; uint16_t port; int32_t i,nonz=0,baseid,len,n,extralen = 0; uint64_t ccenables[256]; IS_KOMODO_NOTARY = GetBoolArg("-notary", false); memset(ccenables,0,sizeof(ccenables)); memset(disablebits,0,sizeof(disablebits)); From e8b79633567ab84bb35540d46947afcf536702f9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 11 Feb 2019 02:30:21 -1100 Subject: [PATCH 052/119] SEC and MGNX exemption --- src/cc/assets.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/cc/assets.cpp b/src/cc/assets.cpp index 2433473b9..8d133701c 100644 --- a/src/cc/assets.cpp +++ b/src/cc/assets.cpp @@ -145,6 +145,13 @@ bool AssetsValidate(struct CCcontract_info *cpAssets,Eval* eval,const CTransacti numvouts = tx.vout.size(); outputs = inputs = 0; preventCCvins = preventCCvouts = -1; + + // add specific chains exceptions for old token support: + if (strcmp(ASSETCHAINS_SYMBOL, "SEC") == 0 && chainActive.Height() <= 144073) + return true; + + if (strcmp(ASSETCHAINS_SYMBOL, "MGNX") == 0 && chainActive.Height() <= 210190) + return true; if (numvouts == 0) return eval->Invalid("AssetValidate: no vouts"); From d6309d063a8184e5d8f932f3615b1e7c9336b45d Mon Sep 17 00:00:00 2001 From: ca333 Date: Sun, 17 Feb 2019 15:09:21 +0100 Subject: [PATCH 053/119] update zmq --- depends/packages/zeromq.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/depends/packages/zeromq.mk b/depends/packages/zeromq.mk index b9a57cba7..ab3b95632 100644 --- a/depends/packages/zeromq.mk +++ b/depends/packages/zeromq.mk @@ -14,10 +14,10 @@ define $(package)_set_vars endef else package=zeromq -$(package)_version=4.2.1 +$(package)_version=4.3.1 $(package)_download_path=https://github.com/zeromq/libzmq/releases/download/v$($(package)_version) $(package)_file_name=$(package)-$($(package)_version).tar.gz -$(package)_sha256_hash=27d1e82a099228ee85a7ddb2260f40830212402c605a4a10b5e5498a7e0e9d03 +$(package)_sha256_hash=bcbabe1e2c7d0eec4ed612e10b94b112dd5f06fcefa994a0c79a45d835cd21eb define $(package)_set_vars $(package)_config_opts=--without-documentation --disable-shared --disable-curve From 5c6ca4c2915a2593aa86c0466881b857545d0c05 Mon Sep 17 00:00:00 2001 From: ca333 Date: Sun, 17 Feb 2019 15:15:17 +0100 Subject: [PATCH 054/119] update ZMQ --- depends/packages/zeromq.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/depends/packages/zeromq.mk b/depends/packages/zeromq.mk index ab3b95632..57806f50e 100644 --- a/depends/packages/zeromq.mk +++ b/depends/packages/zeromq.mk @@ -1,9 +1,9 @@ ifeq ($(host_os),mingw32) -$(package)_version=4.2.2-1 +$(package)_version=4.3.1 $(package)_download_path=https://github.com/ca333/libzmq/archive $(package)_download_file=v$($(package)_version).tar.gz $(package)_file_name=libzmq-$($(package)_version).tar.gz -$(package)_sha256_hash=0e225b85ce11be23bf7eb7d3f25c6686728bf30d5c31f61c12d37bb646c69962 +$(package)_sha256_hash=cb8ebe5b60dadeb526745610d6237f05a98aba287114d8991dad1fa14f4be354 define $(package)_set_vars $(package)_build_env+= From 4f5ba23dfcf01bd3d272da05a004b60af3a8b40e Mon Sep 17 00:00:00 2001 From: ca333 Date: Sun, 17 Feb 2019 16:05:19 +0100 Subject: [PATCH 055/119] set static ZMQ flag --- depends/packages/zeromq.mk | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/depends/packages/zeromq.mk b/depends/packages/zeromq.mk index 57806f50e..b7b352f12 100644 --- a/depends/packages/zeromq.mk +++ b/depends/packages/zeromq.mk @@ -9,7 +9,7 @@ define $(package)_set_vars $(package)_build_env+= $(package)_config_opts=--enable-shared=false --enable-static --host=x86_64-w64-mingw32 $(package)_config_opts_mingw32=--enable-shared=false --enable-static --host=x86_64-w64-mingw32 - $(package)_cflags=-Wno-error -Wall -Wno-pedantic-ms-format -DLIBCZMQ_EXPORTS -DZMQ_DEFINED_STDINT -lws2_32 -liphlpapi -lrpcrt4 + $(package)_cflags=-Wno-error -Wall -Wno-pedantic-ms-format -DZMQ_STATIC -DLIBCZMQ_EXPORTS -DZMQ_DEFINED_STDINT -lws2_32 -liphlpapi -lrpcrt4 $(package)_conf_tool=./configure endef else @@ -31,7 +31,8 @@ define $(package)_preprocess_cmds cd $($(package)_build_subdir); ./autogen.sh endef define $(package)_config_cmds - $($(package)_conf_tool) $($(package)_config_opts) CFLAGS="-Wno-error -Wall -Wno-pedantic-ms-format -DLIBCZMQ_EXPORTS -DZMQ_DEFINED_STDINT -lws2_32 -liphlpapi -lrpcrt4" + $($(package)_conf_tool) $($(package)_config_opts) + CFLAGS="-Wno-error -Wall -Wno-pedantic-ms-format -DZMQ_STATIC -DLIBCZMQ_EXPORTS -DZMQ_DEFINED_STDINT -lzmq -lws2_32 -liphlpapi -lrpcrt4" endef else define $(package)_config_cmds From ec95ae2d65c11e821f8f41878d48ea249e9b02d4 Mon Sep 17 00:00:00 2001 From: ca333 Date: Sun, 17 Feb 2019 17:14:18 +0100 Subject: [PATCH 056/119] remove ZMQ from WIN --- depends/packages/packages.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depends/packages/packages.mk b/depends/packages/packages.mk index 5bc8fcda6..624079b91 100644 --- a/depends/packages/packages.mk +++ b/depends/packages/packages.mk @@ -49,6 +49,6 @@ wallet_packages=bdb ifeq ($(host_os),linux) packages := boost openssl libevent zeromq $(zcash_packages) googletest #googlemock else - packages := boost openssl libevent zeromq $(zcash_packages) libcurl googletest #googlemock + packages := boost openssl libevent $(zcash_packages) libcurl googletest #googlemock endif From af9ff2e6204f6432fca42010fc564b4dc7b43c32 Mon Sep 17 00:00:00 2001 From: ca333 Date: Sun, 17 Feb 2019 18:20:57 +0100 Subject: [PATCH 057/119] update zeromq --- depends/packages/zeromq.mk | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/depends/packages/zeromq.mk b/depends/packages/zeromq.mk index b7b352f12..89fb6ef1c 100644 --- a/depends/packages/zeromq.mk +++ b/depends/packages/zeromq.mk @@ -8,8 +8,8 @@ $(package)_sha256_hash=cb8ebe5b60dadeb526745610d6237f05a98aba287114d8991dad1fa14 define $(package)_set_vars $(package)_build_env+= $(package)_config_opts=--enable-shared=false --enable-static --host=x86_64-w64-mingw32 - $(package)_config_opts_mingw32=--enable-shared=false --enable-static --host=x86_64-w64-mingw32 - $(package)_cflags=-Wno-error -Wall -Wno-pedantic-ms-format -DZMQ_STATIC -DLIBCZMQ_EXPORTS -DZMQ_DEFINED_STDINT -lws2_32 -liphlpapi -lrpcrt4 + $(package)_config_opts_mingw32=--enable-shared=false --enable-static --prefix=$(host_prefix) --host=x86_64-w64-mingw32 -disable-curve + $(package)_cflags=-Wno-error -Wall -Wno-pedantic-ms-format -DLIBCZMQ_EXPORTS -DZMQ_DEFINED_STDINT -lws2_32 -liphlpapi -lrpcrt4 $(package)_conf_tool=./configure endef else @@ -31,8 +31,7 @@ define $(package)_preprocess_cmds cd $($(package)_build_subdir); ./autogen.sh endef define $(package)_config_cmds - $($(package)_conf_tool) $($(package)_config_opts) - CFLAGS="-Wno-error -Wall -Wno-pedantic-ms-format -DZMQ_STATIC -DLIBCZMQ_EXPORTS -DZMQ_DEFINED_STDINT -lzmq -lws2_32 -liphlpapi -lrpcrt4" + $($(package)_conf_tool) $($(package)_config_opts) CFLAGS="-Wno-error -Wall -Wno-pedantic-ms-format -DLIBCZMQ_EXPORTS -DZMQ_DEFINED_STDINT -lws2_32 -liphlpapi -lrpcrt4" endef else define $(package)_config_cmds From 7d50f06c7613cf74f56d23768919c7f52b114922 Mon Sep 17 00:00:00 2001 From: ca333 Date: Sun, 17 Feb 2019 18:21:18 +0100 Subject: [PATCH 058/119] add ZMQ to WIN --- depends/packages/packages.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depends/packages/packages.mk b/depends/packages/packages.mk index 624079b91..5bc8fcda6 100644 --- a/depends/packages/packages.mk +++ b/depends/packages/packages.mk @@ -49,6 +49,6 @@ wallet_packages=bdb ifeq ($(host_os),linux) packages := boost openssl libevent zeromq $(zcash_packages) googletest #googlemock else - packages := boost openssl libevent $(zcash_packages) libcurl googletest #googlemock + packages := boost openssl libevent zeromq $(zcash_packages) libcurl googletest #googlemock endif From 7b8460cfaa7e3535918b9512be9aa66c8e03b5a5 Mon Sep 17 00:00:00 2001 From: ca333 Date: Tue, 19 Feb 2019 01:33:03 +0100 Subject: [PATCH 059/119] update openssl --- depends/packages/openssl.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/depends/packages/openssl.mk b/depends/packages/openssl.mk index dec8ecef6..090090769 100644 --- a/depends/packages/openssl.mk +++ b/depends/packages/openssl.mk @@ -1,8 +1,8 @@ package=openssl -$(package)_version=1.1.0h +$(package)_version=1.1.1a $(package)_download_path=https://www.openssl.org/source $(package)_file_name=$(package)-$($(package)_version).tar.gz -$(package)_sha256_hash=5835626cde9e99656585fc7aaa2302a73a7e1340bf8c14fd635a62c66802a517 +$(package)_sha256_hash=fc20130f8b7cbd2fb918b2f14e2f429e109c31ddd0fb38fc5d71d9ffed3f9f41 define $(package)_set_vars $(package)_config_env=AR="$($(package)_ar)" RANLIB="$($(package)_ranlib)" CC="$($(package)_cc)" From 7b6a6a729af6b646fd596899af9a7b010a070c03 Mon Sep 17 00:00:00 2001 From: ca333 Date: Tue, 19 Feb 2019 01:38:02 +0100 Subject: [PATCH 060/119] update openssl --- depends/packages/openssl.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depends/packages/openssl.mk b/depends/packages/openssl.mk index 090090769..e378088e6 100644 --- a/depends/packages/openssl.mk +++ b/depends/packages/openssl.mk @@ -92,7 +92,7 @@ $(package)_config_opts_i686_mingw32=mingw endef define $(package)_preprocess_cmds - sed -i.old "/define DATE/d" util/mkbuildinf.pl && \ + sed -i.old 's/built on: $date/built on: not available/' util/mkbuildinf.pl && \ sed -i.old "s|\"engines\", \"apps\", \"test\"|\"engines\"|" Configure endef From 599bb0b2e1de6822142a4c5d3dead7a7f9e594e4 Mon Sep 17 00:00:00 2001 From: ca333 Date: Tue, 19 Feb 2019 01:52:16 +0100 Subject: [PATCH 061/119] update boost --- depends/packages/boost.mk | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/depends/packages/boost.mk b/depends/packages/boost.mk index 8f3fd1b1c..7a0439ba7 100644 --- a/depends/packages/boost.mk +++ b/depends/packages/boost.mk @@ -1,9 +1,8 @@ - package=boost -$(package)_version=1_66_0 -$(package)_download_path=https://dl.bintray.com/boostorg/release/1.66.0/source +$(package)_version=1_69_0 +$(package)_download_path=https://dl.bintray.com/boostorg/release/1.69.0/source $(package)_file_name=$(package)_$($(package)_version).tar.bz2 -$(package)_sha256_hash=5721818253e6a0989583192f96782c4a98eb6204965316df9f5ad75819225ca9 +$(package)_sha256_hash=8f32d4617390d1c2d16f26a27ab60d97807b35440d45891fa340fc2648b04406 define $(package)_set_vars $(package)_config_opts_release=variant=release From a53eee78b5f4fdde9fad0ad49047695036cf8588 Mon Sep 17 00:00:00 2001 From: ca333 Date: Tue, 19 Feb 2019 01:54:40 +0100 Subject: [PATCH 062/119] update rust --- depends/packages/rust.mk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/depends/packages/rust.mk b/depends/packages/rust.mk index a08ac2747..9cfb95054 100644 --- a/depends/packages/rust.mk +++ b/depends/packages/rust.mk @@ -1,13 +1,13 @@ package=rust -$(package)_version=1.28.0 +$(package)_version=1.32.0 $(package)_download_path=https://static.rust-lang.org/dist $(package)_file_name_linux=rust-$($(package)_version)-x86_64-unknown-linux-gnu.tar.gz -$(package)_sha256_hash_linux=2a1390340db1d24a9498036884e6b2748e9b4b057fc5219694e298bdaa37b810 +$(package)_sha256_hash_linux=e024698320d76b74daf0e6e71be3681a1e7923122e3ebd03673fcac3ecc23810 $(package)_file_name_darwin=rust-$($(package)_version)-x86_64-apple-darwin.tar.gz -$(package)_sha256_hash_darwin=5d7a70ed4701fe9410041c1eea025c95cad97e5b3d8acc46426f9ac4f9f02393 +$(package)_sha256_hash_darwin=f0dfba507192f9b5c330b5984ba71d57d434475f3d62bd44a39201e36fa76304 $(package)_file_name_mingw32=rust-$($(package)_version)-x86_64-pc-windows-gnu.tar.gz -$(package)_sha256_hash_mingw32=55c07426f791c51c8a2b6934b35784175c4abb4e03f123f3e847109c4dc1ad8b +$(package)_sha256_hash_mingw32=358e1435347c67dbf33aa9cad6fe501a833d6633ed5d5aa1863d5dffa0349be9 ifeq ($(build_os),darwin) $(package)_file_name=$($(package)_file_name_darwin) From c2665ae8bf7eaf4ed6792effaab934b28890a86d Mon Sep 17 00:00:00 2001 From: ca333 Date: Tue, 19 Feb 2019 02:15:13 +0100 Subject: [PATCH 063/119] update libsodium osx --- depends/packages/libsodium.mk | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/depends/packages/libsodium.mk b/depends/packages/libsodium.mk index 76f0d9a28..e63bff653 100644 --- a/depends/packages/libsodium.mk +++ b/depends/packages/libsodium.mk @@ -1,12 +1,3 @@ -ifeq ($(build_os),darwin) -package=libsodium -$(package)_version=1.0.11 -$(package)_download_path=https://supernetorg.bintray.com/misc -$(package)_file_name=libsodium-1.0.11.tar.gz -$(package)_sha256_hash=a14549db3c49f6ae2170cbbf4664bd48ace50681045e8dbea7c8d9fb96f9c765 -$(package)_dependencies= -$(package)_config_opts= -else package=libsodium $(package)_version=1.0.15 $(package)_download_path=https://download.libsodium.org/libsodium/releases/old @@ -14,7 +5,7 @@ $(package)_file_name=$(package)-$($(package)_version).tar.gz $(package)_sha256_hash=fb6a9e879a2f674592e4328c5d9f79f082405ee4bb05cb6e679b90afe9e178f4 $(package)_dependencies= $(package)_config_opts= -endif + define $(package)_preprocess_cmds cd $($(package)_build_subdir); ./autogen.sh From 7bf6996468e9e31689cee2c4171b463e7cd94a97 Mon Sep 17 00:00:00 2001 From: ca333 Date: Tue, 19 Feb 2019 16:02:03 +0100 Subject: [PATCH 064/119] update libsodium --- depends/packages/libsodium.mk | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/depends/packages/libsodium.mk b/depends/packages/libsodium.mk index e63bff653..179ebe86c 100644 --- a/depends/packages/libsodium.mk +++ b/depends/packages/libsodium.mk @@ -6,6 +6,13 @@ $(package)_sha256_hash=fb6a9e879a2f674592e4328c5d9f79f082405ee4bb05cb6e679b90afe $(package)_dependencies= $(package)_config_opts= +ifeq ($(build_os),darwin) +define $(package)_set_vars + $(package)_build_env=MACOSX_DEPLOYMENT_TARGET="10.11" + $(package)_cc=clang + $(package)_cxx=clang++ +endef +endif define $(package)_preprocess_cmds cd $($(package)_build_subdir); ./autogen.sh From a5d480a40e5ea6fca146407bceb525a0e139185e Mon Sep 17 00:00:00 2001 From: igorvoltaic Date: Mon, 25 Feb 2019 09:50:10 +0300 Subject: [PATCH 065/119] Update README.md --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9a8582891..6cf69af16 100644 --- a/README.md +++ b/README.md @@ -72,8 +72,12 @@ cd komodo ``` #### OSX -Ensure you have [brew](https://brew.sh) and the command line tools installed (comes automatically with XCode) and run: +Ensure you have [brew](https://brew.sh) and Command Line Tools installed. ```shell +/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" +# installs brew +xcode-select --install +# opens a pop-up window to install CLT without downloading large Xcode package brew update && brew install gcc@6 git clone https://github.com/komodoplatform/komodo --branch master --single-branch cd komodo From d8c4f6ec94f6252f3a5633ac2e4a807f7bfcb66a Mon Sep 17 00:00:00 2001 From: igorvoltaic Date: Mon, 25 Feb 2019 09:54:07 +0300 Subject: [PATCH 066/119] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6cf69af16..0f112982d 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ Ensure you have [brew](https://brew.sh) and Command Line Tools installed. /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" # installs brew xcode-select --install -# opens a pop-up window to install CLT without downloading large Xcode package +# opens a pop-up window to install CLT without installing the entire Xcode package brew update && brew install gcc@6 git clone https://github.com/komodoplatform/komodo --branch master --single-branch cd komodo From 0d2bfae2bf13225d2ba9a0e1922d588005936554 Mon Sep 17 00:00:00 2001 From: Mihail Fedorov Date: Tue, 26 Feb 2019 04:51:32 +0300 Subject: [PATCH 067/119] ILN --- src/ac/iln | 2 ++ src/assetchains.json | 9 ++++++++- src/assetchains.old | 2 +- src/fiat/iln | 2 ++ 4 files changed, 13 insertions(+), 2 deletions(-) create mode 100755 src/ac/iln create mode 100755 src/fiat/iln diff --git a/src/ac/iln b/src/ac/iln new file mode 100755 index 000000000..f453c338e --- /dev/null +++ b/src/ac/iln @@ -0,0 +1,2 @@ +#!/bin/bash +./komodo-cli -ac_name=ILN $1 $2 $3 $4 $5 $6 diff --git a/src/assetchains.json b/src/assetchains.json index 2775f5db3..c4e61d395 100644 --- a/src/assetchains.json +++ b/src/assetchains.json @@ -240,5 +240,12 @@ "217.182.129.38", "37.187.225.231" ] - } + }, + { + "ac_name": "ILN", + "ac_supply": "10000000000", + "ac_cc": "2", + "addnode": ["51.75.122.83"] + } + ] diff --git a/src/assetchains.old b/src/assetchains.old index 41cbbdae1..bb493da9f 100755 --- a/src/assetchains.old +++ b/src/assetchains.old @@ -47,4 +47,4 @@ echo $pubkey ./komodod -pubkey=$pubkey -ac_name=ZEX -ac_cc=2 -ac_founders=1 -ac_halving=525600 -ac_reward=13000000000 -ac_pubkey=039d4a50cc70d1184e462a22edb3b66385da97cc8059196f8305c184a3e21440af -addnode=5.9.102.210 & ./komodod -pubkey=$pubkey -ac_name=KSB -ac_supply=1000000000 -ac_end=1 -ac_public=1 -addnode=37.187.225.231 & ./komodod -pubkey=$pubkey -ac_name=OUR -ac_reward=1478310502 -ac_halving=525600 -ac_cc=42 -ac_supply=100000000 -ac_perc=77700 -ac_staked=93 -ac_pubkey=02652a3f3e00b3a1875a918314f0bac838d6dd189a346fa623f5efe9541ac0b98c -ac_public=1 -addnode=51.255.195.65 -addnode=217.182.129.38 -addnode=37.187.225.231 & - +./komodod -pubkey=$pubkey -ac_name=ILN -ac_supply=10000000000 -ac_cc=2 -addnode=51.75.122.83 & diff --git a/src/fiat/iln b/src/fiat/iln new file mode 100755 index 000000000..f453c338e --- /dev/null +++ b/src/fiat/iln @@ -0,0 +1,2 @@ +#!/bin/bash +./komodo-cli -ac_name=ILN $1 $2 $3 $4 $5 $6 From a5475a30dea8ae59b8b91465b2a9e130ccfdad58 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 1 Mar 2019 23:18:52 -1100 Subject: [PATCH 068/119] Change amulet level to 26 --- src/cc/rogue_rpc.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cc/rogue_rpc.cpp b/src/cc/rogue_rpc.cpp index eee5bc9e9..93eb22dc8 100644 --- a/src/cc/rogue_rpc.cpp +++ b/src/cc/rogue_rpc.cpp @@ -1084,8 +1084,8 @@ int32_t rogue_playerdata_validate(int64_t *cashoutp,uint256 &playertxid,struct C if ( P.amulet != 0 ) mult *= 5; dungeonlevel = P.dungeonlevel; - if ( P.amulet != 0 && dungeonlevel < 21 ) - dungeonlevel = 21; + if ( P.amulet != 0 && dungeonlevel < 26 ) + dungeonlevel = 26; *cashoutp = (uint64_t)P.gold * P.gold * mult * dungeonlevel; if ( newdata == playerdata ) { From f9913c7a5a1501fdd0aa359178d399967b5e1b06 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 1 Mar 2019 23:33:41 -1100 Subject: [PATCH 069/119] Set max_money --- src/komodo_globals.h | 3 ++- src/komodo_utils.h | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/komodo_globals.h b/src/komodo_globals.h index 13de7c310..bfac8cb93 100644 --- a/src/komodo_globals.h +++ b/src/komodo_globals.h @@ -266,7 +266,7 @@ uint64_t komodo_current_supply(uint32_t nHeight) } #define KOMODO_MAXNVALUE (((uint64_t)1 << 63) - 1) #define KOMODO_BIT63SET(x) ((x) & ((uint64_t)1 << 63)) - + cur_money *= COIN; if ( KOMODO_BIT63SET(cur_money) != 0 ) return(KOMODO_MAXNVALUE); if ( ASSETCHAINS_COMMISSION != 0 ) @@ -278,5 +278,6 @@ uint64_t komodo_current_supply(uint32_t nHeight) return(KOMODO_MAXNVALUE); return(newval); } + fprintf(stderr,"cur_money %.8f\n",(double)cur_money/COIN); return(cur_money); } diff --git a/src/komodo_utils.h b/src/komodo_utils.h index 65114c16b..56af296a6 100644 --- a/src/komodo_utils.h +++ b/src/komodo_utils.h @@ -2049,9 +2049,9 @@ void komodo_args(char *argv0) if ( ASSETCHAINS_CC >= KOMODO_FIRSTFUNGIBLEID && MAX_MONEY < 1000000LL*SATOSHIDEN ) MAX_MONEY = 1000000LL*SATOSHIDEN; - if ( MAX_MONEY <= 0 || MAX_MONEY > 10000100000LL*SATOSHIDEN ) - MAX_MONEY = 10000100000LL*SATOSHIDEN; - //fprintf(stderr,"MAX_MONEY %llu %.8f\n",(long long)MAX_MONEY,(double)MAX_MONEY/SATOSHIDEN); + if ( MAX_MONEY <= 0 || MAX_MONEY > (uint64_t)90*1000*1000*1000*SATOSHIDEN ) + MAX_MONEY = (uint64_t)90*1000*1000*1000*SATOSHIDEN; + fprintf(stderr,"MAX_MONEY %llu %.8f\n",(long long)MAX_MONEY,(double)MAX_MONEY/SATOSHIDEN); //printf("baseid.%d MAX_MONEY.%s %.8f\n",baseid,ASSETCHAINS_SYMBOL,(double)MAX_MONEY/SATOSHIDEN); uint16_t tmpport = komodo_port(ASSETCHAINS_SYMBOL,ASSETCHAINS_SUPPLY,&ASSETCHAINS_MAGIC,extraptr,extralen); if ( GetArg("-port",0) != 0 ) From 5a39e093312551e9c4c46f22b35e98d15cd18f2b Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 1 Mar 2019 23:38:27 -1100 Subject: [PATCH 070/119] ASSETCHAINS_SUPPLY --- src/komodo_utils.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/komodo_utils.h b/src/komodo_utils.h index 56af296a6..e7d71e686 100644 --- a/src/komodo_utils.h +++ b/src/komodo_utils.h @@ -1792,6 +1792,8 @@ void komodo_args(char *argv0) fprintf(stderr,"-ac_supply must be less than 90 billion\n"); exit(0); } + fprintf(stderr,"ASSETCHAINS_SUPPLY %llu\n",(long long)ASSETCHAINS_SUPPLY); + ASSETCHAINS_COMMISSION = GetArg("-ac_perc",0); ASSETCHAINS_OVERRIDE_PUBKEY = GetArg("-ac_pubkey",""); ASSETCHAINS_SCRIPTPUB = GetArg("-ac_script",""); From fe8f69b08c44ed35bc57c22e08d3ec339639d084 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 1 Mar 2019 23:42:00 -1100 Subject: [PATCH 071/119] unmult --- src/komodo_globals.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/komodo_globals.h b/src/komodo_globals.h index bfac8cb93..7370e8c70 100644 --- a/src/komodo_globals.h +++ b/src/komodo_globals.h @@ -142,7 +142,7 @@ uint64_t komodo_current_supply(uint32_t nHeight) cur_money = (ASSETCHAINS_SUPPLY+1) * SATOSHIDEN + (ASSETCHAINS_MAGIC & 0xffffff) + ASSETCHAINS_GENESISTXVAL; if ( ASSETCHAINS_LASTERA == 0 && ASSETCHAINS_REWARD[0] == 0 ) { - cur_money += (nHeight * 10000) / SATOSHIDEN; + cur_money += (nHeight * 10000);// / SATOSHIDEN; } else { @@ -266,7 +266,6 @@ uint64_t komodo_current_supply(uint32_t nHeight) } #define KOMODO_MAXNVALUE (((uint64_t)1 << 63) - 1) #define KOMODO_BIT63SET(x) ((x) & ((uint64_t)1 << 63)) - cur_money *= COIN; if ( KOMODO_BIT63SET(cur_money) != 0 ) return(KOMODO_MAXNVALUE); if ( ASSETCHAINS_COMMISSION != 0 ) From 0cf62abcbd5769c5c18696903ea6239ea50d616e Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 1 Mar 2019 23:47:17 -1100 Subject: [PATCH 072/119] MAX_MONEY capped at 63 bits - 1 --- src/komodo_utils.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/komodo_utils.h b/src/komodo_utils.h index e7d71e686..3b7d06401 100644 --- a/src/komodo_utils.h +++ b/src/komodo_utils.h @@ -2051,8 +2051,8 @@ void komodo_args(char *argv0) if ( ASSETCHAINS_CC >= KOMODO_FIRSTFUNGIBLEID && MAX_MONEY < 1000000LL*SATOSHIDEN ) MAX_MONEY = 1000000LL*SATOSHIDEN; - if ( MAX_MONEY <= 0 || MAX_MONEY > (uint64_t)90*1000*1000*1000*SATOSHIDEN ) - MAX_MONEY = (uint64_t)90*1000*1000*1000*SATOSHIDEN; + if ( KOMODO_BIT63SET(MAX_MONEY) != 0 ) + MAX_MONEY = KOMODO_MAXNVALUE; fprintf(stderr,"MAX_MONEY %llu %.8f\n",(long long)MAX_MONEY,(double)MAX_MONEY/SATOSHIDEN); //printf("baseid.%d MAX_MONEY.%s %.8f\n",baseid,ASSETCHAINS_SYMBOL,(double)MAX_MONEY/SATOSHIDEN); uint16_t tmpport = komodo_port(ASSETCHAINS_SYMBOL,ASSETCHAINS_SUPPLY,&ASSETCHAINS_MAGIC,extraptr,extralen); From a8ef36c29cfe8454c2e9d2d13de931c6dff14233 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 1 Mar 2019 23:53:02 -1100 Subject: [PATCH 073/119] Test version --- src/cc/rogue/rogue.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cc/rogue/rogue.h b/src/cc/rogue/rogue.h index 8c1101fc6..b59ee710f 100644 --- a/src/cc/rogue/rogue.h +++ b/src/cc/rogue/rogue.h @@ -60,7 +60,7 @@ #define MAXOBJ 9 #define MAXPACK 23 #define MAXTRAPS 10 -#define AMULETLEVEL 26 +#define AMULETLEVEL 3 //26 #define NUMTHINGS 7 /* number of types of things */ #define MAXPASS 13 /* upper limit on number of passages */ #define NUMLINES 24 From 5fde22c3d897fc71fae6b2b0e8876cd73493e9e5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 2 Mar 2019 00:33:39 -1100 Subject: [PATCH 074/119] Amulet -> level 26 --- src/cc/rogue/rogue.h | 2 +- src/utilstrencodings.cpp | 20 ++++++++++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/cc/rogue/rogue.h b/src/cc/rogue/rogue.h index b59ee710f..8c1101fc6 100644 --- a/src/cc/rogue/rogue.h +++ b/src/cc/rogue/rogue.h @@ -60,7 +60,7 @@ #define MAXOBJ 9 #define MAXPACK 23 #define MAXTRAPS 10 -#define AMULETLEVEL 3 //26 +#define AMULETLEVEL 26 #define NUMTHINGS 7 /* number of types of things */ #define MAXPASS 13 /* upper limit on number of passages */ #define NUMLINES 24 diff --git a/src/utilstrencodings.cpp b/src/utilstrencodings.cpp index ece2ec73e..f1cba3f43 100644 --- a/src/utilstrencodings.cpp +++ b/src/utilstrencodings.cpp @@ -419,10 +419,26 @@ bool ParseFixedPoint(const std::string &val, int decimals, int64_t *amount_out) int mantissa_tzeros = 0; bool mantissa_sign = false; bool exponent_sign = false; - int ptr = 0; + int i,n,ptr = 0; char *str = val.c_str(); int end = val.size(); int point_ofs = 0; - + n = val.size(); + if ( n == 11 && (val[0] < '9' || val[1] < '3') ) + { + uint64_t val64 = 0; + for (i=0; i '9' ) + break; + val64 = (val64 * 10) + (val[i] - '0') + } + if ( i == n ) // 90000000000 + { + *amount_out = val64 * COIN; + fprintf(stderr,"special case: %s -> %.8f\n",val.c_str(),(double)val64/COIN); + return(true); + } + } if (ptr < end && val[ptr] == '-') { mantissa_sign = true; ++ptr; From a99263b97e6061250d0edab74709466d234e9478 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 2 Mar 2019 00:35:59 -1100 Subject: [PATCH 075/119] Syntax --- src/utilstrencodings.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utilstrencodings.cpp b/src/utilstrencodings.cpp index f1cba3f43..e08993993 100644 --- a/src/utilstrencodings.cpp +++ b/src/utilstrencodings.cpp @@ -419,7 +419,7 @@ bool ParseFixedPoint(const std::string &val, int decimals, int64_t *amount_out) int mantissa_tzeros = 0; bool mantissa_sign = false; bool exponent_sign = false; - int i,n,ptr = 0; char *str = val.c_str(); + int i,n,ptr = 0; char *str = (char *)val.c_str(); int end = val.size(); int point_ofs = 0; n = val.size(); @@ -430,7 +430,7 @@ bool ParseFixedPoint(const std::string &val, int decimals, int64_t *amount_out) { if ( val[i] < '0' || val[i] > '9' ) break; - val64 = (val64 * 10) + (val[i] - '0') + val64 = (val64 * 10) + (val[i] - '0'); } if ( i == n ) // 90000000000 { From 59c289c8a2db0aaec825297a701c0528bf25ab06 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 2 Mar 2019 00:36:33 -1100 Subject: [PATCH 076/119] 100000000 --- src/utilstrencodings.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utilstrencodings.cpp b/src/utilstrencodings.cpp index e08993993..861a07b03 100644 --- a/src/utilstrencodings.cpp +++ b/src/utilstrencodings.cpp @@ -434,7 +434,7 @@ bool ParseFixedPoint(const std::string &val, int decimals, int64_t *amount_out) } if ( i == n ) // 90000000000 { - *amount_out = val64 * COIN; + *amount_out = val64 * 100000000; fprintf(stderr,"special case: %s -> %.8f\n",val.c_str(),(double)val64/COIN); return(true); } From ef691d5a4c1601eed87aa2e237d8c428ba6ba13b Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 2 Mar 2019 00:37:14 -1100 Subject: [PATCH 077/119] 100000000 --- src/utilstrencodings.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utilstrencodings.cpp b/src/utilstrencodings.cpp index 861a07b03..10902054f 100644 --- a/src/utilstrencodings.cpp +++ b/src/utilstrencodings.cpp @@ -435,7 +435,7 @@ bool ParseFixedPoint(const std::string &val, int decimals, int64_t *amount_out) if ( i == n ) // 90000000000 { *amount_out = val64 * 100000000; - fprintf(stderr,"special case: %s -> %.8f\n",val.c_str(),(double)val64/COIN); + fprintf(stderr,"special case: %s -> %.8f\n",val.c_str(),(double)val64/100000000); return(true); } } From 9615ec75746118c5846c68f3ee9ec72a94d783bd Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 2 Mar 2019 00:46:51 -1100 Subject: [PATCH 078/119] Test --- src/utilstrencodings.cpp | 2 +- src/wallet/rpcwallet.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utilstrencodings.cpp b/src/utilstrencodings.cpp index 10902054f..df788b2ab 100644 --- a/src/utilstrencodings.cpp +++ b/src/utilstrencodings.cpp @@ -435,7 +435,7 @@ bool ParseFixedPoint(const std::string &val, int decimals, int64_t *amount_out) if ( i == n ) // 90000000000 { *amount_out = val64 * 100000000; - fprintf(stderr,"special case: %s -> %.8f\n",val.c_str(),(double)val64/100000000); + fprintf(stderr,"special case: %s -> %.8f\n",val.c_str(),(double)*amount_out/100000000); return(true); } } diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 46cc71958..5200677fd 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -421,7 +421,7 @@ static void SendMoney(const CTxDestination &address, CAmount nValue, bool fSubtr // Check amount if (nValue <= 0) throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid amount"); - +fprintf(stderr,"nValue %.8f vs curBalance %.8f\n",(double)nValue/COIN,(double)curBalance/COIN); if (nValue > curBalance) throw JSONRPCError(RPC_WALLET_INSUFFICIENT_FUNDS, "Insufficient funds"); From 62cea0f4e863f3861054a8e35bcccdd8bdf766bd Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 2 Mar 2019 01:18:01 -1100 Subject: [PATCH 079/119] +print --- src/main.cpp | 2 +- src/utilstrencodings.cpp | 2 +- src/wallet/rpcwallet.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index c88f1520a..2aad3b9bb 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2870,7 +2870,7 @@ namespace { hasher << hashBlock; hasher << blockundo; if (hashChecksum != hasher.GetHash()) - return error("%s: Checksum mismatch", __func__); + return error("%s: Checksum mismatch %s vs %s", __func__,hashChecksum.GetHex().c_str(),hasher.GetHash().GetHex().c_str()); return true; } diff --git a/src/utilstrencodings.cpp b/src/utilstrencodings.cpp index df788b2ab..d4bba72ee 100644 --- a/src/utilstrencodings.cpp +++ b/src/utilstrencodings.cpp @@ -435,7 +435,7 @@ bool ParseFixedPoint(const std::string &val, int decimals, int64_t *amount_out) if ( i == n ) // 90000000000 { *amount_out = val64 * 100000000; - fprintf(stderr,"special case: %s -> %.8f\n",val.c_str(),(double)*amount_out/100000000); + //fprintf(stderr,"special case: %s -> %.8f\n",val.c_str(),(double)*amount_out/100000000); return(true); } } diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 5200677fd..6cf8eeed8 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -421,7 +421,7 @@ static void SendMoney(const CTxDestination &address, CAmount nValue, bool fSubtr // Check amount if (nValue <= 0) throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid amount"); -fprintf(stderr,"nValue %.8f vs curBalance %.8f\n",(double)nValue/COIN,(double)curBalance/COIN); +//fprintf(stderr,"nValue %.8f vs curBalance %.8f\n",(double)nValue/COIN,(double)curBalance/COIN); if (nValue > curBalance) throw JSONRPCError(RPC_WALLET_INSUFFICIENT_FUNDS, "Insufficient funds"); From 93ba595a83137d0cf75fa452abb626100a7acbe2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 2 Mar 2019 01:51:51 -1100 Subject: [PATCH 080/119] +print --- src/main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 2aad3b9bb..e02ec515b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2845,7 +2845,7 @@ namespace { hasher << hashBlock; hasher << blockundo; fileout << hasher.GetHash(); - +fprintf(stderr,"hashBlock.%s hasher.%s\n",hashBlock.GetHex().c_str(),hasher.GetHash().GetHex().c_str()); return true; } @@ -2870,7 +2870,7 @@ namespace { hasher << hashBlock; hasher << blockundo; if (hashChecksum != hasher.GetHash()) - return error("%s: Checksum mismatch %s vs %s", __func__,hashChecksum.GetHex().c_str(),hasher.GetHash().GetHex().c_str()); + return error("%s: %s Checksum mismatch %s vs %s", __func__,hashBlock.GetHex().c_str(),hashChecksum.GetHex().c_str(),hasher.GetHash().GetHex().c_str()); return true; } @@ -3634,6 +3634,7 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin return true; // Write undo information to disk + fprintf(stderr,"isNull %d vs isvalid %d nStatus %x\n",pindex->GetUndoPos().IsNull(),pindex->IsValid(BLOCK_VALID_SCRIPTS),(uint32_t)pindex->nStatus); if (pindex->GetUndoPos().IsNull() || !pindex->IsValid(BLOCK_VALID_SCRIPTS)) { if (pindex->GetUndoPos().IsNull()) { @@ -3644,7 +3645,6 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin fprintf(stderr,"ConnectBlock: unexpected null pprev\n"); if (!UndoWriteToDisk(blockundo, pos, pindex->pprev->GetBlockHash(), chainparams.MessageStart())) return AbortNode(state, "Failed to write undo data"); - // update nUndoPos in block index pindex->nUndoPos = pos.nPos; pindex->nStatus |= BLOCK_HAVE_UNDO; From 4a8df61a7be185823547495e092ff34fa54129aa Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 2 Mar 2019 01:54:50 -1100 Subject: [PATCH 081/119] +print --- src/main.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index e02ec515b..1d7a6f8b1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3634,10 +3634,11 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin return true; // Write undo information to disk - fprintf(stderr,"isNull %d vs isvalid %d nStatus %x\n",pindex->GetUndoPos().IsNull(),pindex->IsValid(BLOCK_VALID_SCRIPTS),(uint32_t)pindex->nStatus); + fprintf(stderr,"nFile.%d isNull %d vs isvalid %d nStatus %x\n",(int32_t)pindex->nFile,pindex->GetUndoPos().IsNull(),pindex->IsValid(BLOCK_VALID_SCRIPTS),(uint32_t)pindex->nStatus); if (pindex->GetUndoPos().IsNull() || !pindex->IsValid(BLOCK_VALID_SCRIPTS)) { - if (pindex->GetUndoPos().IsNull()) { + if (pindex->GetUndoPos().IsNull()) + { CDiskBlockPos pos; if (!FindUndoPos(state, pindex->nFile, pos, ::GetSerializeSize(blockundo, SER_DISK, CLIENT_VERSION) + 40)) return error("ConnectBlock(): FindUndoPos failed"); @@ -3649,7 +3650,7 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin pindex->nUndoPos = pos.nPos; pindex->nStatus |= BLOCK_HAVE_UNDO; } - + // Now that all consensus rules have been validated, set nCachedBranchId. // Move this if BLOCK_VALID_CONSENSUS is ever altered. static_assert(BLOCK_VALID_CONSENSUS == BLOCK_VALID_SCRIPTS, @@ -3660,7 +3661,7 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin } else if (pindex->pprev) { pindex->nCachedBranchId = pindex->pprev->nCachedBranchId; } - + pindex->RaiseValidity(BLOCK_VALID_SCRIPTS); setDirtyBlockIndex.insert(pindex); } From 00b0b26fd41cdf553082d8156b7863bdaf22e684 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 2 Mar 2019 02:25:57 -1100 Subject: [PATCH 082/119] -print --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 1d7a6f8b1..e0b2ec8bc 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3634,7 +3634,7 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin return true; // Write undo information to disk - fprintf(stderr,"nFile.%d isNull %d vs isvalid %d nStatus %x\n",(int32_t)pindex->nFile,pindex->GetUndoPos().IsNull(),pindex->IsValid(BLOCK_VALID_SCRIPTS),(uint32_t)pindex->nStatus); + //fprintf(stderr,"nFile.%d isNull %d vs isvalid %d nStatus %x\n",(int32_t)pindex->nFile,pindex->GetUndoPos().IsNull(),pindex->IsValid(BLOCK_VALID_SCRIPTS),(uint32_t)pindex->nStatus); if (pindex->GetUndoPos().IsNull() || !pindex->IsValid(BLOCK_VALID_SCRIPTS)) { if (pindex->GetUndoPos().IsNull()) From 1d0d663b920ca6899017afcf23eb1beb80e26a00 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 2 Mar 2019 02:33:02 -1100 Subject: [PATCH 083/119] Test --- src/main.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index e0b2ec8bc..b97f04f63 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3499,7 +3499,10 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin prevsum = voutsum; voutsum += valueout; if ( KOMODO_BIT63SET(voutsum) != 0 ) + { + fprintf(stderr,"voutsum %.8f too big\n",(double)voutsum/COIN); return state.DoS(100, error("ConnectBlock(): voutsum too big"),REJECT_INVALID,"tx valueout is too big"); + } else if ( voutsum < prevsum ) return state.DoS(100, error("ConnectBlock(): voutsum less after adding valueout"),REJECT_INVALID,"tx valueout is too big"); if (!tx.IsCoinBase()) From 0c03bfd48e491a591d62b48f6e8d2cd891ec8f8b Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 2 Mar 2019 02:40:49 -1100 Subject: [PATCH 084/119] -print --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index b97f04f63..1b88aecf7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2845,7 +2845,7 @@ namespace { hasher << hashBlock; hasher << blockundo; fileout << hasher.GetHash(); -fprintf(stderr,"hashBlock.%s hasher.%s\n",hashBlock.GetHex().c_str(),hasher.GetHash().GetHex().c_str()); +//fprintf(stderr,"hashBlock.%s hasher.%s\n",hashBlock.GetHex().c_str(),hasher.GetHash().GetHex().c_str()); return true; } From 16efbff11a7cae11be9466a506c121fc09db1356 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 2 Mar 2019 02:55:51 -1100 Subject: [PATCH 085/119] Billion at a time --- src/komodo_globals.h | 2 ++ src/komodo_utils.h | 13 +++++++++++-- src/main.cpp | 6 +++--- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/komodo_globals.h b/src/komodo_globals.h index 7370e8c70..551a61704 100644 --- a/src/komodo_globals.h +++ b/src/komodo_globals.h @@ -266,6 +266,8 @@ uint64_t komodo_current_supply(uint32_t nHeight) } #define KOMODO_MAXNVALUE (((uint64_t)1 << 63) - 1) #define KOMODO_BIT63SET(x) ((x) & ((uint64_t)1 << 63)) +#define KOMODO_VALUETOOBIG(x) ((x) > (uint64_t)10000000000) + if ( KOMODO_BIT63SET(cur_money) != 0 ) return(KOMODO_MAXNVALUE); if ( ASSETCHAINS_COMMISSION != 0 ) diff --git a/src/komodo_utils.h b/src/komodo_utils.h index 3b7d06401..4086af94c 100644 --- a/src/komodo_utils.h +++ b/src/komodo_utils.h @@ -1639,9 +1639,18 @@ uint64_t komodo_ac_block_subsidy(int nHeight) } } } - if ( nHeight == 1 ) + uint32_t magicExtra = ASSETCHAINS_STAKED ? ASSETCHAINS_MAGIC : (ASSETCHAINS_MAGIC & 0xffffff); + if ( ASSETCHAINS_SUPPLY > 1000000000 ) + { + if ( nHeight <= ASSETCHAINS_SUPPLY/1000000000 ) + { + subsidy = (uint64_t)1000000000 * COIN; + if ( nHeight == 1 ) + subsidy += magicExtra; + } + } + else if ( nHeight == 1 ) { - uint32_t magicExtra = ASSETCHAINS_STAKED ? ASSETCHAINS_MAGIC : (ASSETCHAINS_MAGIC & 0xffffff); if ( ASSETCHAINS_LASTERA == 0 ) subsidy = ASSETCHAINS_SUPPLY * SATOSHIDEN + magicExtra; else diff --git a/src/main.cpp b/src/main.cpp index 1b88aecf7..603ad054c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1808,7 +1808,7 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa CAmount nValueOut = tx.GetValueOut(); CAmount nFees = nValueIn-nValueOut; double dPriority = view.GetPriority(tx, chainActive.Height()); - if ( KOMODO_BIT63SET(nValueOut) != 0 ) + if ( KOMODO_VALUETOOBIG(nValueOut) != 0 ) return state.DoS(100, error("AcceptToMemoryPool: GetValueOut too big"),REJECT_INVALID,"tx valueout is too big"); // Keep track of transactions that spend a coinbase, which we re-scan @@ -3494,11 +3494,11 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin txdata.emplace_back(tx); valueout = tx.GetValueOut(); - if ( KOMODO_BIT63SET(valueout) != 0 ) + if ( KOMODO_VALUETOOBIG(valueout) != 0 ) return state.DoS(100, error("ConnectBlock(): GetValueOut too big"),REJECT_INVALID,"tx valueout is too big"); prevsum = voutsum; voutsum += valueout; - if ( KOMODO_BIT63SET(voutsum) != 0 ) + if ( KOMODO_VALUETOOBIG(voutsum) != 0 ) { fprintf(stderr,"voutsum %.8f too big\n",(double)voutsum/COIN); return state.DoS(100, error("ConnectBlock(): voutsum too big"),REJECT_INVALID,"tx valueout is too big"); From 36a8bd762f7fad8a42648a90ecfb5bfdbd8e7682 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 2 Mar 2019 03:09:51 -1100 Subject: [PATCH 086/119] +print --- src/miner.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/miner.cpp b/src/miner.cpp index a567e2e20..1e7d29ff1 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -621,7 +621,7 @@ CBlockTemplate* CreateNewBlock(CPubKey _pk,const CScript& _scriptPubKeyIn, int32 txNew.vout.resize(1); txNew.vout[0].scriptPubKey = scriptPubKeyIn; txNew.vout[0].nValue = GetBlockSubsidy(nHeight,consensusParams) + nFees; - + fprintf(stderr,"mine ht.%d with %.8f\n",(double)txNew.vout[0].nValue/COIN); txNew.nExpiryHeight = 0; txNew.nLockTime = std::max(pindexPrev->GetMedianTimePast()+1, GetAdjustedTime()); From 685b22266364e916a9a1be318e4ddad73711287f Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 2 Mar 2019 03:11:32 -1100 Subject: [PATCH 087/119] nHeight --- src/miner.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/miner.cpp b/src/miner.cpp index 1e7d29ff1..556efb090 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -621,7 +621,7 @@ CBlockTemplate* CreateNewBlock(CPubKey _pk,const CScript& _scriptPubKeyIn, int32 txNew.vout.resize(1); txNew.vout[0].scriptPubKey = scriptPubKeyIn; txNew.vout[0].nValue = GetBlockSubsidy(nHeight,consensusParams) + nFees; - fprintf(stderr,"mine ht.%d with %.8f\n",(double)txNew.vout[0].nValue/COIN); + fprintf(stderr,"mine ht.%d with %.8f\n",nHeight,(double)txNew.vout[0].nValue/COIN); txNew.nExpiryHeight = 0; txNew.nLockTime = std::max(pindexPrev->GetMedianTimePast()+1, GetAdjustedTime()); From 422b604ca59d6451b9aa8e61c5db07fc0b550a0e Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 2 Mar 2019 03:16:51 -1100 Subject: [PATCH 088/119] Test --- src/main.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 603ad054c..370e1e98b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3495,7 +3495,10 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin valueout = tx.GetValueOut(); if ( KOMODO_VALUETOOBIG(valueout) != 0 ) + { + fprintf(stderr,"valueout %.8f too big\n",(double)valueout/COIN); return state.DoS(100, error("ConnectBlock(): GetValueOut too big"),REJECT_INVALID,"tx valueout is too big"); + } prevsum = voutsum; voutsum += valueout; if ( KOMODO_VALUETOOBIG(voutsum) != 0 ) From de704db25fbbda344280b181be1ca09adb54c111 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 2 Mar 2019 03:19:41 -1100 Subject: [PATCH 089/119] Too big --- src/komodo_globals.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_globals.h b/src/komodo_globals.h index 551a61704..a752d0b8b 100644 --- a/src/komodo_globals.h +++ b/src/komodo_globals.h @@ -266,7 +266,7 @@ uint64_t komodo_current_supply(uint32_t nHeight) } #define KOMODO_MAXNVALUE (((uint64_t)1 << 63) - 1) #define KOMODO_BIT63SET(x) ((x) & ((uint64_t)1 << 63)) -#define KOMODO_VALUETOOBIG(x) ((x) > (uint64_t)10000000000) +#define KOMODO_VALUETOOBIG(x) ((x) > (uint64_t)10000000000*COIN) if ( KOMODO_BIT63SET(cur_money) != 0 ) return(KOMODO_MAXNVALUE); From e8afffb17b28bfb26878efa105b8d898e26e5ab0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 2 Mar 2019 03:27:25 -1100 Subject: [PATCH 090/119] Prevent miner from mining too big a block in txvalue --- src/miner.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/miner.cpp b/src/miner.cpp index 556efb090..eb7c2d185 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -173,7 +173,7 @@ CBlockTemplate* CreateNewBlock(CPubKey _pk,const CScript& _scriptPubKeyIn, int32 } } else pk = _pk; - uint64_t deposits; int32_t isrealtime,kmdheight; uint32_t blocktime; const CChainParams& chainparams = Params(); + uint64_t deposits,voutsum=0; int32_t isrealtime,kmdheight; uint32_t blocktime; const CChainParams& chainparams = Params(); bool fNotarisationBlock = false; std::vector NotarisationNotaries; //fprintf(stderr,"create new block\n"); @@ -221,6 +221,7 @@ CBlockTemplate* CreateNewBlock(CPubKey _pk,const CScript& _scriptPubKeyIn, int32 uint256 cbHash; + voutsum = GetBlockSubsidy(nHeight,consensusParams) + nFees; CBlockIndex* pindexPrev = 0; { ENTER_CRITICAL_SECTION(cs_main); @@ -270,7 +271,7 @@ CBlockTemplate* CreateNewBlock(CPubKey _pk,const CScript& _scriptPubKeyIn, int32 vecPriority.reserve(mempool.mapTx.size() + 1); // now add transactions from the mem pool - int32_t Notarisations = 0; + int32_t Notarisations = 0; uint64_t txvalue; for (CTxMemPool::indexed_transaction_set::iterator mi = mempool.mapTx.begin(); mi != mempool.mapTx.end(); ++mi) { @@ -285,7 +286,12 @@ CBlockTemplate* CreateNewBlock(CPubKey _pk,const CScript& _scriptPubKeyIn, int32 //fprintf(stderr,"coinbase.%d finaltx.%d expired.%d\n",tx.IsCoinBase(),IsFinalTx(tx, nHeight, nLockTimeCutoff),IsExpiredTx(tx, nHeight)); continue; } - + txvalue = tx.GetValueOut(); + if ( KOMODO_VALUETOOBIG(txvalue) != 0 ) + continue; + if ( KOMODO_VALUETOOBIG(txvalue + voutsum) != 0 ) + continue; + voutsum += txvalue; if ( ASSETCHAINS_SYMBOL[0] == 0 && komodo_validate_interest(tx,nHeight,(uint32_t)pblock->nTime,0) < 0 ) { //fprintf(stderr,"CreateNewBlock: komodo_validate_interest failure nHeight.%d nTime.%u vs locktime.%u\n",nHeight,(uint32_t)pblock->nTime,(uint32_t)tx.nLockTime); @@ -621,7 +627,7 @@ CBlockTemplate* CreateNewBlock(CPubKey _pk,const CScript& _scriptPubKeyIn, int32 txNew.vout.resize(1); txNew.vout[0].scriptPubKey = scriptPubKeyIn; txNew.vout[0].nValue = GetBlockSubsidy(nHeight,consensusParams) + nFees; - fprintf(stderr,"mine ht.%d with %.8f\n",nHeight,(double)txNew.vout[0].nValue/COIN); + //fprintf(stderr,"mine ht.%d with %.8f\n",nHeight,(double)txNew.vout[0].nValue/COIN); txNew.nExpiryHeight = 0; txNew.nLockTime = std::max(pindexPrev->GetMedianTimePast()+1, GetAdjustedTime()); From 1f4863694b87c1187943f1c58c3df356fc5469e8 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 2 Mar 2019 03:32:18 -1100 Subject: [PATCH 091/119] Move things --- src/komodo_defs.h | 4 ++++ src/komodo_globals.h | 6 +----- src/miner.cpp | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/komodo_defs.h b/src/komodo_defs.h index 2c3647b30..e1b941197 100644 --- a/src/komodo_defs.h +++ b/src/komodo_defs.h @@ -34,6 +34,10 @@ #define GETBIT(bits,bitoffset) (((uint8_t *)bits)[(bitoffset) >> 3] & (1 << ((bitoffset) & 7))) #define CLEARBIT(bits,bitoffset) (((uint8_t *)bits)[(bitoffset) >> 3] &= ~(1 << ((bitoffset) & 7))) +#define KOMODO_MAXNVALUE (((uint64_t)1 << 63) - 1) +#define KOMODO_BIT63SET(x) ((x) & ((uint64_t)1 << 63)) +#define KOMODO_VALUETOOBIG(x) ((x) > (uint64_t)10000000000*COIN) + extern uint8_t ASSETCHAINS_TXPOW,ASSETCHAINS_PUBLIC; int32_t MAX_BLOCK_SIZE(int32_t height); extern char ASSETCHAINS_SYMBOL[KOMODO_ASSETCHAIN_MAXLEN]; diff --git a/src/komodo_globals.h b/src/komodo_globals.h index a752d0b8b..44c12bdf4 100644 --- a/src/komodo_globals.h +++ b/src/komodo_globals.h @@ -263,11 +263,7 @@ uint64_t komodo_current_supply(uint32_t nHeight) } } } - } -#define KOMODO_MAXNVALUE (((uint64_t)1 << 63) - 1) -#define KOMODO_BIT63SET(x) ((x) & ((uint64_t)1 << 63)) -#define KOMODO_VALUETOOBIG(x) ((x) > (uint64_t)10000000000*COIN) - + } if ( KOMODO_BIT63SET(cur_money) != 0 ) return(KOMODO_MAXNVALUE); if ( ASSETCHAINS_COMMISSION != 0 ) diff --git a/src/miner.cpp b/src/miner.cpp index eb7c2d185..2069e5a8c 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -221,7 +221,6 @@ CBlockTemplate* CreateNewBlock(CPubKey _pk,const CScript& _scriptPubKeyIn, int32 uint256 cbHash; - voutsum = GetBlockSubsidy(nHeight,consensusParams) + nFees; CBlockIndex* pindexPrev = 0; { ENTER_CRITICAL_SECTION(cs_main); @@ -234,7 +233,8 @@ CBlockTemplate* CreateNewBlock(CPubKey _pk,const CScript& _scriptPubKeyIn, int32 const int64_t nMedianTimePast = pindexPrev->GetMedianTimePast(); uint32_t proposedTime = GetAdjustedTime(); - + voutsum = GetBlockSubsidy(nHeight,consensusParams) + 10000*COIN; // approx fees + if (proposedTime == nMedianTimePast) { // too fast or stuck, this addresses the too fast issue, while moving From 4a77a2d625b4d9ba1e6270eab2017379caf28f31 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 2 Mar 2019 03:35:56 -1100 Subject: [PATCH 092/119] Prevent too big tx to enter mempool --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 370e1e98b..08869080e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1808,7 +1808,7 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa CAmount nValueOut = tx.GetValueOut(); CAmount nFees = nValueIn-nValueOut; double dPriority = view.GetPriority(tx, chainActive.Height()); - if ( KOMODO_VALUETOOBIG(nValueOut) != 0 ) + if ( KOMODO_VALUETOOBIG(nValueOut - 777777*COIN) != 0 ) // some room for blockreward and txfees return state.DoS(100, error("AcceptToMemoryPool: GetValueOut too big"),REJECT_INVALID,"tx valueout is too big"); // Keep track of transactions that spend a coinbase, which we re-scan From 0ca3cae55691f96654c4f12cc5c0d923f544d1e5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 2 Mar 2019 03:43:08 -1100 Subject: [PATCH 093/119] Fix ac_subsidy calls --- src/komodo_utils.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/komodo_utils.h b/src/komodo_utils.h index 4086af94c..e8608c8bd 100644 --- a/src/komodo_utils.h +++ b/src/komodo_utils.h @@ -1644,9 +1644,9 @@ uint64_t komodo_ac_block_subsidy(int nHeight) { if ( nHeight <= ASSETCHAINS_SUPPLY/1000000000 ) { - subsidy = (uint64_t)1000000000 * COIN; + subsidy += (uint64_t)1000000000 * COIN; if ( nHeight == 1 ) - subsidy += magicExtra; + subsidy += (ASSETCHAINS_SUPPLY % 1000000000)*COIN + magicExtra; } } else if ( nHeight == 1 ) From f442acaeb6a6971ea5af00a72368dfc26538a3a0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 2 Mar 2019 04:15:55 -1100 Subject: [PATCH 094/119] > 10 billion exemption --- src/komodo_utils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_utils.h b/src/komodo_utils.h index e8608c8bd..34d1d8d4d 100644 --- a/src/komodo_utils.h +++ b/src/komodo_utils.h @@ -1640,7 +1640,7 @@ uint64_t komodo_ac_block_subsidy(int nHeight) } } uint32_t magicExtra = ASSETCHAINS_STAKED ? ASSETCHAINS_MAGIC : (ASSETCHAINS_MAGIC & 0xffffff); - if ( ASSETCHAINS_SUPPLY > 1000000000 ) + if ( ASSETCHAINS_SUPPLY > 10000000000 ) // over 10 billion? { if ( nHeight <= ASSETCHAINS_SUPPLY/1000000000 ) { From 92f2fe7cf05c561e1bc3858c753b3fad07d87a51 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 2 Mar 2019 04:20:03 -1100 Subject: [PATCH 095/119] Prevent > 10 billion for -ac_script/-ac_perc --- src/komodo_utils.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/komodo_utils.h b/src/komodo_utils.h index 34d1d8d4d..2c4a2d040 100644 --- a/src/komodo_utils.h +++ b/src/komodo_utils.h @@ -1896,6 +1896,11 @@ void komodo_args(char *argv0) } if ( strlen(ASSETCHAINS_OVERRIDE_PUBKEY.c_str()) == 66 || ASSETCHAINS_SCRIPTPUB.size() > 1 ) { + if ( ASSETCHAINS_SUPPLY > 10000000000 ) + { + printf("ac_pubkey or ac_script wont work with ac_supply over 10 billion\n"); + exit(0); + } if ( ASSETCHAINS_NOTARY_PAY[0] != 0 ) { printf("Assetchains NOTARY PAY cannot be used with ac_pubkey or ac_script.\n"); From c6322f54ec85bdef50bde970872cc1adbe82a45f Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 2 Mar 2019 05:18:27 -1100 Subject: [PATCH 096/119] Test slowflag --- src/komodo_bitcoind.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index b846ba9d1..53472ae63 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -2125,7 +2125,8 @@ int32_t komodo_checkPOW(int32_t slowflag,CBlock *pblock,int32_t height) return(-1); else { - bnTarget = komodo_PoWtarget(&PoSperc,bnTarget,height,ASSETCHAINS_STAKED); + if ( slowflag != 0 ) + bnTarget = komodo_PoWtarget(&PoSperc,bnTarget,height,ASSETCHAINS_STAKED); if ( bhash > bnTarget ) { for (i=31; i>=16; i--) From 845ce0b543a1c4f5cb851216eeebef6146aa5452 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 2 Mar 2019 05:30:10 -1100 Subject: [PATCH 097/119] Height 100 exception --- src/komodo_bitcoind.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index 53472ae63..70a1a7c02 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -2125,9 +2125,8 @@ int32_t komodo_checkPOW(int32_t slowflag,CBlock *pblock,int32_t height) return(-1); else { - if ( slowflag != 0 ) - bnTarget = komodo_PoWtarget(&PoSperc,bnTarget,height,ASSETCHAINS_STAKED); - if ( bhash > bnTarget ) + bnTarget = komodo_PoWtarget(&PoSperc,bnTarget,height,ASSETCHAINS_STAKED); + if ( bhash > bnTarget && height > 100 ) { for (i=31; i>=16; i--) fprintf(stderr,"%02x",((uint8_t *)&bhash)[i]); @@ -2136,7 +2135,8 @@ int32_t komodo_checkPOW(int32_t slowflag,CBlock *pblock,int32_t height) fprintf(stderr,"%02x",((uint8_t *)&bnTarget)[i]); fprintf(stderr," ht.%d PoW diff violation PoSperc.%d vs goalperc.%d\n",height,PoSperc,(int32_t)ASSETCHAINS_STAKED); return(-1); - } else + } + else { failed = 0; CBlockIndex *pindex; From 37086fe0a7a831360c3869862d5492426bb4d75e Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 2 Mar 2019 05:44:38 -1100 Subject: [PATCH 098/119] Fix mempool acceptance bug --- src/cc/dilithium.c | 2 +- src/main.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cc/dilithium.c b/src/cc/dilithium.c index 4841eb981..eb2b78ecc 100644 --- a/src/cc/dilithium.c +++ b/src/cc/dilithium.c @@ -2944,7 +2944,7 @@ int32_t dilithium_Qmsghash(uint8_t *msg,CTransaction tx,std::vector vou for (i=0; i 777777*COIN && KOMODO_VALUETOOBIG(nValueOut - 777777*COIN) != 0 ) // some room for blockreward and txfees return state.DoS(100, error("AcceptToMemoryPool: GetValueOut too big"),REJECT_INVALID,"tx valueout is too big"); // Keep track of transactions that spend a coinbase, which we re-scan From 76bb0a23608502b341b0a3d795486a541e5d1cb0 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 2 Mar 2019 07:41:09 -1100 Subject: [PATCH 099/119] +print --- src/komodo_globals.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/komodo_globals.h b/src/komodo_globals.h index 44c12bdf4..0abe48ace 100644 --- a/src/komodo_globals.h +++ b/src/komodo_globals.h @@ -264,6 +264,7 @@ uint64_t komodo_current_supply(uint32_t nHeight) } } } + fprintf(stderr,"cur_money %.8f\n",(double)cur_money/COIN); if ( KOMODO_BIT63SET(cur_money) != 0 ) return(KOMODO_MAXNVALUE); if ( ASSETCHAINS_COMMISSION != 0 ) From 1d692f4df361c88bce7527fd22dc643f128dc6c2 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 2 Mar 2019 07:45:06 -1100 Subject: [PATCH 100/119] Fix maxmoney estimate for acPErc --- src/komodo_globals.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_globals.h b/src/komodo_globals.h index 0abe48ace..0eaa430a3 100644 --- a/src/komodo_globals.h +++ b/src/komodo_globals.h @@ -269,7 +269,7 @@ uint64_t komodo_current_supply(uint32_t nHeight) return(KOMODO_MAXNVALUE); if ( ASSETCHAINS_COMMISSION != 0 ) { - uint64_t newval = (cur_money + (cur_money * ASSETCHAINS_COMMISSION)); + uint64_t newval = (cur_money + (cur_money * ASSETCHAINS_COMMISSION)/COIN); if ( KOMODO_BIT63SET(newval) != 0 ) return(KOMODO_MAXNVALUE); else if ( newval < cur_money ) // check for underflow From ef8df0fd1bab6d0c61f9470acce3b62c4c9cba99 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 2 Mar 2019 07:49:37 -1100 Subject: [PATCH 101/119] +print --- src/komodo_globals.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/komodo_globals.h b/src/komodo_globals.h index 0eaa430a3..096b31a37 100644 --- a/src/komodo_globals.h +++ b/src/komodo_globals.h @@ -169,7 +169,9 @@ uint64_t komodo_current_supply(uint32_t nHeight) if (!period) { // no halving, straight multiply + fprintf(stderr,"cur_money %.8f += %.8f * %d\n",(double)cur_money/COIN,(double)reward/COIN,nHeight); cur_money += reward * (nHeight - 1); + fprintf(stderr,"cur_money %.8f\n",(double)cur_money/COIN); } // if exactly SATOSHIDEN, linear decay to zero or to next era, same as: // (next_era_reward + (starting reward - next_era_reward) / 2) * num_blocks @@ -264,12 +266,11 @@ uint64_t komodo_current_supply(uint32_t nHeight) } } } - fprintf(stderr,"cur_money %.8f\n",(double)cur_money/COIN); if ( KOMODO_BIT63SET(cur_money) != 0 ) return(KOMODO_MAXNVALUE); if ( ASSETCHAINS_COMMISSION != 0 ) { - uint64_t newval = (cur_money + (cur_money * ASSETCHAINS_COMMISSION)/COIN); + uint64_t newval = (cur_money + (cur_money/COIN * ASSETCHAINS_COMMISSION)); if ( KOMODO_BIT63SET(newval) != 0 ) return(KOMODO_MAXNVALUE); else if ( newval < cur_money ) // check for underflow From 022cfeee63839ca1dded623ff626ed1316373f2d Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 2 Mar 2019 07:54:50 -1100 Subject: [PATCH 102/119] +print --- src/komodo_globals.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/komodo_globals.h b/src/komodo_globals.h index 096b31a37..72f0ebbb7 100644 --- a/src/komodo_globals.h +++ b/src/komodo_globals.h @@ -134,9 +134,9 @@ uint64_t komodo_current_supply(uint32_t nHeight) uint64_t cur_money; int32_t baseid; - if ( (baseid = komodo_baseid(ASSETCHAINS_SYMBOL)) >= 0 && baseid < 32 ) - cur_money = ASSETCHAINS_GENESISTXVAL + ASSETCHAINS_SUPPLY + nHeight * ASSETCHAINS_REWARD[0] / SATOSHIDEN; - else + //if ( (baseid = komodo_baseid(ASSETCHAINS_SYMBOL)) >= 0 && baseid < 32 ) + // cur_money = ASSETCHAINS_GENESISTXVAL + ASSETCHAINS_SUPPLY + nHeight * ASSETCHAINS_REWARD[0] / SATOSHIDEN; + //else { // figure out max_money by adding up supply to a maximum of 10,000,000 blocks cur_money = (ASSETCHAINS_SUPPLY+1) * SATOSHIDEN + (ASSETCHAINS_MAGIC & 0xffffff) + ASSETCHAINS_GENESISTXVAL; @@ -155,6 +155,8 @@ uint64_t komodo_current_supply(uint32_t nHeight) // add rewards from this era, up to nHeight int64_t reward = ASSETCHAINS_REWARD[j]; + + fprintf(stderr,"last.%d reward %llu period %llu\n",ASSETCHAINS_LASTERA,(long long)reward,(long long)ASSETCHAINS_HALVING[j]); if ( reward > 0 ) { uint64_t lastEnd = j == 0 ? 0 : ASSETCHAINS_ENDSUBSIDY[j - 1]; From 25109df8ec4ce187e38a06c67f2927bcfd1c75d4 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 2 Mar 2019 07:57:19 -1100 Subject: [PATCH 103/119] Test --- src/komodo_globals.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/komodo_globals.h b/src/komodo_globals.h index 72f0ebbb7..13ec6eb80 100644 --- a/src/komodo_globals.h +++ b/src/komodo_globals.h @@ -156,7 +156,7 @@ uint64_t komodo_current_supply(uint32_t nHeight) // add rewards from this era, up to nHeight int64_t reward = ASSETCHAINS_REWARD[j]; - fprintf(stderr,"last.%d reward %llu period %llu\n",ASSETCHAINS_LASTERA,(long long)reward,(long long)ASSETCHAINS_HALVING[j]); + fprintf(stderr,"last.%d reward %llu period %llu\n",(int32_t)ASSETCHAINS_LASTERA,(long long)reward,(long long)ASSETCHAINS_HALVING[j]); if ( reward > 0 ) { uint64_t lastEnd = j == 0 ? 0 : ASSETCHAINS_ENDSUBSIDY[j - 1]; @@ -168,10 +168,10 @@ uint64_t komodo_current_supply(uint32_t nHeight) uint32_t modulo = (curEnd - lastEnd) % period; uint64_t decay = ASSETCHAINS_DECAY[j]; + fprintf(stderr,"period.%llu cur_money %.8f += %.8f * %d\n",(long long)period,(double)cur_money/COIN,(double)reward/COIN,nHeight); if (!period) { // no halving, straight multiply - fprintf(stderr,"cur_money %.8f += %.8f * %d\n",(double)cur_money/COIN,(double)reward/COIN,nHeight); cur_money += reward * (nHeight - 1); fprintf(stderr,"cur_money %.8f\n",(double)cur_money/COIN); } From 9b9f61566d9198c9ebc25eb2ab916a84f8cecab1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 2 Mar 2019 08:00:58 -1100 Subject: [PATCH 104/119] Fix maxmoney calc for period 0 chains --- src/komodo_globals.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_globals.h b/src/komodo_globals.h index 13ec6eb80..0cc5ab6f8 100644 --- a/src/komodo_globals.h +++ b/src/komodo_globals.h @@ -169,7 +169,7 @@ uint64_t komodo_current_supply(uint32_t nHeight) uint64_t decay = ASSETCHAINS_DECAY[j]; fprintf(stderr,"period.%llu cur_money %.8f += %.8f * %d\n",(long long)period,(double)cur_money/COIN,(double)reward/COIN,nHeight); - if (!period) + if ( ASSETCHAINS_HALVING[j] == 0 ) { // no halving, straight multiply cur_money += reward * (nHeight - 1); From 729edc4e80bb7095dfc72300f565c3c5f196eb34 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 2 Mar 2019 08:03:10 -1100 Subject: [PATCH 105/119] -print --- src/komodo_globals.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/komodo_globals.h b/src/komodo_globals.h index 0cc5ab6f8..69ad6b840 100644 --- a/src/komodo_globals.h +++ b/src/komodo_globals.h @@ -156,7 +156,7 @@ uint64_t komodo_current_supply(uint32_t nHeight) // add rewards from this era, up to nHeight int64_t reward = ASSETCHAINS_REWARD[j]; - fprintf(stderr,"last.%d reward %llu period %llu\n",(int32_t)ASSETCHAINS_LASTERA,(long long)reward,(long long)ASSETCHAINS_HALVING[j]); + //fprintf(stderr,"last.%d reward %llu period %llu\n",(int32_t)ASSETCHAINS_LASTERA,(long long)reward,(long long)ASSETCHAINS_HALVING[j]); if ( reward > 0 ) { uint64_t lastEnd = j == 0 ? 0 : ASSETCHAINS_ENDSUBSIDY[j - 1]; @@ -168,12 +168,12 @@ uint64_t komodo_current_supply(uint32_t nHeight) uint32_t modulo = (curEnd - lastEnd) % period; uint64_t decay = ASSETCHAINS_DECAY[j]; - fprintf(stderr,"period.%llu cur_money %.8f += %.8f * %d\n",(long long)period,(double)cur_money/COIN,(double)reward/COIN,nHeight); + //fprintf(stderr,"period.%llu cur_money %.8f += %.8f * %d\n",(long long)period,(double)cur_money/COIN,(double)reward/COIN,nHeight); if ( ASSETCHAINS_HALVING[j] == 0 ) { // no halving, straight multiply cur_money += reward * (nHeight - 1); - fprintf(stderr,"cur_money %.8f\n",(double)cur_money/COIN); + //fprintf(stderr,"cur_money %.8f\n",(double)cur_money/COIN); } // if exactly SATOSHIDEN, linear decay to zero or to next era, same as: // (next_era_reward + (starting reward - next_era_reward) / 2) * num_blocks @@ -279,6 +279,6 @@ uint64_t komodo_current_supply(uint32_t nHeight) return(KOMODO_MAXNVALUE); return(newval); } - fprintf(stderr,"cur_money %.8f\n",(double)cur_money/COIN); + //fprintf(stderr,"cur_money %.8f\n",(double)cur_money/COIN); return(cur_money); } From 164b718ccd44755437b9f3b1f527838e00817692 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 2 Mar 2019 09:19:05 -1100 Subject: [PATCH 106/119] Truncate next file --- src/cc/rogue/rogue.c | 2 +- src/cc/rogue_rpc.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cc/rogue/rogue.c b/src/cc/rogue/rogue.c index 90045f083..8406684c7 100644 --- a/src/cc/rogue/rogue.c +++ b/src/cc/rogue/rogue.c @@ -141,7 +141,7 @@ int32_t flushkeystrokes_local(struct rogue_state *rs,int32_t waitflag) fprintf(stderr," first part rnd.%d\n",rnd(1000)); fclose(fp); } - roguefname(fname,rs->seed,rs->counter); + roguefname(fname,rs->seed,rs->counter+1); if ( (fp= fopen(fname,"wb")) != 0 ) // truncate next file fclose(fp); //fprintf(stderr,"savefile <- %s retflag.%d\n",fname,retflag); diff --git a/src/cc/rogue_rpc.cpp b/src/cc/rogue_rpc.cpp index 93eb22dc8..c5370309d 100644 --- a/src/cc/rogue_rpc.cpp +++ b/src/cc/rogue_rpc.cpp @@ -1315,7 +1315,7 @@ UniValue rogue_gameinfo(uint64_t txfee,struct CCcontract_info *cp,cJSON *params) rogue_gameplayerinfo(cp,obj,txid,tx,i+1,maxplayers,myrogueaddr); a.push_back(obj); } - else + else if ( 0 ) { sprintf(str,"vout %d+1 is unspent",i); result.push_back(Pair("unspent",str)); From e3de4fd2ef5465b8b48fe4ab136639e037347093 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 2 Mar 2019 20:06:11 -1100 Subject: [PATCH 107/119] +print --- src/cc/dilithium.c | 19 ++++++++++++++++++- src/cc/rogue/rogue.c | 8 ++++---- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/cc/dilithium.c b/src/cc/dilithium.c index eb2b78ecc..f646b53c4 100644 --- a/src/cc/dilithium.c +++ b/src/cc/dilithium.c @@ -2940,11 +2940,17 @@ int32_t dilithium_Qmsghash(uint8_t *msg,CTransaction tx,std::vector vou { vintxids.push_back(tx.vin[i].prevout.hash); vinprevns.push_back(tx.vin[i].prevout.n); + fprintf(stderr,"%s/v%d ",tx.vin[i].prevout.hash.GetHex().c_str(),tx.vin[i].prevout.n); } for (i=0; iInvalid("failed dilithium verify"); else if ( mlen != 32 || memcmp(msg,msg2,32) != 0 ) + { + for (i=0; i<32; i++) + fprintf(stderr,"%02x",msg[i]); + fprintf(stderr," vs "); + for (i=0; iInvalid("failed dilithium msg verify"); + } else return true; } } else return eval->Invalid("failed decode Qsend"); diff --git a/src/cc/rogue/rogue.c b/src/cc/rogue/rogue.c index 8406684c7..ca0c92343 100644 --- a/src/cc/rogue/rogue.c +++ b/src/cc/rogue/rogue.c @@ -131,21 +131,21 @@ int32_t flushkeystrokes_local(struct rogue_state *rs,int32_t waitflag) rs->num = 0; retflag = 0; fclose(fp); - if ( (fp= fopen("savefile","wb")) != 0 ) + /*if ( (fp= fopen("savefile","wb")) != 0 ) { - //save_file(rs,fp,0); + save_file(rs,fp,0); if ( 0 && (fp= fopen("savefile","rb")) != 0 ) { for (i=0; i<0x150; i++) fprintf(stderr,"%02x",fgetc(fp)); fprintf(stderr," first part rnd.%d\n",rnd(1000)); fclose(fp); - } + }*/ roguefname(fname,rs->seed,rs->counter+1); if ( (fp= fopen(fname,"wb")) != 0 ) // truncate next file fclose(fp); //fprintf(stderr,"savefile <- %s retflag.%d\n",fname,retflag); - } + //} } else fprintf(stderr,"error writing (%s)\n",fname); } else fprintf(stderr,"error creating (%s)\n",fname); return(retflag); From b544ed791ca0aeb51a122e79becb6337f37b12da Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 2 Mar 2019 20:16:46 -1100 Subject: [PATCH 108/119] Typo --- src/cc/dilithium.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cc/dilithium.c b/src/cc/dilithium.c index f646b53c4..9dcc69b40 100644 --- a/src/cc/dilithium.c +++ b/src/cc/dilithium.c @@ -3446,8 +3446,8 @@ bool dilithium_Qvalidate(struct CCcontract_info *cp,int32_t height,Eval *eval,co fprintf(stderr,"%02x",msg[i]); fprintf(stderr," vs "); for (i=0; iInvalid("failed dilithium msg verify"); } else return true; From 1a87dd883c53a057fbe39a3306cb67e162222a47 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 2 Mar 2019 20:21:49 -1100 Subject: [PATCH 109/119] Recalc Qmsg --- src/cc/dilithium.c | 44 ++++++++++++++++++++------------------------ 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/src/cc/dilithium.c b/src/cc/dilithium.c index 9dcc69b40..da4576582 100644 --- a/src/cc/dilithium.c +++ b/src/cc/dilithium.c @@ -2929,32 +2929,28 @@ int32_t main(void) void calc_rmd160_sha256(uint8_t rmd160[20],uint8_t *data,int32_t datalen); char *bitcoin_address(char *coinaddr,uint8_t addrtype,uint8_t *pubkey_or_rmd160,int32_t len); -int32_t dilithium_Qmsghash(uint8_t *msg,CTransaction tx,std::vector voutpubtxids) +int32_t dilithium_Qmsghash(uint8_t *msg,CTransaction tx,int32_t numvouts,std::vector voutpubtxids) { CScript data; uint256 hash; int32_t i,numvins,numvouts,len = 0; std::vector vintxids; std::vector vinprevns; std::vector vouts; numvins = tx.vin.size(); - numvouts = tx.vout.size(); - if ( tx.vout[numvouts-1].scriptPubKey[0] == 0x6a ) + for (i=0; i bigpub) @@ -3373,7 +3369,7 @@ UniValue dilithium_Qsend(uint64_t txfee,struct CCcontract_info *cp,cJSON *params voutpubtxids.push_back(mypubtxid); } tx = mtx; - dilithium_Qmsghash(msg,tx,voutpubtxids); + dilithium_Qmsghash(msg,tx,(int32_t)voutpubtxids.size(),voutpubtxids); for (i=0; i<32; i++) fprintf(stderr,"%02x",msg[i]); fprintf(stderr," msg\n"); @@ -3432,7 +3428,7 @@ bool dilithium_Qvalidate(struct CCcontract_info *cp,int32_t height,Eval *eval,co numvouts = tx.vout.size(); if ( dilithium_Qsendopretdecode(destpubtxid,sig,voutpubtxids,tx.vout[numvouts-1].scriptPubKey) == 'Q' && destpubtxid == signerpubtxid && sig.size() == smlen ) { - if ( dilithium_Qmsghash(msg,tx,voutpubtxids) < 0 ) + if ( dilithium_Qmsghash(msg,tx,numvouts-1,voutpubtxids) < 0 ) return eval->Invalid("couldnt get Qmsghash"); else if ( dilithium_bigpubget(handle,destpub33,pk,signerpubtxid) < 0 ) return eval->Invalid("couldnt get bigpub"); From e54f9c4850a648212eb9dd45e2ec23a0a6e59883 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 2 Mar 2019 20:25:59 -1100 Subject: [PATCH 110/119] Nnumvouts --- src/cc/dilithium.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cc/dilithium.c b/src/cc/dilithium.c index da4576582..0b7ccd667 100644 --- a/src/cc/dilithium.c +++ b/src/cc/dilithium.c @@ -2931,7 +2931,7 @@ char *bitcoin_address(char *coinaddr,uint8_t addrtype,uint8_t *pubkey_or_rmd160, int32_t dilithium_Qmsghash(uint8_t *msg,CTransaction tx,int32_t numvouts,std::vector voutpubtxids) { - CScript data; uint256 hash; int32_t i,numvins,numvouts,len = 0; std::vector vintxids; std::vector vinprevns; std::vector vouts; + CScript data; uint256 hash; int32_t i,numvins,len = 0; std::vector vintxids; std::vector vinprevns; std::vector vouts; numvins = tx.vin.size(); for (i=0; i Date: Sat, 2 Mar 2019 20:28:02 -1100 Subject: [PATCH 111/119] -print --- src/cc/dilithium.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/cc/dilithium.c b/src/cc/dilithium.c index 0b7ccd667..e36ea807e 100644 --- a/src/cc/dilithium.c +++ b/src/cc/dilithium.c @@ -2937,17 +2937,17 @@ int32_t dilithium_Qmsghash(uint8_t *msg,CTransaction tx,int32_t numvouts,std::ve { vintxids.push_back(tx.vin[i].prevout.hash); vinprevns.push_back(tx.vin[i].prevout.n); - fprintf(stderr,"%s/v%d ",tx.vin[i].prevout.hash.GetHex().c_str(),tx.vin[i].prevout.n); + //fprintf(stderr,"%s/v%d ",tx.vin[i].prevout.hash.GetHex().c_str(),tx.vin[i].prevout.n); } for (i=0; i Date: Sat, 2 Mar 2019 21:39:07 -1100 Subject: [PATCH 112/119] +msg --- src/main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.cpp b/src/main.cpp index f2d733a62..83762eaf7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4276,6 +4276,7 @@ static bool ActivateBestChainStep(CValidationState &state, CBlockIndex *pindexMo ASSETCHAINS_SYMBOL,pindexFork->phashBlock->GetHex(), pindexFork->GetHeight()) + "\n\n" + _("Please help, human!"); LogPrintf("*** %s\nif you launch with -maxreorg=%d it might be able to resolve this automatically", msg,reorgLength+10); + fprintf(stderr,"*** %s\nif you launch with -maxreorg=%d it might be able to resolve this automatically", msg,reorgLength+10); uiInterface.ThreadSafeMessageBox(msg, "", CClientUIInterface::MSG_ERROR); StartShutdown(); return false; From 78f4a6c6271259c4574b75d237804d2aa5b0dab7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 2 Mar 2019 21:40:46 -1100 Subject: [PATCH 113/119] c_str() --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 83762eaf7..8e836ffa0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4276,7 +4276,7 @@ static bool ActivateBestChainStep(CValidationState &state, CBlockIndex *pindexMo ASSETCHAINS_SYMBOL,pindexFork->phashBlock->GetHex(), pindexFork->GetHeight()) + "\n\n" + _("Please help, human!"); LogPrintf("*** %s\nif you launch with -maxreorg=%d it might be able to resolve this automatically", msg,reorgLength+10); - fprintf(stderr,"*** %s\nif you launch with -maxreorg=%d it might be able to resolve this automatically", msg,reorgLength+10); + fprintf(stderr,"*** %s\nif you launch with -maxreorg=%d it might be able to resolve this automatically", msg.c_str(),reorgLength+10); uiInterface.ThreadSafeMessageBox(msg, "", CClientUIInterface::MSG_ERROR); StartShutdown(); return false; From 548c2819750936bf4b4c29806e3f8e60577b66bb Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 2 Mar 2019 22:34:28 -1100 Subject: [PATCH 114/119] Extract zombies for comparison --- src/cc/rogue/main.c | 6 + src/cc/rogue/passages.c | 416 ++++++++++++++++++++-------------------- src/cc/rogue/rings.c | 128 ++++++------- src/cc/rogue/rogue.c | 18 +- src/cc/rogue_rpc.cpp | 8 +- 5 files changed, 296 insertions(+), 280 deletions(-) diff --git a/src/cc/rogue/main.c b/src/cc/rogue/main.c index 7b68aa49e..eeb085192 100644 --- a/src/cc/rogue/main.c +++ b/src/cc/rogue/main.c @@ -235,6 +235,7 @@ int32_t safecopy(char *dest,char *src,long len) #endif int32_t rogue_replay(uint64_t seed,int32_t sleeptime); +char *rogue_keystrokesload(int32_t *numkeysp,uint64_t seed,int32_t counter); int rogue(int argc, char **argv, char **envp); void *OS_loadfile(char *fname,uint8_t **bufp,long *lenp,long *allocsizep) @@ -762,6 +763,11 @@ void rogue_progress(struct rogue_state *rs,int32_t waitflag,uint64_t seed,char * } free(rs->keystrokeshex), rs->keystrokeshex = 0; } + if ( (pastkeys= rogue_keystrokesload(&numpastkeys,seed,1)) != 0 ) + { + free(pastkeys); + } + for (i=0; iisconn[j] = FALSE; - r1->ingraph = FALSE; + for (j = 0; j < MAXROOMS; j++) + r1->isconn[j] = FALSE; + r1->ingraph = FALSE; } - + /* * starting with one room, connect it to a random adjacent room and * then pick a new room to start with. @@ -61,65 +61,65 @@ do_passages(struct rogue_state *rs) r1->ingraph = TRUE; do { - /* - * find a room to connect with - */ - j = 0; - for (i = 0; i < MAXROOMS; i++) - if (r1->conn[i] && !rdes[i].ingraph && rnd(++j) == 0) - r2 = &rdes[i]; - /* - * if no adjacent rooms are outside the graph, pick a new room - * to look from - */ - if (j == 0) - { - do - r1 = &rdes[rnd(MAXROOMS)]; - until (r1->ingraph); - } - /* - * otherwise, connect new room to the graph, and draw a tunnel - * to it - */ - else - { - r2->ingraph = TRUE; - i = (int)(r1 - rdes); - j = (int)(r2 - rdes); - conn(rs,i, j); - r1->isconn[j] = TRUE; - r2->isconn[i] = TRUE; - roomcount++; - } + /* + * find a room to connect with + */ + j = 0; + for (i = 0; i < MAXROOMS; i++) + if (r1->conn[i] && !rdes[i].ingraph && rnd(++j) == 0) + r2 = &rdes[i]; + /* + * if no adjacent rooms are outside the graph, pick a new room + * to look from + */ + if (j == 0) + { + do + r1 = &rdes[rnd(MAXROOMS)]; + until (r1->ingraph); + } + /* + * otherwise, connect new room to the graph, and draw a tunnel + * to it + */ + else + { + r2->ingraph = TRUE; + i = (int)(r1 - rdes); + j = (int)(r2 - rdes); + conn(rs,i, j); + r1->isconn[j] = TRUE; + r2->isconn[i] = TRUE; + roomcount++; + } } while (roomcount < MAXROOMS); - + /* * attempt to add passages to the graph a random number of times so * that there isn't always just one unique passage through it. */ for (roomcount = rnd(5); roomcount > 0; roomcount--) { - r1 = &rdes[rnd(MAXROOMS)]; /* a random room to look from */ - /* - * find an adjacent room not already connected - */ - j = 0; - for (i = 0; i < MAXROOMS; i++) - if (r1->conn[i] && !r1->isconn[i] && rnd(++j) == 0) - r2 = &rdes[i]; - /* - * if there is one, connect it and look for the next added - * passage - */ - if (j != 0) - { - i = (int)(r1 - rdes); - j = (int)(r2 - rdes); - conn(rs,i, j); - r1->isconn[j] = TRUE; - r2->isconn[i] = TRUE; - } + r1 = &rdes[rnd(MAXROOMS)]; /* a random room to look from */ + /* + * find an adjacent room not already connected + */ + j = 0; + for (i = 0; i < MAXROOMS; i++) + if (r1->conn[i] && !r1->isconn[i] && rnd(++j) == 0) + r2 = &rdes[i]; + /* + * if there is one, connect it and look for the next added + * passage + */ + if (j != 0) + { + i = (int)(r1 - rdes); + j = (int)(r2 - rdes); + conn(rs,i, j); + r1->isconn[j] = TRUE; + r2->isconn[i] = TRUE; + } } passnum(); } @@ -138,22 +138,22 @@ conn(struct rogue_state *rs,int r1, int r2) int rm; char direc; static coord del, curr, turn_delta, spos, epos; - + if (r1 < r2) { - rm = r1; - if (r1 + 1 == r2) - direc = 'r'; - else - direc = 'd'; + rm = r1; + if (r1 + 1 == r2) + direc = 'r'; + else + direc = 'd'; } else { - rm = r2; - if (r2 + 1 == r1) - direc = 'r'; - else - direc = 'd'; + rm = r2; + if (r2 + 1 == r1) + direc = 'r'; + else + direc = 'd'; } rpf = &rooms[rm]; /* @@ -162,75 +162,75 @@ conn(struct rogue_state *rs,int r1, int r2) */ if (direc == 'd') { - rmt = rm + 3; /* room # of dest */ - rpt = &rooms[rmt]; /* room pointer of dest */ - del.x = 0; /* direction of move */ - del.y = 1; - spos.x = rpf->r_pos.x; /* start of move */ - spos.y = rpf->r_pos.y; - epos.x = rpt->r_pos.x; /* end of move */ - epos.y = rpt->r_pos.y; - if (!(rpf->r_flags & ISGONE)) /* if not gone pick door pos */ - do - { - spos.x = rpf->r_pos.x + rnd(rpf->r_max.x - 2) + 1; - spos.y = rpf->r_pos.y + rpf->r_max.y - 1; - } while ((rpf->r_flags&ISMAZE) && !(flat(spos.y, spos.x)&F_PASS)); - if (!(rpt->r_flags & ISGONE)) - do - { - epos.x = rpt->r_pos.x + rnd(rpt->r_max.x - 2) + 1; - } while ((rpt->r_flags&ISMAZE) && !(flat(epos.y, epos.x)&F_PASS)); - distance = abs(spos.y - epos.y) - 1; /* distance to move */ - turn_delta.y = 0; /* direction to turn */ - turn_delta.x = (spos.x < epos.x ? 1 : -1); - turn_distance = abs(spos.x - epos.x); /* how far to turn */ + rmt = rm + 3; /* room # of dest */ + rpt = &rooms[rmt]; /* room pointer of dest */ + del.x = 0; /* direction of move */ + del.y = 1; + spos.x = rpf->r_pos.x; /* start of move */ + spos.y = rpf->r_pos.y; + epos.x = rpt->r_pos.x; /* end of move */ + epos.y = rpt->r_pos.y; + if (!(rpf->r_flags & ISGONE)) /* if not gone pick door pos */ + do + { + spos.x = rpf->r_pos.x + rnd(rpf->r_max.x - 2) + 1; + spos.y = rpf->r_pos.y + rpf->r_max.y - 1; + } while ((rpf->r_flags&ISMAZE) && !(flat(spos.y, spos.x)&F_PASS)); + if (!(rpt->r_flags & ISGONE)) + do + { + epos.x = rpt->r_pos.x + rnd(rpt->r_max.x - 2) + 1; + } while ((rpt->r_flags&ISMAZE) && !(flat(epos.y, epos.x)&F_PASS)); + distance = abs(spos.y - epos.y) - 1; /* distance to move */ + turn_delta.y = 0; /* direction to turn */ + turn_delta.x = (spos.x < epos.x ? 1 : -1); + turn_distance = abs(spos.x - epos.x); /* how far to turn */ } else if (direc == 'r') /* setup for moving right */ { - rmt = rm + 1; - rpt = &rooms[rmt]; - del.x = 1; - del.y = 0; - spos.x = rpf->r_pos.x; - spos.y = rpf->r_pos.y; - epos.x = rpt->r_pos.x; - epos.y = rpt->r_pos.y; - if (!(rpf->r_flags & ISGONE)) - do - { - spos.x = rpf->r_pos.x + rpf->r_max.x - 1; - spos.y = rpf->r_pos.y + rnd(rpf->r_max.y - 2) + 1; - } while ((rpf->r_flags&ISMAZE) && !(flat(spos.y, spos.x)&F_PASS)); - if (!(rpt->r_flags & ISGONE)) - do - { - epos.y = rpt->r_pos.y + rnd(rpt->r_max.y - 2) + 1; - } while ((rpt->r_flags&ISMAZE) && !(flat(epos.y, epos.x)&F_PASS)); - distance = abs(spos.x - epos.x) - 1; - turn_delta.y = (spos.y < epos.y ? 1 : -1); - turn_delta.x = 0; - turn_distance = abs(spos.y - epos.y); + rmt = rm + 1; + rpt = &rooms[rmt]; + del.x = 1; + del.y = 0; + spos.x = rpf->r_pos.x; + spos.y = rpf->r_pos.y; + epos.x = rpt->r_pos.x; + epos.y = rpt->r_pos.y; + if (!(rpf->r_flags & ISGONE)) + do + { + spos.x = rpf->r_pos.x + rpf->r_max.x - 1; + spos.y = rpf->r_pos.y + rnd(rpf->r_max.y - 2) + 1; + } while ((rpf->r_flags&ISMAZE) && !(flat(spos.y, spos.x)&F_PASS)); + if (!(rpt->r_flags & ISGONE)) + do + { + epos.y = rpt->r_pos.y + rnd(rpt->r_max.y - 2) + 1; + } while ((rpt->r_flags&ISMAZE) && !(flat(epos.y, epos.x)&F_PASS)); + distance = abs(spos.x - epos.x) - 1; + turn_delta.y = (spos.y < epos.y ? 1 : -1); + turn_delta.x = 0; + turn_distance = abs(spos.y - epos.y); } #ifdef MASTER else - debug("error in connection tables"); + debug("error in connection tables"); #endif - + turn_spot = rnd(distance - 1) + 1; /* where turn starts */ - + /* * Draw in the doors on either side of the passage or just put #'s * if the rooms are gone. */ if (!(rpf->r_flags & ISGONE)) - door(rpf, &spos); + door(rpf, &spos); else - putpass(&spos); + putpass(&spos); if (!(rpt->r_flags & ISGONE)) - door(rpt, &epos); + door(rpt, &epos); else - putpass(&epos); + putpass(&epos); /* * Get ready to move... */ @@ -238,31 +238,31 @@ conn(struct rogue_state *rs,int r1, int r2) curr.y = spos.y; while (distance > 0) { - /* - * Move to new position - */ - curr.x += del.x; - curr.y += del.y; - /* - * Check if we are at the turn place, if so do the turn - */ - if (distance == turn_spot) - while (turn_distance--) - { - putpass(&curr); - curr.x += turn_delta.x; - curr.y += turn_delta.y; - } - /* - * Continue digging along - */ - putpass(&curr); - distance--; + /* + * Move to new position + */ + curr.x += del.x; + curr.y += del.y; + /* + * Check if we are at the turn place, if so do the turn + */ + if (distance == turn_spot) + while (turn_distance--) + { + putpass(&curr); + curr.x += turn_delta.x; + curr.y += turn_delta.y; + } + /* + * Continue digging along + */ + putpass(&curr); + distance--; } curr.x += del.x; curr.y += del.y; if (!ce(curr, epos)) - msg(rs,"warning, connectivity problem on this level"); + msg(rs,"warning, connectivity problem on this level"); } /* @@ -274,13 +274,13 @@ void putpass(coord *cp) { PLACE *pp; - + pp = INDEX(cp->y, cp->x); pp->p_flags |= F_PASS; if (rnd(10) + 1 < level && rnd(40) == 0) - pp->p_flags &= ~F_REAL; + pp->p_flags &= ~F_REAL; else - pp->p_ch = PASSAGE; + pp->p_ch = PASSAGE; } /* @@ -293,23 +293,23 @@ void door(struct room *rm, coord *cp) { PLACE *pp; - + rm->r_exit[rm->r_nexits++] = *cp; - + if (rm->r_flags & ISMAZE) - return; - + return; + pp = INDEX(cp->y, cp->x); if (rnd(10) + 1 < level && rnd(5) == 0) { - if (cp->y == rm->r_pos.y || cp->y == rm->r_pos.y + rm->r_max.y - 1) - pp->p_ch = '-'; - else - pp->p_ch = '|'; - pp->p_flags &= ~F_REAL; + if (cp->y == rm->r_pos.y || cp->y == rm->r_pos.y + rm->r_max.y - 1) + pp->p_ch = '-'; + else + pp->p_ch = '|'; + pp->p_flags &= ~F_REAL; } else - pp->p_ch = DOOR; + pp->p_ch = DOOR; } #ifdef MASTER @@ -324,31 +324,31 @@ add_pass() PLACE *pp; int y, x; char ch; - + for (y = 1; y < NUMLINES - 1; y++) - for (x = 0; x < NUMCOLS; x++) - { - pp = INDEX(y, x); - if ((pp->p_flags & F_PASS) || pp->p_ch == DOOR || - (!(pp->p_flags&F_REAL) && (pp->p_ch == '|' || pp->p_ch == '-'))) - { - ch = pp->p_ch; - if (pp->p_flags & F_PASS) - ch = PASSAGE; - pp->p_flags |= F_SEEN; - move(y, x); - if (pp->p_monst != NULL) - pp->p_monst->t_oldch = pp->p_ch; - else if (pp->p_flags & F_REAL) - addch(ch); - else - { - standout(); - addch((pp->p_flags & F_PASS) ? PASSAGE : DOOR); - standend(); - } - } - } + for (x = 0; x < NUMCOLS; x++) + { + pp = INDEX(y, x); + if ((pp->p_flags & F_PASS) || pp->p_ch == DOOR || + (!(pp->p_flags&F_REAL) && (pp->p_ch == '|' || pp->p_ch == '-'))) + { + ch = pp->p_ch; + if (pp->p_flags & F_PASS) + ch = PASSAGE; + pp->p_flags |= F_SEEN; + move(y, x); + if (pp->p_monst != NULL) + pp->p_monst->t_oldch = pp->p_ch; + else if (pp->p_flags & F_REAL) + addch(ch); + else + { + standout(); + addch((pp->p_flags & F_PASS) ? PASSAGE : DOOR); + standend(); + } + } + } } #endif @@ -365,17 +365,17 @@ passnum() { struct room *rp; int i; - + pnum = 0; newpnum = FALSE; for (rp = passages; rp < &passages[MAXPASS]; rp++) - rp->r_nexits = 0; + rp->r_nexits = 0; for (rp = rooms; rp < &rooms[MAXROOMS]; rp++) - for (i = 0; i < rp->r_nexits; i++) - { - newpnum ^= 1;//newpnum++; - numpass(rp->r_exit[i].y, rp->r_exit[i].x); - } + for (i = 0; i < rp->r_nexits; i++) + { + newpnum ^= 1;//newpnum++; + numpass(rp->r_exit[i].y, rp->r_exit[i].x); + } } /* @@ -389,30 +389,30 @@ numpass(int y, int x) char *fp; struct room *rp; char ch; - + if (x >= NUMCOLS || x < 0 || y >= NUMLINES || y <= 0) - return; + return; fp = &flat(y, x); if (*fp & F_PNUM) - return; + return; if (newpnum) { - pnum++; - newpnum = FALSE; + pnum++; + newpnum = FALSE; } /* * check to see if it is a door or secret door, i.e., a new exit, * or a numerable type of place */ if ((ch = chat(y, x)) == DOOR || - (!(*fp & F_REAL) && (ch == '|' || ch == '-'))) + (!(*fp & F_REAL) && (ch == '|' || ch == '-'))) { - rp = &passages[pnum]; - rp->r_exit[rp->r_nexits].y = y; - rp->r_exit[rp->r_nexits++].x = x; + rp = &passages[pnum]; + rp->r_exit[rp->r_nexits].y = y; + rp->r_exit[rp->r_nexits++].x = x; } else if (!(*fp & F_PASS)) - return; + return; *fp |= pnum; /* * recurse on the surrounding places diff --git a/src/cc/rogue/rings.c b/src/cc/rogue/rings.c index af6cc881b..f9ce50795 100644 --- a/src/cc/rogue/rings.c +++ b/src/cc/rogue/rings.c @@ -23,65 +23,65 @@ ring_on(struct rogue_state *rs) { THING *obj; int ring; - + obj = get_item(rs,"put on", RING); /* * Make certain that it is somethings that we want to wear */ if (obj == NULL) - return; + return; if (obj->o_type != RING) { - if (!terse) - msg(rs,"it would be difficult to wrap that around a finger"); - else - msg(rs,"not a ring"); - return; + if (!terse) + msg(rs,"it would be difficult to wrap that around a finger"); + else + msg(rs,"not a ring"); + return; } - + /* * find out which hand to put it on */ if (is_current(rs,obj)) - return; - + return; + if (cur_ring[LEFT] == NULL && cur_ring[RIGHT] == NULL) { - if ((ring = gethand(rs)) < 0) - return; + if ((ring = gethand(rs)) < 0) + return; } else if (cur_ring[LEFT] == NULL) - ring = LEFT; + ring = LEFT; else if (cur_ring[RIGHT] == NULL) - ring = RIGHT; + ring = RIGHT; else { - if (!terse) - msg(rs,"you already have a ring on each hand"); - else - msg(rs,"wearing two"); - return; + if (!terse) + msg(rs,"you already have a ring on each hand"); + else + msg(rs,"wearing two"); + return; } cur_ring[ring] = obj; - + /* * Calculate the effect it has on the poor guy. */ switch (obj->o_which) { - case R_ADDSTR: - chg_str(obj->o_arm); - break; - case R_SEEINVIS: - invis_on(); - break; - case R_AGGR: - aggravate(rs); - break; + case R_ADDSTR: + chg_str(obj->o_arm); + break; + case R_SEEINVIS: + invis_on(); + break; + case R_AGGR: + aggravate(rs); + break; } - + if (!terse) - addmsg(rs,"you are now wearing "); + addmsg(rs,"you are now wearing "); msg(rs,"%s (%c)", inv_name(obj, TRUE), obj->o_packch); } @@ -95,31 +95,31 @@ ring_off(struct rogue_state *rs) { int ring; THING *obj; - + if (cur_ring[LEFT] == NULL && cur_ring[RIGHT] == NULL) { - if (terse) - msg(rs,"no rings"); - else - msg(rs,"you aren't wearing any rings"); - return; + if (terse) + msg(rs,"no rings"); + else + msg(rs,"you aren't wearing any rings"); + return; } else if (cur_ring[LEFT] == NULL) - ring = RIGHT; + ring = RIGHT; else if (cur_ring[RIGHT] == NULL) - ring = LEFT; + ring = LEFT; else - if ((ring = gethand(rs)) < 0) - return; + if ((ring = gethand(rs)) < 0) + return; mpos = 0; obj = cur_ring[ring]; if (obj == NULL) { - msg(rs,"not wearing such a ring"); - return; + msg(rs,"not wearing such a ring"); + return; } if (dropcheck(rs,obj)) - msg(rs,"was wearing %s(%c)", inv_name(obj, TRUE), obj->o_packch); + msg(rs,"was wearing %s(%c)", inv_name(obj, TRUE), obj->o_packch); } /* @@ -163,21 +163,21 @@ ring_eat(int hand) THING *ring; int eat; static int uses[] = { - 1, /* R_PROTECT */ 1, /* R_ADDSTR */ - 1, /* R_SUSTSTR */ -3, /* R_SEARCH */ - -5, /* R_SEEINVIS */ 0, /* R_NOP */ - 0, /* R_AGGR */ -3, /* R_ADDHIT */ - -3, /* R_ADDDAM */ 2, /* R_REGEN */ - -2, /* R_DIGEST */ 0, /* R_TELEPORT */ - 1, /* R_STEALTH */ 1 /* R_SUSTARM */ + 1, /* R_PROTECT */ 1, /* R_ADDSTR */ + 1, /* R_SUSTSTR */ -3, /* R_SEARCH */ + -5, /* R_SEEINVIS */ 0, /* R_NOP */ + 0, /* R_AGGR */ -3, /* R_ADDHIT */ + -3, /* R_ADDDAM */ 2, /* R_REGEN */ + -2, /* R_DIGEST */ 0, /* R_TELEPORT */ + 1, /* R_STEALTH */ 1 /* R_SUSTARM */ }; - + if ((ring = cur_ring[hand]) == NULL) - return 0; + return 0; if ((eat = uses[ring->o_which]) < 0) - eat = (rnd(-eat) == 0); + eat = (rnd(-eat) == 0); if (ring->o_which == R_DIGEST) - eat = -eat; + eat = -eat; return eat; } @@ -189,18 +189,18 @@ char * ring_num(THING *obj) { static char buf[10]; - + if (!(obj->o_flags & ISKNOW)) - return ""; + return ""; switch (obj->o_which) { - case R_PROTECT: - case R_ADDSTR: - case R_ADDDAM: - case R_ADDHIT: - sprintf(buf, " [%s]", num(obj->o_arm, 0, RING)); - otherwise: - return ""; + case R_PROTECT: + case R_ADDSTR: + case R_ADDDAM: + case R_ADDHIT: + sprintf(buf, " [%s]", num(obj->o_arm, 0, RING)); + otherwise: + return ""; } return buf; } diff --git a/src/cc/rogue/rogue.c b/src/cc/rogue/rogue.c index ca0c92343..57890207b 100644 --- a/src/cc/rogue/rogue.c +++ b/src/cc/rogue/rogue.c @@ -254,11 +254,10 @@ long get_filesize(FILE *fp) return(fsize); } -int32_t rogue_replay(uint64_t seed,int32_t sleeptime) +char *rogue_keystrokesload(int32_t *numkeysp,uint64_t seed,int32_t counter) { - FILE *fp; char fname[1024]; char *keystrokes = 0; long num=0,fsize; int32_t i,counter = 0; struct rogue_state *rs; struct rogue_player P,*player = 0; - if ( seed == 0 ) - seed = 777; + char fname[1024],*keystrokes = 0; FILE *fp; long fsize; int32_t num = 0; + *numkeysp = 0; while ( 1 ) { roguefname(fname,seed,counter); @@ -288,6 +287,16 @@ int32_t rogue_replay(uint64_t seed,int32_t sleeptime) counter++; fprintf(stderr,"loaded %ld from (%s) total %ld\n",fsize,fname,num); } + *numkeysp = num; + return(keystrokes); +} + +int32_t rogue_replay(uint64_t seed,int32_t sleeptime) +{ + FILE *fp; char fname[1024]; char *keystrokes = 0; long num=0,fsize; int32_t i,counter = 0; struct rogue_state *rs; struct rogue_player P,*player = 0; + if ( seed == 0 ) + seed = 777; + keystrokes = rogue_keystrokesload(&num,seed,counter); if ( num > 0 ) { sprintf(fname,"rogue.%llu.player",(long long)seed); @@ -301,7 +310,6 @@ int32_t rogue_replay(uint64_t seed,int32_t sleeptime) fclose(fp); } rogue_replay2(0,seed,keystrokes,num,player,sleeptime); - mvaddstr(LINES - 2, 0, (char *)"replay completed"); endwin(); my_exit(0); diff --git a/src/cc/rogue_rpc.cpp b/src/cc/rogue_rpc.cpp index c5370309d..dce56f6a1 100644 --- a/src/cc/rogue_rpc.cpp +++ b/src/cc/rogue_rpc.cpp @@ -978,16 +978,18 @@ char *rogue_extractgame(int32_t makefiles,char *str,int32_t *numkeysp,std::vecto } if ( endP.gold <= 0 || endP.hitpoints <= 0 || (endP.strength&0xffff) <= 0 || endP.level <= 0 || endP.experience <= 0 || endP.dungeonlevel <= 0 ) { - fprintf(stderr,"zero value character was killed -> no playerdata\n"); + sprintf(str,"zero value character was killed -> no playerdata\n"); newdata.resize(0); - //P.gold = (P.gold * 8) / 10; + *numkeysp = numkeys; + return(keystrokes); + /* P.gold = (P.gold * 8) / 10; if ( keystrokes != 0 ) { free(keystrokes); keystrokes = 0; *numkeysp = 0; return(keystrokes); - } + }*/ } else { From 59725a3c3e47ee54cb068735360ae5b063dda2f7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 2 Mar 2019 22:36:38 -1100 Subject: [PATCH 115/119] Syntax --- src/cc/rogue/main.c | 2 +- src/cc/rogue/rogue.c | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/cc/rogue/main.c b/src/cc/rogue/main.c index eeb085192..4e6221aa1 100644 --- a/src/cc/rogue/main.c +++ b/src/cc/rogue/main.c @@ -742,7 +742,7 @@ int32_t rogue_sendrawtransaction(char *rawtx) void rogue_progress(struct rogue_state *rs,int32_t waitflag,uint64_t seed,char *keystrokes,int32_t num) { - char cmd[16384],hexstr[16384],params[32768],*retstr,*rawtx; int32_t i; cJSON *retjson; + char cmd[16384],hexstr[16384],params[32768],*retstr,*rawtx,*pastkeys; int32_t i,numpastkeys; cJSON *retjson; //fprintf(stderr,"rogue_progress num.%d\n",num); if ( rs->guiflag != 0 && Gametxidstr[0] != 0 ) { diff --git a/src/cc/rogue/rogue.c b/src/cc/rogue/rogue.c index 57890207b..478e3d2ed 100644 --- a/src/cc/rogue/rogue.c +++ b/src/cc/rogue/rogue.c @@ -274,18 +274,19 @@ char *rogue_keystrokesload(int32_t *numkeysp,uint64_t seed,int32_t counter) { fprintf(stderr,"error reallocating keystrokes\n"); fclose(fp); - return(-1); + return(0); } if ( fread(&keystrokes[num],1,fsize,fp) != fsize ) { fprintf(stderr,"error reading keystrokes from (%s)\n",fname); fclose(fp); - return(-1); + free(keystrokes); + return(0); } fclose(fp); num += fsize; counter++; - fprintf(stderr,"loaded %ld from (%s) total %ld\n",fsize,fname,num); + fprintf(stderr,"loaded %ld from (%s) total %d\n",fsize,fname,num); } *numkeysp = num; return(keystrokes); @@ -293,7 +294,7 @@ char *rogue_keystrokesload(int32_t *numkeysp,uint64_t seed,int32_t counter) int32_t rogue_replay(uint64_t seed,int32_t sleeptime) { - FILE *fp; char fname[1024]; char *keystrokes = 0; long num=0,fsize; int32_t i,counter = 0; struct rogue_state *rs; struct rogue_player P,*player = 0; + FILE *fp; char fname[1024]; char *keystrokes = 0; long fsize; int32_t i,num=0,counter = 0; struct rogue_state *rs; struct rogue_player P,*player = 0; if ( seed == 0 ) seed = 777; keystrokes = rogue_keystrokesload(&num,seed,counter); From 11800949cf914e5158d1ad49f04c3cd5cb1ed61b Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 2 Mar 2019 23:57:21 -1100 Subject: [PATCH 116/119] Token fill shouldn't be invalid --- src/cc/rogue_rpc.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cc/rogue_rpc.cpp b/src/cc/rogue_rpc.cpp index dce56f6a1..e7e809807 100644 --- a/src/cc/rogue_rpc.cpp +++ b/src/cc/rogue_rpc.cpp @@ -1544,10 +1544,12 @@ bool rogue_validate(struct CCcontract_info *cp,int32_t height,Eval *eval,const C if ( rogue_playerdata_validate(&cashout,ptxid,cp,playerdata,gametxid,pk) < 0 ) { fprintf(stderr,"ht.%d gametxid.%s player.%s invalid playerdata[%d]\n",height,gametxid.GetHex().c_str(),ptxid.GetHex().c_str(),(int32_t)playerdata.size()); + if ( enabled != 0 ) + return eval->Invalid("mismatched playerdata"); } if ( funcid == 'H' ) cashout *= 2; - if ( tx.vout.size() > 3 ) // orig of 't' has 0 cashout + if ( tokentx == 0 ) { static char laststr[512]; char cashstr[512]; sprintf(cashstr,"ht.%d txid.%s %d,%d %.8f vs vout2 %.8f",height,txid.GetHex().c_str(),tokentx,decoded,(double)cashout/COIN,(double)tx.vout[2].nValue/COIN); From e12cf5ad4fa5e88ea7f6793761284aeef3883e32 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 2 Mar 2019 23:58:43 -1100 Subject: [PATCH 117/119] Cache prints --- src/cc/rogue_rpc.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/cc/rogue_rpc.cpp b/src/cc/rogue_rpc.cpp index e7e809807..af1cd9a43 100644 --- a/src/cc/rogue_rpc.cpp +++ b/src/cc/rogue_rpc.cpp @@ -1541,9 +1541,15 @@ bool rogue_validate(struct CCcontract_info *cp,int32_t height,Eval *eval,const C // verify pk belongs to this tx if ( playerdata.size() > 0 ) { + static char laststr[512]; char cashstr[512]; if ( rogue_playerdata_validate(&cashout,ptxid,cp,playerdata,gametxid,pk) < 0 ) { - fprintf(stderr,"ht.%d gametxid.%s player.%s invalid playerdata[%d]\n",height,gametxid.GetHex().c_str(),ptxid.GetHex().c_str(),(int32_t)playerdata.size()); + sprintf(cashstr,"ht.%d gametxid.%s player.%s invalid playerdata[%d]\n",height,gametxid.GetHex().c_str(),ptxid.GetHex().c_str(),(int32_t)playerdata.size()); + if ( strcmp(laststr,cashstr) != 0 ) + { + strcpy(laststr,cashstr); + fprintf(stderr,"%s\n",cashstr); + } if ( enabled != 0 ) return eval->Invalid("mismatched playerdata"); } @@ -1551,7 +1557,6 @@ bool rogue_validate(struct CCcontract_info *cp,int32_t height,Eval *eval,const C cashout *= 2; if ( tokentx == 0 ) { - static char laststr[512]; char cashstr[512]; sprintf(cashstr,"ht.%d txid.%s %d,%d %.8f vs vout2 %.8f",height,txid.GetHex().c_str(),tokentx,decoded,(double)cashout/COIN,(double)tx.vout[2].nValue/COIN); if ( strcmp(laststr,cashstr) != 0 ) { From 66644afe27762540fa96d72f38fabb9e64b94f70 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 3 Mar 2019 00:07:42 -1100 Subject: [PATCH 118/119] Pritns --- src/cc/rogue_rpc.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cc/rogue_rpc.cpp b/src/cc/rogue_rpc.cpp index af1cd9a43..3318e4dc9 100644 --- a/src/cc/rogue_rpc.cpp +++ b/src/cc/rogue_rpc.cpp @@ -1544,7 +1544,7 @@ bool rogue_validate(struct CCcontract_info *cp,int32_t height,Eval *eval,const C static char laststr[512]; char cashstr[512]; if ( rogue_playerdata_validate(&cashout,ptxid,cp,playerdata,gametxid,pk) < 0 ) { - sprintf(cashstr,"ht.%d gametxid.%s player.%s invalid playerdata[%d]\n",height,gametxid.GetHex().c_str(),ptxid.GetHex().c_str(),(int32_t)playerdata.size()); + sprintf(cashstr,"tokentx.%d decoded.%d ht.%d gametxid.%s player.%s invalid playerdata[%d]\n",tokentx,decoded,height,gametxid.GetHex().c_str(),ptxid.GetHex().c_str(),(int32_t)playerdata.size()); if ( strcmp(laststr,cashstr) != 0 ) { strcpy(laststr,cashstr); @@ -1555,15 +1555,15 @@ bool rogue_validate(struct CCcontract_info *cp,int32_t height,Eval *eval,const C } if ( funcid == 'H' ) cashout *= 2; - if ( tokentx == 0 ) + //if ( tokentx == 0 ) { - sprintf(cashstr,"ht.%d txid.%s %d,%d %.8f vs vout2 %.8f",height,txid.GetHex().c_str(),tokentx,decoded,(double)cashout/COIN,(double)tx.vout[2].nValue/COIN); + sprintf(cashstr,"tokentx.%d decoded.%d ht.%d txid.%s %d,%d %.8f vs vout2 %.8f",tokentx,decoded,height,txid.GetHex().c_str(),tokentx,decoded,(double)cashout/COIN,(double)tx.vout[2].nValue/COIN); if ( strcmp(laststr,cashstr) != 0 ) { strcpy(laststr,cashstr); fprintf(stderr,"%s\n",cashstr); } - if ( enabled != 0 && tx.vout[2].nValue != cashout ) + if ( tokentx == 0 && enabled != 0 && tx.vout[2].nValue != cashout ) return eval->Invalid("mismatched cashout amount"); } } From 71fbf19c478ca7afc43a7d6fac501eae7201d6f5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 3 Mar 2019 00:11:34 -1100 Subject: [PATCH 119/119] Test --- src/cc/rogue_rpc.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cc/rogue_rpc.cpp b/src/cc/rogue_rpc.cpp index 3318e4dc9..b690a583e 100644 --- a/src/cc/rogue_rpc.cpp +++ b/src/cc/rogue_rpc.cpp @@ -1468,7 +1468,7 @@ bool rogue_validate(struct CCcontract_info *cp,int32_t height,Eval *eval,const C funcid = script[1]; if ( (e= script[0]) == EVAL_TOKENS ) { - tokentx = 1; + tokentx = funcid; if ( (funcid= rogue_highlanderopretdecode(gametxid,tokenid,regslot,pk,playerdata,symbol,pname,scriptPubKey)) == 0 ) { if ( (funcid= rogue_registeropretdecode(gametxid,tokenid,playertxid,scriptPubKey)) == 0 ) @@ -1544,7 +1544,7 @@ bool rogue_validate(struct CCcontract_info *cp,int32_t height,Eval *eval,const C static char laststr[512]; char cashstr[512]; if ( rogue_playerdata_validate(&cashout,ptxid,cp,playerdata,gametxid,pk) < 0 ) { - sprintf(cashstr,"tokentx.%d decoded.%d ht.%d gametxid.%s player.%s invalid playerdata[%d]\n",tokentx,decoded,height,gametxid.GetHex().c_str(),ptxid.GetHex().c_str(),(int32_t)playerdata.size()); + sprintf(cashstr,"tokentx.(%c) decoded.%d ht.%d gametxid.%s player.%s invalid playerdata[%d]\n",tokentx,decoded,height,gametxid.GetHex().c_str(),ptxid.GetHex().c_str(),(int32_t)playerdata.size()); if ( strcmp(laststr,cashstr) != 0 ) { strcpy(laststr,cashstr); @@ -1557,7 +1557,7 @@ bool rogue_validate(struct CCcontract_info *cp,int32_t height,Eval *eval,const C cashout *= 2; //if ( tokentx == 0 ) { - sprintf(cashstr,"tokentx.%d decoded.%d ht.%d txid.%s %d,%d %.8f vs vout2 %.8f",tokentx,decoded,height,txid.GetHex().c_str(),tokentx,decoded,(double)cashout/COIN,(double)tx.vout[2].nValue/COIN); + sprintf(cashstr,"tokentx.(%c) decoded.%d ht.%d txid.%s %d,%d %.8f vs vout2 %.8f",tokentx,decoded,height,txid.GetHex().c_str(),tokentx,decoded,(double)cashout/COIN,(double)tx.vout[2].nValue/COIN); if ( strcmp(laststr,cashstr) != 0 ) { strcpy(laststr,cashstr);