diff --git a/Dockerfile b/Dockerfile index 7e639b16f..a0334a6f6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html FROM ubuntu:16.04 diff --git a/Makefile.am b/Makefile.am index 48c498853..01c95f8b7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,4 @@ -# Copyright 2016-2022 The Hush developers +# Copyright 2016-2023 The Hush developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html @@ -247,6 +247,9 @@ DISTCHECK_CONFIGURE_FLAGS = --enable-man clean-local: rm -rf test_bitcoin.coverage/ total.coverage/ +seeds: + ./contrib/seeds/generate-seeds.py contrib/seeds > src/chainparamsseeds.h + manpages: ./util/gen-manpages.sh @echo "Please review the man pages changes to see if they look correct, then commit and push" diff --git a/README.md b/README.md index 23ad9ffeb..2a2bd9431 100644 --- a/README.md +++ b/README.md @@ -42,9 +42,11 @@ Please refer to the instructions which apply to you below: If you have an older wallet, then refer to [OLD_WALLETS.md](OLD_WALLETS.md). -### Official Explorer +### Official Explorers -The link for the Official Hush explorer is: [explorer.hush.is](https://explorer.hush.is) +The links for the Official Hush explorers: + * [explorer.hush.is](https://explorer.hush.is) + * [explorer.hush.land](https://explorer.hush.land) We are looking for alternate explorers to be run on Tor, i2P and other TLDs, if you are interested please join Telegram and ask questions. diff --git a/autogen.sh b/autogen.sh index 2aa9ad130..3bb329a96 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html set -e diff --git a/build.sh b/build.sh index 1a2d1c8a0..7bdf5f93d 100755 --- a/build.sh +++ b/build.sh @@ -1,7 +1,19 @@ #!/usr/bin/env bash -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html set -eu -o pipefail -./util/build.sh --disable-tests $@ + +# run correct build script for detected OS +if [[ "$OSTYPE" == "linux-gnu"* ]]; then + ./util/build.sh --disable-tests $@ +elif [[ "$OSTYPE" == "darwin"* ]]; then + ./util/build-mac.sh --disable-tests $@ +elif [[ "$OSTYPE" == "msys"* ]]; then + ./util/build-win.sh --disable-tests $@ +#elif [[ "$OSTYPE" == "freebsd"* ]]; then + # placeholder +else + echo "Unable to detect your OS. What are you using?" +fi diff --git a/configure.ac b/configure.ac index e863c6384..aa424d534 100644 --- a/configure.ac +++ b/configure.ac @@ -1,13 +1,14 @@ dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N) AC_PREREQ([2.60]) define(_CLIENT_VERSION_MAJOR, 3) +dnl Must be kept in sync with src/clientversion.h , ugh! define(_CLIENT_VERSION_MINOR, 9) -define(_CLIENT_VERSION_REVISION, 2) +define(_CLIENT_VERSION_REVISION, 3) define(_CLIENT_VERSION_BUILD, 50) define(_ZC_BUILD_VAL, m4_if(m4_eval(_CLIENT_VERSION_BUILD < 25), 1, m4_incr(_CLIENT_VERSION_BUILD), m4_eval(_CLIENT_VERSION_BUILD < 50), 1, m4_eval(_CLIENT_VERSION_BUILD - 24), m4_eval(_CLIENT_VERSION_BUILD == 50), 1, , m4_eval(_CLIENT_VERSION_BUILD - 50))) define(_CLIENT_VERSION_SUFFIX, m4_if(m4_eval(_CLIENT_VERSION_BUILD < 25), 1, _CLIENT_VERSION_REVISION-beta$1, m4_eval(_CLIENT_VERSION_BUILD < 50), 1, _CLIENT_VERSION_REVISION-rc$1, m4_eval(_CLIENT_VERSION_BUILD == 50), 1, _CLIENT_VERSION_REVISION, _CLIENT_VERSION_REVISION-$1))) define(_CLIENT_VERSION_IS_RELEASE, true) -define(_COPYRIGHT_YEAR, 2021) +define(_COPYRIGHT_YEAR, 2023) AC_INIT([Hush],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_SUFFIX(_ZC_BUILD_VAL)],[https://git.hush.is/hush/hush3],[hush]) AC_CONFIG_SRCDIR([src/main.cpp]) AC_CONFIG_HEADERS([src/config/bitcoin-config.h]) @@ -221,6 +222,29 @@ if test "x$CXXFLAGS_overridden" = "xno"; then AX_CHECK_COMPILE_FLAG([-Wunused-local-typedef],[CXXFLAGS="$CXXFLAGS -Wno-unused-local-typedef"],,[[$CXXFLAG_WERROR]]) AX_CHECK_COMPILE_FLAG([-Wdeprecated-register],[CXXFLAGS="$CXXFLAGS -Wno-deprecated-register"],,[[$CXXFLAG_WERROR]]) fi + +TEMP_CXXFLAGS="$CXXFLAGS" +CXXFLAGS="$CXXFLAGS $SSE42_CXXFLAGS" +AC_MSG_CHECKING(for assembler crc32 support) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #include + #if defined(_MSC_VER) + #include + #elif defined(__GNUC__) && defined(__SSE4_2__) + #include + #endif + ]],[[ + uint64_t l = 0; + l = _mm_crc32_u8(l, 0); + l = _mm_crc32_u32(l, 0); + l = _mm_crc32_u64(l, 0); + return l; + ]])], + [ AC_MSG_RESULT(yes); enable_hwcrc32=yes], + [ AC_MSG_RESULT(no)] +) +CXXFLAGS="$TEMP_CXXFLAGS" + CPPFLAGS="$CPPFLAGS -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS" AC_ARG_WITH([utils], @@ -241,6 +265,16 @@ AC_ARG_WITH([daemon], [build_bitcoind=$withval], [build_bitcoind=yes]) +GCC_TARGET=`$CC -dumpmachine 2>&1` +case $GCC_TARGET in + arm*-*-*) + have_arm=true + ;; + aarch64*-*-*) + have_arm=true + ;; +esac + use_pkgconfig=yes case $host in *mingw*) @@ -709,7 +743,7 @@ fi # These packages don't provide pkgconfig config files across all # platforms, so we use older autoconf detection mechanisms: AC_CHECK_HEADER([gmp.h],,AC_MSG_ERROR(libgmp headers missing)) -AC_CHECK_LIB([gmp],[[__gmpn_sub_n]],GMP_LIBS=-lgmp, [AC_MSG_ERROR(libgmp missing)]) +#AC_CHECK_LIB([gmp],[[__gmpn_sub_n]],GMP_LIBS=-lgmp, [AC_MSG_ERROR(libgmp missing)]) AC_CHECK_HEADER([gmpxx.h],,AC_MSG_ERROR(libgmpxx headers missing)) AC_CHECK_LIB([gmpxx],[main],GMPXX_LIBS=-lgmpxx, [AC_MSG_ERROR(libgmpxx missing)]) @@ -815,6 +849,7 @@ AM_CONDITIONAL([TARGET_WINDOWS], [test x$TARGET_OS = xwindows]) AM_CONDITIONAL([ENABLE_WALLET],[test x$enable_wallet = xyes]) AM_CONDITIONAL([ENABLE_MINING],[test x$enable_mining = xyes]) AM_CONDITIONAL([ENABLE_TESTS],[test x$BUILD_TEST = xyes]) +AM_CONDITIONAL([ARCH_ARM], [test x$have_arm = xtrue]) AM_CONDITIONAL([USE_LCOV],[test x$use_lcov = xyes]) AM_CONDITIONAL([GLIBC_BACK_COMPAT],[test x$use_glibc_compat = xyes]) AM_CONDITIONAL([HARDEN],[test x$use_hardening = xyes]) diff --git a/contrib/block_time.pl b/contrib/block_time.pl index 9e980ea29..1b7c6a914 100755 --- a/contrib/block_time.pl +++ b/contrib/block_time.pl @@ -1,5 +1,5 @@ #!/usr/bin/env perl -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html use warnings; diff --git a/contrib/fresh_clone_compile_and_run.sh b/contrib/fresh_clone_compile_and_run.sh index a895f3cc3..5566e4474 100755 --- a/contrib/fresh_clone_compile_and_run.sh +++ b/contrib/fresh_clone_compile_and_run.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/contrib/gen-zaddrs.pl b/contrib/gen-zaddrs.pl index ccf8e8e78..801cc680a 100755 --- a/contrib/gen-zaddrs.pl +++ b/contrib/gen-zaddrs.pl @@ -1,5 +1,5 @@ #!/usr/bin/env perl -# Copyright 2019-2022 The Hush developers +# Copyright 2019-2023 The Hush developers # Released under the GPLv3 use warnings; use strict; diff --git a/contrib/hush_halvings b/contrib/hush_halvings index cfb899ced..4d93cfce4 100755 --- a/contrib/hush_halvings +++ b/contrib/hush_halvings @@ -1,5 +1,5 @@ #!/usr/bin/env perl -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Released under the GPLv3 use strict; diff --git a/contrib/hush_scanner b/contrib/hush_scanner index af4ee4144..5f92586f5 100755 --- a/contrib/hush_scanner +++ b/contrib/hush_scanner @@ -1,5 +1,5 @@ #!/usr/bin/env perl -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html use strict; diff --git a/contrib/hush_supply b/contrib/hush_supply index ef78fef3c..8f3705d81 100755 --- a/contrib/hush_supply +++ b/contrib/hush_supply @@ -1,5 +1,5 @@ #!/usr/bin/env perl -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Released under the GPLv3 use warnings; use strict; diff --git a/contrib/init/hushd.conf b/contrib/init/hushd.conf index 649df7796..eb26f3fdb 100644 --- a/contrib/init/hushd.conf +++ b/contrib/init/hushd.conf @@ -35,12 +35,6 @@ pre-start script echo echo "bash -c 'tr -dc a-zA-Z0-9 < /dev/urandom | head -c32 && echo'" echo - echo "It is also recommended that you also set alertnotify so you are " - echo "notified of problems:" - echo - echo "ie: alertnotify=echo %%s | mail -s \"Hush Alert\"" \ - "admin@foo.com" - echo exit 1 fi diff --git a/contrib/init/hushd.openrc b/contrib/init/hushd.openrc index 08e04a00f..4443b1223 100644 --- a/contrib/init/hushd.openrc +++ b/contrib/init/hushd.openrc @@ -81,11 +81,6 @@ checkconfig() eerror "" eerror "bash -c 'tr -dc a-zA-Z0-9 < /dev/urandom | head -c32 && echo'" eerror "" - eerror "It is also recommended that you also set alertnotify so you are " - eerror "notified of problems:" - eerror "" - eerror "ie: alertnotify=echo %%s | mail -s \"Hush Alert\"" \ - "admin@foo.com" eerror "" return 1 fi diff --git a/contrib/macdeploy/SDBackground.png b/contrib/macdeploy/SDBackground.png new file mode 100644 index 000000000..e990d50ae Binary files /dev/null and b/contrib/macdeploy/SDBackground.png differ diff --git a/contrib/macdeploy/sd-macdeploy.command b/contrib/macdeploy/sd-macdeploy.command new file mode 100755 index 000000000..eec6b8fa5 --- /dev/null +++ b/contrib/macdeploy/sd-macdeploy.command @@ -0,0 +1,136 @@ +#!/bin/bash + +# by Andy Maloney +# http://asmaloney.com/2013/07/howto/packaging-a-mac-os-x-application-using-a-dmg/ + +# make sure we are in the correct dir when we double-click a .command file +dir=${0%/*} +if [ -d "$dir" ]; then + cd "$dir" +fi + +# set up your app name, version number, and background image file name +APP_NAME="SilentDragon" +VERSION="1.3.0" +DMG_BACKGROUND_IMG="SDBackground.png" + +# you should not need to change these +APP_EXE="${APP_NAME}.app/Contents/MacOS/${APP_NAME}" + +VOL_NAME="${APP_NAME} ${VERSION}" # volume name will be "SilentDragon 1.3.0" +DMG_TMP="${VOL_NAME}-temp.dmg" +DMG_FINAL="${VOL_NAME}.dmg" # final DMG name will be "SilentDragon 1.3.0.dmg" +STAGING_DIR="./Install" # we copy all our stuff into this dir + +# Check the background image DPI and convert it if it isn't 72x72 +_BACKGROUND_IMAGE_DPI_H=`sips -g dpiHeight ${DMG_BACKGROUND_IMG} | grep -Eo '[0-9]+\.[0-9]+'` +_BACKGROUND_IMAGE_DPI_W=`sips -g dpiWidth ${DMG_BACKGROUND_IMG} | grep -Eo '[0-9]+\.[0-9]+'` + +if [ $(echo " $_BACKGROUND_IMAGE_DPI_H != 72.0 " | bc) -eq 1 -o $(echo " $_BACKGROUND_IMAGE_DPI_W != 72.0 " | bc) -eq 1 ]; then + echo "WARNING: The background image's DPI is not 72. This will result in distorted backgrounds on Mac OS X 10.7+." + echo " I will convert it to 72 DPI for you." + + _DMG_BACKGROUND_TMP="${DMG_BACKGROUND_IMG%.*}"_dpifix."${DMG_BACKGROUND_IMG##*.}" + + sips -s dpiWidth 72 -s dpiHeight 72 ${DMG_BACKGROUND_IMG} --out ${_DMG_BACKGROUND_TMP} + + DMG_BACKGROUND_IMG="${_DMG_BACKGROUND_TMP}" +fi + +# clear out any old data +rm -rf "${STAGING_DIR}" "${DMG_TMP}" "${DMG_FINAL}" + +# copy over the stuff we want in the final disk image to our staging dir +mkdir -p "${STAGING_DIR}" +cp -rpf "${APP_NAME}.app" "${STAGING_DIR}" +# ... cp anything else you want in the DMG - documentation, etc. + +pushd "${STAGING_DIR}" + +# strip the executable +echo "Stripping ${APP_EXE}..." +strip -u -r "${APP_EXE}" + +# compress the executable if we have upx in PATH +# UPX: http://upx.sourceforge.net/ +if hash upx 2>/dev/null; then + echo "Compressing (UPX) ${APP_EXE}..." + upx -9 "${APP_EXE}" +fi + +# ... perform any other stripping/compressing of libs and executables + +popd + +# figure out how big our DMG needs to be +# assumes our contents are at least 1M! +SIZE=`du -sh "${STAGING_DIR}" | sed 's/\([0-9\.]*\)M\(.*\)/\1/'` +SIZE=`echo "${SIZE} + 1.0" | bc | awk '{print int($1+0.5)}'` + +if [ $? -ne 0 ]; then + echo "Error: Cannot compute size of staging dir" + exit +fi + +# create the temp DMG file +hdiutil create -srcfolder "${STAGING_DIR}" -volname "${VOL_NAME}" -fs HFS+ \ + -fsargs "-c c=64,a=16,e=16" -format UDRW -size ${SIZE}M "${DMG_TMP}" + +echo "Created DMG: ${DMG_TMP}" + +# mount it and save the device +DEVICE=$(hdiutil attach -readwrite -noverify "${DMG_TMP}" | \ + egrep '^/dev/' | sed 1q | awk '{print $1}') + +sleep 2 + +# add a link to the Applications dir +echo "Add link to /Applications" +pushd /Volumes/"${VOL_NAME}" +ln -s /Applications +popd + +# add a background image +mkdir /Volumes/"${VOL_NAME}"/.background +cp "${DMG_BACKGROUND_IMG}" /Volumes/"${VOL_NAME}"/.background/ + +# tell the Finder to resize the window, set the background, +# change the icon size, place the icons in the right position, etc. +echo ' + tell application "Finder" + tell disk "'${VOL_NAME}'" + open + set current view of container window to icon view + set toolbar visible of container window to false + set statusbar visible of container window to false + set the bounds of container window to {400, 100, 920, 440} + set viewOptions to the icon view options of container window + set arrangement of viewOptions to not arranged + set icon size of viewOptions to 72 + set background picture of viewOptions to file ".background:'${DMG_BACKGROUND_IMG}'" + set position of item "'${APP_NAME}'.app" of container window to {160, 205} + set position of item "Applications" of container window to {360, 205} + close + open + update without registering applications + delay 2 + end tell + end tell +' | osascript + +sync + +# unmount it +hdiutil detach "${DEVICE}" + +# now make the final image a compressed disk image +echo "Creating compressed image" +hdiutil convert "${DMG_TMP}" -format UDZO -imagekey zlib-level=9 -o "${DMG_FINAL}" + +# clean up +rm -rf "${DMG_TMP}" +rm -rf "${STAGING_DIR}" + +echo 'Done.' + +exit \ No newline at end of file diff --git a/contrib/sdl_checkpoints.pl b/contrib/sdl_checkpoints.pl index e140fb0ec..ef4aa3dbe 100755 --- a/contrib/sdl_checkpoints.pl +++ b/contrib/sdl_checkpoints.pl @@ -1,5 +1,5 @@ #!/usr/bin/perl -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/contrib/seeds/README.md b/contrib/seeds/README.md index 63647fa11..06035bb72 100644 --- a/contrib/seeds/README.md +++ b/contrib/seeds/README.md @@ -1,8 +1,10 @@ -### Seeds ### +# Seeds Utility to generate the seeds.txt list that is compiled into the client -(see [src/chainparamsseeds.h](/src/chainparamsseeds.h) and other utilities in [contrib/seeds](/contrib/seeds)). +(see [src/chainparamsseeds.h](hush/hush3/src/branch/master/src/chainparamsseeds.h) and other utilities in [contrib/seeds](hush/hush3/src/branch/master/contrib/seeds/)). + +## Updating seeds + +Update [contrib/seeds/nodes_main.txt](hush/hush3/src/branch/master/contrib/seeds/nodes_main.txt) and run `make seeds` in the root directory of this repo to update [src/chainparamsseeds.h](hush/hush3/src/branch/master/src/chainparamsseeds.h) then commit the result. -The 512 seeds compiled into the 0.10 release were created from sipa's DNS seed data, like this: - curl -s http://bitcoin.sipa.be/seeds.txt | makeseeds.py diff --git a/contrib/seeds/generate-seeds.py b/contrib/seeds/generate-seeds.py index ab9b4c68c..8b31529f9 100755 --- a/contrib/seeds/generate-seeds.py +++ b/contrib/seeds/generate-seeds.py @@ -1,5 +1,6 @@ -#!/usr/bin/env python -# Copyright (c) 2014 Wladimir J. van der Laan +#!/usr/bin/env python3 +# Copyright (c) 2016-2023 The Hush developers +# Copyright (c) 2014-2021 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html ''' @@ -11,45 +12,63 @@ argument: nodes_main.txt nodes_test.txt -These files must consist of lines in the format +These files must consist of lines in the format - : - [] + []: + [] + .onion: .onion - 0xDDBBCCAA (IPv4 little-endian old pnSeeds format) + .b32.i2p: + .b32.i2p The output will be two data structures with the peers in binary format: - static SeedSpec6 pnSeed6_main[]={ - ... - } - static SeedSpec6 pnSeed6_test[]={ + static const uint8_t chainparams_seed_{main,test}[]={ ... } -These should be pasted into `src/chainparamsseeds.h`. +To update the generated code : + +./contrib/seeds/generate-seeds.py contrib/seeds > src/chainparamsseeds.h + ''' -from __future__ import print_function, division + from base64 import b32decode -from binascii import a2b_hex -import sys, os +from enum import Enum +import struct +import sys +import os import re -# ipv4 in ipv6 prefix -pchIPv4 = bytearray([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff]) -# tor-specific ipv6 prefix -pchOnionCat = bytearray([0xFD,0x87,0xD8,0x7E,0xEB,0x43]) +class BIP155Network(Enum): + IPV4 = 1 + IPV6 = 2 + TORV2 = 3 # no longer supported + TORV3 = 4 + I2P = 5 + CJDNS = 6 -def name_to_ipv6(addr): - if len(addr)>6 and addr.endswith('.onion'): +def name_to_bip155(addr): + '''Convert address string to BIP155 (networkID, addr) tuple.''' + if addr.endswith('.onion'): vchAddr = b32decode(addr[0:-6], True) - if len(vchAddr) != 16-len(pchOnionCat): - raise ValueError('Invalid onion %s' % s) - return pchOnionCat + vchAddr + if len(vchAddr) == 35: + assert vchAddr[34] == 3 + return (BIP155Network.TORV3, vchAddr[:32]) + elif len(vchAddr) == 10: + return (BIP155Network.TORV2, vchAddr) + else: + raise ValueError('Invalid onion %s' % vchAddr) + elif addr.endswith('.b32.i2p'): + vchAddr = b32decode(addr[0:-8] + '====', True) + if len(vchAddr) == 32: + return (BIP155Network.I2P, vchAddr) + else: + raise ValueError(f'Invalid I2P {vchAddr}') elif '.' in addr: # IPv4 - return pchIPv4 + bytearray((int(x) for x in addr.split('.'))) + return (BIP155Network.IPV4, bytes((int(x) for x in addr.split('.')))) elif ':' in addr: # IPv6 sub = [[], []] # prefix, suffix x = 0 @@ -66,14 +85,13 @@ def name_to_ipv6(addr): sub[x].append(val & 0xff) nullbytes = 16 - len(sub[0]) - len(sub[1]) assert((x == 0 and nullbytes == 0) or (x == 1 and nullbytes > 0)) - return bytearray(sub[0] + ([0] * nullbytes) + sub[1]) - elif addr.startswith('0x'): # IPv4-in-little-endian - return pchIPv4 + bytearray(reversed(a2b_hex(addr[2:]))) + return (BIP155Network.IPV6, bytes(sub[0] + ([0] * nullbytes) + sub[1])) else: raise ValueError('Could not parse address %s' % addr) -def parse_spec(s, defaultport): - match = re.match('\[([0-9a-fA-F:]+)\](?::([0-9]+))?$', s) +def parse_spec(s): + '''Convert endpoint string to BIP155 (networkID, addr, port) tuple.''' + match = re.match(r'\[([0-9a-fA-F:]+)\](?::([0-9]+))?$', s) if match: # ipv6 host = match.group(1) port = match.group(2) @@ -84,17 +102,42 @@ def parse_spec(s, defaultport): (host,_,port) = s.partition(':') if not port: - port = defaultport + port = 0 else: port = int(port) - host = name_to_ipv6(host) + host = name_to_bip155(host) - return (host,port) + if host[0] == BIP155Network.TORV2: + return None # TORV2 is no longer supported, so we ignore it + else: + return host + (port, ) -def process_nodes(g, f, structname, defaultport): - g.write('static SeedSpec6 %s[] = {\n' % structname) - first = True +def ser_compact_size(l): + r = b"" + if l < 253: + r = struct.pack("B", l) + elif l < 0x10000: + r = struct.pack("H', spec[2]) + return r + +def process_nodes(g, f, structname): + g.write('static const uint8_t %s[] = {\n' % structname) for line in f: comment = line.find('#') if comment != -1: @@ -102,37 +145,39 @@ def process_nodes(g, f, structname, defaultport): line = line.strip() if not line: continue - if not first: - g.write(',\n') - first = False - (host,port) = parse_spec(line, defaultport) - hoststr = ','.join(('0x%02x' % b) for b in host) - g.write(' {{%s}, %i}' % (hoststr, port)) - g.write('\n};\n') + spec = parse_spec(line) + if spec is None: # ignore this entry (e.g. no longer supported addresses like TORV2) + continue + blob = bip155_serialize(spec) + hoststr = ','.join(('0x%02x' % b) for b in blob) + g.write(f' {hoststr}, // {line}\n') + g.write('};\n') def main(): if len(sys.argv)<2: print(('Usage: %s ' % sys.argv[0]), file=sys.stderr) - exit(1) + sys.exit(1) g = sys.stdout indir = sys.argv[1] - g.write('#ifndef BITCOIN_CHAINPARAMSSEEDS_H\n') - g.write('#define BITCOIN_CHAINPARAMSSEEDS_H\n') - g.write('/**\n') - g.write(' * List of fixed seed nodes for the bitcoin network\n') - g.write(' * AUTOGENERATED by contrib/seeds/generate-seeds.py\n') - g.write(' *\n') - g.write(' * Each line contains a 16-byte IPv6 address and a port.\n') - g.write(' * IPv4 as well as onion addresses are wrapped inside a IPv6 address accordingly.\n') - g.write(' */\n') - with open(os.path.join(indir,'nodes_main.txt'),'r') as f: - process_nodes(g, f, 'pnSeed6_main', 8233) + g.write('// Copyright (c) 2016-2023 The Hush developers\n') + g.write('// Distributed under the GPLv3 software license, see the accompanying\n') + g.write('// file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html\n') + g.write('// THIS FILE IS AUTOGENERATED, DO NOT MODIFY DIRECTLY\n') + g.write('// Instead, update contrib/seeds/nodes_main.txt then run\n') + g.write('// ./contrib/seeds/generate-seeds.py contrib/seeds > src/chainparamsseeds.h\n') + g.write('// OR run: make seeds\n') + g.write('#ifndef HUSH_CHAINPARAMSSEEDS_H\n') + g.write('#define HUSH_CHAINPARAMSSEEDS_H\n') + g.write('// List of fixed seed nodes for the Hush network\n') + g.write('// Each line contains a BIP155 serialized address.\n') + g.write('//\n') + with open(os.path.join(indir,'nodes_main.txt'), 'r', encoding="utf8") as f: + process_nodes(g, f, 'chainparams_seed_main') g.write('\n') - with open(os.path.join(indir,'nodes_test.txt'),'r') as f: - process_nodes(g, f, 'pnSeed6_test', 18233) - g.write('#endif // BITCOIN_CHAINPARAMSSEEDS_H\n') - + with open(os.path.join(indir,'nodes_test.txt'), 'r', encoding="utf8") as f: + process_nodes(g, f, 'chainparams_seed_test') + g.write('#endif // HUSH_CHAINPARAMSSEEDS_H\n') + if __name__ == '__main__': main() - diff --git a/contrib/seeds/nodes_main.txt b/contrib/seeds/nodes_main.txt index a6e8be207..9cd90fe9e 100644 --- a/contrib/seeds/nodes_main.txt +++ b/contrib/seeds/nodes_main.txt @@ -1,6 +1,32 @@ -185.25.48.236:27485 -185.25.48.236:27487 -185.64.105.111:27485 -185.64.105.111:27487 -185.25.48.72:27485 -185.25.48.72:27487 +# node1.hush.land +185.241.61.43 + +# node2.hush.land +87.251.76.166 + +# node3.hush.land +45.82.68.233 + +# node4.hush.land +87.251.76.33 + +# node2.hush.is +137.74.4.198 + +# lite.hushpool.is +149.28.102.219 + +# wtfistheinternet.hush.is +107.174.70.251 + +# torv3 +56wqzfj6mhxgsv3h3nh3pdocguogxfxud55libqjhjsdh5alfsko2iqd.onion +hushv3h6mbxd2pptj42reko3jcexcgnz5zvp3mqcu6myto3jhhn4yzyd.onion +hushv3xvheqh42ms3ld2nh555muscietkib7gycb7s4psbrjsysfywqd.onion + +# ipv6 +2a0c:b641:6f1:34::2 +2a0c:b641:6f1:c::2 + +# i2p +iljqq7nnmw2ij2ezl334cerwwmgzmmbmoc3n4saditd2xhi3xohq.b32.i2p diff --git a/contrib/seeds/nodes_test.txt b/contrib/seeds/nodes_test.txt index 98365ee50..be9218b99 100644 --- a/contrib/seeds/nodes_test.txt +++ b/contrib/seeds/nodes_test.txt @@ -1,11 +1,5 @@ # List of fixed seed nodes for testnet +# note: File must be non-empty to compile +1.2.3.4 # Onion nodes -thfsmmn2jbitcoin.onion -it2pj4f7657g3rhi.onion -nkf5e6b7pl4jfd4a.onion -4zhkir2ofl7orfom.onion -t6xj6wilh4ytvcs7.onion -i6y6ivorwakd7nw3.onion -ubqj4rsu3nqtxmtp.onion - diff --git a/contrib/verify-commits/gpg.sh b/contrib/verify-commits/gpg.sh index b25d5dc5c..f81b2719a 100755 --- a/contrib/verify-commits/gpg.sh +++ b/contrib/verify-commits/gpg.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html INPUT=$( + I2P SAM proxy to reach I2P peers and accept I2P connections (default: + none) + +-i2pacceptincoming + If set and -i2psam is also set then incoming I2P connections are + accepted via the SAM proxy. If this is not set but -i2psam is set + then only outgoing connections will be made to the I2P network. + Ignored if -i2psam is not set. Listening for incoming I2P + connections is done through the SAM proxy, not by binding to a + local address and port (default: 1) +``` + +In a typical situation, this suffices: + +``` +hushd -i2psam=127.0.0.1:7656 +``` + +The first time hushd connects to the I2P router, if +`-i2pacceptincoming=1`, then it will automatically generate a persistent I2P +address and its corresponding private key. The private key will be saved in a +file named `i2p_private_key` in the Hush data directory. The persistent +I2P address is used for accepting incoming connections and for making outgoing +connections if `-i2pacceptincoming=1`. If `-i2pacceptincoming=0` then only +outbound I2P connections are made and a different transient I2P address is used +for each connection to improve privacy. + +## Persistent vs transient I2P addresses + +In I2P connections, the connection receiver sees the I2P address of the +connection initiator. This is unlike the Tor network where the recipient does +not know who is connecting to them and can't tell if two connections are from +the same peer or not. + +If an I2P node is not accepting incoming connections, then Hush uses +random, one-time, transient I2P addresses for itself for outbound connections +to make it harder to discriminate, fingerprint or analyze it based on its I2P +address. + +## Additional configuration options related to I2P + +``` +-debug=i2p +``` + +Set the `debug=i2p` config logging option to see additional information in the +debug log about your I2P configuration and connections. Run `hush-cli help +logging` for more information. + +``` +-onlynet=i2p +``` + +Make automatic outbound connections only to I2P addresses. Inbound and manual +connections are not affected by this option. It can be specified multiple times +to allow multiple networks, e.g. onlynet=onion, onlynet=i2p. + +I2P support was added to Hush in version 3.9.3 and there may be fewer I2P +peers than Tor or IP ones. Therefore, using I2P alone without other networks may +make a node more susceptible to [Sybil +attacks](https://en.bitcoin.it/wiki/Weaknesses#Sybil_attack). You can use +`hush-cli -addrinfo` to see the number of I2P addresses known to your node. + +Another consideration with `onlynet=i2p` is that the initial blocks download +phase when syncing up a new node can be very slow. This phase can be sped up by +using other networks, for instance `onlynet=onion`, at the same time. + +In general, a node can be run with both onion and I2P hidden services (or +any/all of IPv4/IPv6/onion/I2P/CJDNS), which can provide a potential fallback if +one of the networks has issues. + +## I2P-related information + +There are several ways to see your I2P address if accepting +incoming I2P connections (`-i2pacceptincoming`): +- in the "Local addresses" output of CLI `-netinfo` +- in the "localaddresses" output of RPC `getnetworkinfo` +- in the debug log (grep for `AddLocal`; the I2P address ends in `.b32.i2p`) + +To see which I2P peers your node is connected to, use `hush-cli -netinfo 4` +or the `getpeerinfo` RPC (e.g. `hush-cli getpeerinfo`). + +To see which I2P addresses your node knows, use the `getnodeaddresses 0 i2p` +RPC. + +## Compatibility + +Hush uses the [SAM v3.1](https://geti2p.net/en/docs/api/samv3) protocol +to connect to the I2P network. Any I2P router that supports it can be used. + +## Ports in I2P and Hush + +Hush uses the [SAM v3.1](https://geti2p.net/en/docs/api/samv3) +protocol. One particularity of SAM v3.1 is that it does not support ports, +unlike newer versions of SAM (v3.2 and up) that do support them and default the +port numbers to 0. From the point of view of peers that use newer versions of +SAM or other protocols that support ports, a SAM v3.1 peer is connecting to them +on port 0, from source port 0. + +To allow future upgrades to newer versions of SAM, Hush sets its +listening port to 0 when listening for incoming I2P connections and advertises +its own I2P address with port 0. Furthermore, it will not attempt to connect to +I2P addresses with a non-zero port number because with SAM v3.1 the destination +port (`TO_PORT`) is always set to 0 and is not in the control of Hush. + +## Bandwidth + +I2P routers may route a large amount of general network traffic with their +default settings. Check your router's configuration to limit the amount of this +traffic relayed, if desired. + +With `i2pd`, the amount of bandwidth being shared with the wider network can be +adjusted with the `bandwidth`, `share` and `transittunnels` options in your +`i2pd.conf` file. For example, to limit total I2P traffic to 256KB/s and share +50% of this limit for a maximum of 20 transit tunnels: + +``` +bandwidth = 256 +share = 50 + +[limits] +transittunnels = 20 +``` + +If you prefer not to relay any public I2P traffic and only permit I2P traffic +from programs which are connecting via the SAM proxy, e.g. Hush, you +can set the `notransit` option to `true`. + +Similar bandwidth configuration options for the Java I2P router can be found in +`http://127.0.0.1:7657/config` under the "Bandwidth" tab. diff --git a/doc/man/hush-cli.1 b/doc/man/hush-cli.1 index 93c315060..235409cac 100644 --- a/doc/man/hush-cli.1 +++ b/doc/man/hush-cli.1 @@ -1,9 +1,9 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.13. -.TH HUSH-CLI "1" "September 2022" "hush-cli v3.9.2" "User Commands" +.TH HUSH-CLI "1" "February 2023" "hush-cli v3.9.3" "User Commands" .SH NAME -hush-cli \- manual page for hush-cli v3.9.2 +hush-cli \- manual page for hush-cli v3.9.3 .SH DESCRIPTION -Hush RPC client version v3.9.2\-54cfe1099 +Hush RPC client version v3.9.3\-1313d39a7 .PP In order to ensure you are adequately protecting your privacy when using Hush, please see . @@ -38,8 +38,8 @@ Use the test network \fB\-regtest\fR .IP Enter regression test mode, which uses a special chain in which blocks -can be solved instantly. This is intended for regression testing tools -and app development. +can be solved instantly. This is intended for regression testing +tools and app development. .HP \fB\-rpcconnect=\fR .IP @@ -75,9 +75,12 @@ Read extra arguments from standard input, one per line until EOF/Ctrl\-D In order to ensure you are adequately protecting your privacy when using Hush, please see . -Copyright (C) 2016-2022 Duke Leto and The Hush Developers +Copyright (C) 2016-2023 Duke Leto and The Hush Developers + Copyright (C) 2016-2020 jl777 and SuperNET developers + Copyright (C) 2016-2018 The Zcash developers + Copyright (C) 2009-2014 The Bitcoin Core developers This is experimental Free Software! Fuck Yeah!!!!! diff --git a/doc/man/hush-tx.1 b/doc/man/hush-tx.1 index 4a01ad1e7..0d930a9a4 100644 --- a/doc/man/hush-tx.1 +++ b/doc/man/hush-tx.1 @@ -1,9 +1,9 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.13. -.TH HUSH-TX "1" "September 2022" "hush-tx v3.9.2" "User Commands" +.TH HUSH-TX "1" "February 2023" "hush-tx v3.9.3" "User Commands" .SH NAME -hush-tx \- manual page for hush-tx v3.9.2 +hush-tx \- manual page for hush-tx v3.9.3 .SH DESCRIPTION -hush\-tx utility version v3.9.2\-54cfe1099 +hush\-tx utility version v3.9.3\-1313d39a7 .SS "Usage:" .TP hush\-tx [options] [commands] @@ -72,7 +72,8 @@ sign=HEIGHT:SIGHASH\-FLAGS .IP Add zero or more signatures to transaction. This command requires JSON registers:prevtxs=JSON object, privatekeys=JSON object. See -signrawtransaction docs for format of sighash flags, JSON objects. +signrawtransaction docs for format of sighash flags, JSON +objects. .PP Register Commands: .IP @@ -88,9 +89,12 @@ Set register NAME to given JSON\-STRING In order to ensure you are adequately protecting your privacy when using Hush, please see . -Copyright (C) 2016-2022 Duke Leto and The Hush Developers +Copyright (C) 2016-2023 Duke Leto and The Hush Developers + Copyright (C) 2016-2020 jl777 and SuperNET developers + Copyright (C) 2016-2018 The Zcash developers + Copyright (C) 2009-2014 The Bitcoin Core developers This is experimental Free Software! Fuck Yeah!!!!! diff --git a/doc/man/hushd.1 b/doc/man/hushd.1 index 3cd181f7c..aad7da4d9 100644 --- a/doc/man/hushd.1 +++ b/doc/man/hushd.1 @@ -1,9 +1,9 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.13. -.TH HUSHD "1" "September 2022" "hushd v3.9.2" "User Commands" +.TH HUSHD "1" "February 2023" "hushd v3.9.3" "User Commands" .SH NAME -hushd \- manual page for hushd v3.9.2 +hushd \- manual page for hushd v3.9.3 .SH DESCRIPTION -Hush Daemon version v3.9.2\-54cfe1099 +Hush Daemon version v3.9.3\-1313d39a7 .PP In order to ensure you are adequately protecting your privacy when using Hush, please see . @@ -17,11 +17,6 @@ Start a Hush Daemon .IP This help message .HP -\fB\-alertnotify=\fR -.IP -Execute command when a relevant alert is received or we see a really -long fork (%s in cmd is replaced by message) -.HP \fB\-blocknotify=\fR .IP Execute command when the best block changes (%s in cmd is replaced by @@ -63,14 +58,23 @@ Set database cache size in megabytes (4 to 16384, default: 512) .IP Imports blocks from external blk000??.dat file on startup .HP +\fB\-maxdebugfilesize=\fR +.IP +Set the max size of the debug.log file (default: 15) +.HP \fB\-maxorphantx=\fR .IP Keep at most unconnectable transactions in memory (default: 100) .HP +\fB\-maxreorg=\fR +.IP +Specify the maximum length of a blockchain re\-organization +.HP \fB\-mempooltxinputlimit=\fR .IP [DEPRECATED/IGNORED] Set the maximum number of transparent inputs in a -transaction that the mempool will accept (default: 0 = no limit applied) +transaction that the mempool will accept (default: 0 = no limit +applied) .HP \fB\-par=\fR .IP @@ -89,10 +93,10 @@ transaction id) \fB\-prune=\fR .IP Reduce storage requirements by pruning (deleting) old blocks. This mode -disables wallet support and is incompatible with \fB\-txindex\fR. Warning: -Reverting this setting requires re\-downloading the entire blockchain. -(default: 0 = disable pruning blocks, >550 = target size in MiB to use -for block files) +disables wallet support and is incompatible with \fB\-txindex\fR. +Warning: Reverting this setting requires re\-downloading the +entire blockchain. (default: 0 = disable pruning blocks, >550 = +target size in MiB to use for block files) .HP \fB\-reindex\fR .IP @@ -142,8 +146,8 @@ Add a node to connect to and attempt to keep the connection open \fB\-asmap=\fR .IP Specify ASN mapping used for bucketing of the peers (default: -asmap.dat). Relative paths will be prefixed by the net\-specific datadir -location. +asmap.dat). Relative paths will be prefixed by the net\-specific +datadir location. .HP \fB\-banscore=\fR .IP @@ -191,7 +195,7 @@ Accept connections from outside (default: 1 if no \fB\-proxy\fR or \fB\-connect\ .HP \fB\-listenonion\fR .IP -Automatically create Tor hidden service (default: 0) +Automatically create Tor hidden service (default: 1) .HP \fB\-maxconnections=\fR .IP @@ -210,9 +214,36 @@ Maximum per\-connection send buffer, *1000 bytes (default: 1000) Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: \fB\-proxy\fR) .HP +\fB\-nspv_msg\fR +.IP +Enable NSPV messages processing (default: true when \fB\-ac_private\fR=\fI\,1\/\fR, +otherwise false) +.HP +\fB\-i2psam=\fR +.IP +I2P SAM proxy to reach I2P peers and accept I2P connections (default: +none) +.HP +\fB\-i2pacceptincoming\fR +.IP +If set and \fB\-i2psam\fR is also set then incoming I2P connections are +accepted via the SAM proxy. If this is not set but \fB\-i2psam\fR is set +then only outgoing connections will be made to the I2P network. +Ignored if \fB\-i2psam\fR is not set. Listening for incoming I2P +connections is done through the SAM proxy, not by binding to a +local address and port (default: 1) +.HP \fB\-onlynet=\fR .IP -Only connect to nodes in network (ipv4, ipv6 or onion) +Only connect to nodes in network (ipv4, ipv6, onion or i2p) +.HP +\fB\-disableipv4\fR +.IP +Disable Ipv4 network connections (default: 0) +.HP +\fB\-disableipv6\fR +.IP +Disable Ipv6 network connections (default: 0) .HP \fB\-permitbaremultisig\fR .IP @@ -242,7 +273,7 @@ Connect to a node to retrieve peer addresses, and disconnect .HP \fB\-timeout=\fR .IP -Specify connection timeout in milliseconds (minimum: 1, default: 5000) +Specify connection timeout in milliseconds (minimum: 1, default: 60000) .HP \fB\-torcontrol=\fR: .IP @@ -287,9 +318,9 @@ Bind to given address and allowlist peers connecting to it. Use \fB\-allowlist=\fR .IP Allowlist peers connecting from the given netmask or IP address. Can be -specified multiple times. Allowlisted peers cannot be DoS banned and -their transactions are always relayed, even if they are already in the -mempool, useful e.g. for a gateway +specified multiple times. Allowlisted peers cannot be DoS banned +and their transactions are always relayed, even if they are +already in the mempool, useful e.g. for a gateway .PP Wallet options: .HP @@ -430,29 +461,32 @@ by TxID) \fB\-allowlistaddress=\fR .IP Enable the wallet filter for notary nodes and add one Raddress to the -allowlist of the wallet filter. If \fB\-allowlistaddress=\fR is used, then the -wallet filter is automatically activated. Several Raddresses can be -defined using several \fB\-allowlistaddress=\fR (similar to \fB\-addnode\fR). The -wallet filter will filter the utxo to only ones coming from my own -Raddress (derived from pubkey) and each Raddress defined using -\fB\-allowlistaddress=\fR this option is mostly for Notary Nodes). +allowlist of the wallet filter. If \fB\-allowlistaddress=\fR is used, +then the wallet filter is automatically activated. Several +Raddresses can be defined using several \fB\-allowlistaddress=\fR +(similar to \fB\-addnode\fR). The wallet filter will filter the utxo to +only ones coming from my own Raddress (derived from pubkey) and +each Raddress defined using \fB\-allowlistaddress=\fR this option is +mostly for Notary Nodes). .HP \fB\-zapwallettxes=\fR .IP Delete all wallet transactions and only recover those parts of the blockchain through \fB\-rescan\fR on startup (1 = keep tx meta data e.g. -account owner and payment request information, 2 = drop tx meta data) +account owner and payment request information, 2 = drop tx meta +data) .PP Debugging/Testing options: .HP \fB\-debug=\fR .IP Output debugging information (default: 0, supplying is -optional). If is not supplied or if = 1, output -all debugging information. can be: addrman, alert, bench, -coindb, db, deletetx, estimatefee, http, libevent, lock, mempool, net, -tls, partitioncheck, pow, proxy, prune, rand, randomx, reindex, rpc, -selectcoins, stratum, tor, zrpc, zrpcunsafe (implies zrpc). +optional). If is not supplied or if = 1, +output all debugging information. can be: addrman, +bench, coindb, db, deletetx, estimatefee, http, libevent, lock, +mempool, net, tls, partitioncheck, pow, proxy, prune, rand, +randomx, reindex, rpc, selectcoins, stratum, tor, zrpc, +zrpcunsafe (implies zrpc). .HP \fB\-experimentalfeatures\fR .IP @@ -550,8 +584,8 @@ Accept public REST requests (default: 0) \fB\-rpcbind=\fR .IP Bind to given address to listen for JSON\-RPC connections. Use -[host]:port notation for IPv6. This option can be specified multiple -times (default: bind to all interfaces) +[host]:port notation for IPv6. This option can be specified +multiple times (default: bind to all interfaces) .HP \fB\-rpcuser=\fR .IP @@ -568,9 +602,9 @@ Listen for JSON\-RPC connections on (default: 0 or testnet: 10000) \fB\-rpcallowip=\fR .IP Allow JSON\-RPC connections from specified source. Valid for are a -single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) -or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified -multiple times +single IP (e.g. 1.2.3.4), a network/netmask (e.g. +1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This +option can be specified multiple times .HP \fB\-rpcthreads=\fR .IP @@ -606,8 +640,8 @@ Mining address to use when special address of 'x' is sent by miner \fB\-stratumbind=\fR .IP Bind to given address to listen for Stratum work requests. Use -[host]:port notation for IPv6. This option can be specified multiple -times (default: bind to all interfaces) +[host]:port notation for IPv6. This option can be specified +multiple times (default: bind to all interfaces) .HP \fB\-stratumport=\fR .IP @@ -617,9 +651,9 @@ Listen for Stratum work requests on (default: 19031 or testnet: \fB\-stratumallowip=\fR .IP Allow Stratum work requests from specified source. Valid for are a -single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) -or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified -multiple times +single IP (e.g. 1.2.3.4), a network/netmask (e.g. +1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This +option can be specified multiple times .PP Hush Smart Chain options: .HP @@ -700,6 +734,15 @@ Public key for receiving payments on the network .IP Transparent transactions only, default 0 .HP +\fB\-ac_randomx_interval\fR +.IP +Controls how often the RandomX key block will change, default is 1024 +.HP +\fB\-ac_randomx_lag\fR +.IP +Sets the number of RandomX blocks to wait before updating the key block, +default is 64 +.HP \fB\-ac_reward\fR .IP Block reward in satoshis, default is 0 @@ -714,7 +757,7 @@ P2SH/multisig address to receive founders rewards .HP \fB\-ac_supply\fR .IP -Starting supply, default is 0 +Starting supply, default is 10 .HP \fB\-ac_txpow\fR .IP @@ -724,9 +767,12 @@ Enforce transaction\-rate limit, default 0 In order to ensure you are adequately protecting your privacy when using Hush, please see . -Copyright (C) 2016-2022 Duke Leto and The Hush Developers +Copyright (C) 2016-2023 Duke Leto and The Hush Developers + Copyright (C) 2016-2020 jl777 and SuperNET developers + Copyright (C) 2016-2018 The Zcash developers + Copyright (C) 2009-2014 The Bitcoin Core developers This is experimental Free Software! Fuck Yeah!!!!! diff --git a/doc/release-process.md b/doc/release-process.md index 9797b2e1d..03a174cd1 100644 --- a/doc/release-process.md +++ b/doc/release-process.md @@ -4,6 +4,8 @@ Beware of making high-risk changes (such as consensus changes, p2p layer changes and wallet/transaction changes) too close to a new release, because they will not get as much testing as they should. Don't merge large branches which haven't undergone lots of testing just before a release. +It is best to keep doc/relnotes/README.md up to date as changes and bug fixes are made. It's more work to summarize all changes and bugfixes just before the release. + ## Check for changes on master that should be on dev Often there are trivial changes made directly on master, such as documentation changes. In theory, no code changes should happen on master without being on dev first, but it's better to be safe than sorry. We want the dev branch which undergoes testing to be as close as possible to what the master branch will become, so we don't want to merge dev into master and just assume everything works. So it's best to merge the master branch into dev just before merging the dev branch into master. @@ -41,6 +43,7 @@ Look for Git issues that should be fixed in the next release. Especially low-ris * Does `PROTOCOL_VERSION` in src/version.h need to be increased? * All releases with a consensus change should increase the value by 1 + * All releases with a large change to the networking (P2P) layer should increase the value by 1 * This identifies a nodes protocol version to all other peers it connects to. * Does `MIN_PEER_PROTO_VERSION` in src/version.h need to change? * If it does, new nodes will not be able to talk to nodes with a version less than `MIN_PROTO_VERSION` @@ -54,7 +57,10 @@ Install deps on Linux: apt-get install help2man debchange ## Release process - + - If new seeds are being added or seeds are changing: + - Edit contrib/seeds/nodes_main.txt + - Run "make seeds" + - Commit the result - Update version in configure.ac and src/clientversion.h to update the hushd version - In src/clientversion.h you update `CLIENT_VERSION_*` variables. Usually you will just update `CLIENT_VERSION_REVISION` - If there is a consensus change, it may be a good idea to update `CLIENT_VERSION_MINOR` or `CLIENT_VERSION_MAJOR` @@ -69,11 +75,10 @@ Install deps on Linux: - Update checkpoints in src/chainparams.cpp via util/checkpoints.pl - hushd must be running to run this script, since it uses hush-cli to get the data - Look for line which says "END HUSH mainnet checkpoint data" near line 560 in chainparams.cpp , that is where checkpoint data ends - - Find the highest block height of data, let's call it HEIGHT + - Find the highest block height of checkpoint data, let's call it HEIGHT - Run `./util/checkpoints.pl 1000 HEIGHT &> checkpoints.txt` to generate the latest checkpoint data - To copy the new data from checkpoints.txt into the file, one way in Vim is to type ":r checkpoints.txt" which will read in a file and paste it as the current cursor - You will see 3 lines of "stats" at the end of the output, you just pasted in the newest stats. Delete the old stats that should be the 3 lines under the current stats - - The script generates a comment "Generated at ...", that should be moved to the very beginning of the checkpoint data - Make sure the new code compiles, commit and push - Run `./util/checkpoints.pl help` to see some basic help - By default it will generate checkpoints for every 1000 blocks, the "stride" @@ -87,7 +92,7 @@ Install deps on Linux: - They only provide limited security, because they talk about the past, not future block heights. - Try to generate checkpoints as close to the release as possible, so you can have a recent block height be protected. - For instance, don't update checkpoints and then do a release a month later. You can always update checkpoint data again or multiple times - - Update copyright years (if applicable) with util/replace.pl + - Update copyright years if applicable. Example: `./util/update-copyrights.h 2022 2023` - Update doc/relnotes/README.md - To get the stats of file changes: `git diff --stat master...dev` - Do a fresh clone and fresh sync with new checkpoints @@ -97,12 +102,18 @@ Install deps on Linux: - The above command will not merge if "git pull" creates a merge conflict - The above command will not push if there is a problem with merging dev - Make Gitea release with git tag from master branch (make sure to merge dev in first) + - Make sure git tag starts with a `v` such as `v3.9.2` - Use util/gen-linux-binary-release.sh to make a Linux release binary + - Upload Linux binary to Gitea release and add SHA256 sum - Use util/build-debian-package.sh to make an x86 Debian package for the release - Debian packages should be done after you make manpages, because those are included in Debian packages + - `lintian` is an optional dependency, it's not needed to build the .deb + - Upload .deb to Gitea release + - Add SHA256 checksum of .deb to release - Use util/build-debian-package-ARM.sh (does this still work?) to make an ARM Debian package for the release - Upload the debian packages to the Gitea release page, with SHA256 sums + - Figure out how to update https://faq.hush.is/rpc/ for new release ## Platform-specific notes -Use `./util/build-mac.sh` to compile on Apple/Mac systems, use `./util/build-win.sh` to build on Windows and `./util/build-arm.sh` to build on ARMv8 systems. \ No newline at end of file +Use `./util/build-mac.sh` to compile on Apple/Mac systems, use `./util/build-win.sh` to build on Windows and `./util/build-arm.sh` to build on ARMv8 systems. diff --git a/doc/relnotes/README.md b/doc/relnotes/README.md index 6502a6143..39c56e213 100644 --- a/doc/relnotes/README.md +++ b/doc/relnotes/README.md @@ -10,6 +10,29 @@ and no longer on Github, since they banned Duke Leto and also because they censor many people around the world and work with evil organizations. +# Hush 3.9.3 "Lateral Larvacean" + +``` +1012 files changed, 36253 insertions(+), 5507 deletions(-) +``` + +This is an OPTIONAL release. It is recommended for exchanges, solo miners and mining pools to update to this release. + + * Many RandomX mining fixes and improvements + * Difficulty bug affecting DRAGONX has been fixed + * RandomX mining hashrate increase of about 60X + * Optimized memory usage of RandomX mining + * This release adds Tor v3 and i2p support (BIP155 also known as addrv2) + * Basic usage is `hushd -proxy=127.0.0.1:9050` for using a local Tor proxy. + * Use port 9150 if you are using Tor Browser. See docs/tor.md for details + * New CLI args: `-i2psam=` and `-i2pacceptincoming` . See docs/i2p.md for more info + * Tor and i2p seeds have been added + * The format of peers.dat has changed. On first startup with this code there will be a short delay of a few minutes while new nodes are found and peers.dat is populated in it's new format. + * New RPCs: + * getrescaninfo - Says if the node is rescanning with additional info about progress + * abortrescan - stop rescanning if a node is currently rescanning + + # Hush 3.9.2 "Anecdotal Axolotl" ``` diff --git a/doc/tor.md b/doc/tor.md index c00db2fbd..fe0608888 100644 --- a/doc/tor.md +++ b/doc/tor.md @@ -1,154 +1,225 @@ -# Warning +# Tor - Do not assume Tor support works perfectly in Hush; better Tor support is currently being worked on. - -# Hush + Tor - -It is possible to run Hush as a Tor hidden service, and connect to such services. +It is possible to run Hush as a Tor onion service, and connect to such services. The following directions assume you have a Tor proxy running on port 9050. Many distributions default to having a SOCKS proxy listening on port 9050, but others may not. In particular, the Tor Browser Bundle defaults to listening on port 9150. See [Tor Project FAQ:TBBSocksPort](https://www.torproject.org/docs/faq.html.en#TBBSocksPort) for how to properly configure Tor. +## Compatibility -1. Run Hush behind a Tor proxy -------------------------------- +- Starting with version 3.9.3, Hush only supports Tor version 3 hidden + services (Tor v3). Tor v2 addresses are ignored by Hush and neither + relayed nor stored. -The first step is running Hush behind a Tor proxy. This will already make all -outgoing connections be anonymized, but more is possible. +- Tor removed v2 support beginning with version 0.4.6. - -proxy=ip:port Set the proxy server. If SOCKS5 is selected (default), this proxy - server will be used to try to reach .onion addresses as well. +## How to see information about your Tor configuration via Hush - -onion=ip:port Set the proxy server to use for Tor hidden services. You do not - need to set this if it's the same as -proxy. You can use -noonion - to explicitly disable access to hidden service. +There are several ways to see your local onion address in Hush: +- in the "Local addresses" output of CLI `-netinfo` +- in the "localaddresses" output of RPC `getnetworkinfo` +- in the debug log (grep for "AddLocal"; the Tor address ends in `.onion`) - -listen When using -proxy, listening is disabled by default. If you want - to run a hidden service (see next section), you'll need to enable - it explicitly. +You may set the `-debug=tor` config logging option to have additional +information in the debug log about your Tor configuration. - -connect=X When behind a Tor proxy, you can specify .onion addresses instead - -addnode=X of IP addresses or hostnames in these parameters. It requires - -seednode=X SOCKS5. In Tor mode, such addresses can also be exchanged with - other P2P nodes. +CLI `-addrinfo` returns the number of addresses known to your node per +network. This can be useful to see how many onion peers your node knows, +e.g. for `-onlynet=onion`. + +To fetch a number of onion addresses that your node knows, for example seven +addresses, use the `getnodeaddresses 7 onion` RPC. + +## 1. Run Hush behind a Tor proxy + +The first step is running Hush behind a Tor proxy. This will already anonymize all +outgoing connections, but more is possible. + + -proxy=ip:port Set the proxy server. If SOCKS5 is selected (default), this proxy + server will be used to try to reach .onion addresses as well. + You need to use -noonion or -onion=0 to explicitly disable + outbound access to onion services. + + -onion=ip:port Set the proxy server to use for Tor onion services. You do not + need to set this if it's the same as -proxy. You can use -onion=0 + to explicitly disable access to onion services. + ------------------------------------------------------------------ + Note: Only the -proxy option sets the proxy for DNS requests; + with -onion they will not route over Tor, so use -proxy if you + have privacy concerns. + ------------------------------------------------------------------ + + -listen When using -proxy, listening is disabled by default. If you want + to manually configure an onion service (see section 3), you'll + need to enable it explicitly. + + -connect=X When behind a Tor proxy, you can specify .onion addresses instead + -addnode=X of IP addresses or hostnames in these parameters. It requires + -seednode=X SOCKS5. In Tor mode, such addresses can also be exchanged with + other P2P nodes. + + -onlynet=onion Make automatic outbound connections only to .onion addresses. + Inbound and manual connections are not affected by this option. + It can be specified multiple times to allow multiple networks, + e.g. onlynet=onion, onlynet=i2p, onlynet=cjdns. In a typical situation, this suffices to run behind a Tor proxy: - ./hushd -proxy=127.0.0.1:9050 + ./hushd -proxy=127.0.0.1:9050 -If using the Tor Browser Bundle: +## 2. Automatically create a Hush onion service - ./hushd -proxy=127.0.0.1:9150 +Hush makes use of Tor's control socket API to create and destroy +ephemeral onion services programmatically. This means that if Tor is running and +proper authentication has been configured, Hush automatically creates an +onion service to listen on. The goal is to increase the number of available +onion nodes. + +This feature is enabled by default if Hush is listening (`-listen`) and +it requires a Tor connection to work. It can be explicitly disabled with +`-listenonion=0`. If it is not disabled, it can be configured using the +`-torcontrol` and `-torpassword` settings. + +To see verbose Tor information in the hushd debug log, pass `-debug=tor`. + +### Control Port + +You may need to set up the Tor Control Port. On Linux distributions there may be +some or all of the following settings in `/etc/tor/torrc`, generally commented +out by default (if not, add them): + +``` +ControlPort 9051 +CookieAuthentication 1 +CookieAuthFileGroupReadable 1 +``` + +Add or uncomment those, save, and restart Tor (usually `systemctl restart tor` +or `sudo systemctl restart tor` on most systemd-based systems, including recent +Debian and Ubuntu, or just restart the computer). + +On some systems (such as Arch Linux), you may also need to add the following +line: + +``` +DataDirectoryGroupReadable 1 +``` + +### Authentication + +Connecting to Tor's control socket API requires one of two authentication +methods to be configured: cookie authentication or hushd's `-torpassword` +configuration option. + +#### Cookie authentication + +For cookie authentication, the user running hushd must have read access to +the `CookieAuthFile` specified in the Tor configuration. In some cases this is +preconfigured and the creation of an onion service is automatic. Don't forget to +use the `-debug=tor` hushd configuration option to enable Tor debug logging. + +If a permissions problem is seen in the debug log, e.g. `tor: Authentication +cookie /run/tor/control.authcookie could not be opened (check permissions)`, it +can be resolved by adding both the user running Tor and the user running +hushd to the same Tor group and setting permissions appropriately. + +On Debian-derived systems, the Tor group will likely be `debian-tor` and one way +to verify could be to list the groups and grep for a "tor" group name: + +``` +getent group | cut -d: -f1 | grep -i tor +``` + +You can also check the group of the cookie file. On most Linux systems, the Tor +auth cookie will usually be `/run/tor/control.authcookie`: + +``` +TORGROUP=$(stat -c '%G' /run/tor/control.authcookie) +``` + +Once you have determined the `${TORGROUP}` and selected the `${USER}` that will +run hushd, run this as root: + +``` +usermod -a -G ${TORGROUP} ${USER} +``` + +Then restart the computer (or log out) and log in as the `${USER}` that will run +hushd. + +#### `torpassword` authentication + +For the `-torpassword=password` option, the password is the clear text form that +was used when generating the hashed password for the `HashedControlPassword` +option in the Tor configuration file. + +The hashed password can be obtained with the command `tor --hash-password +password` (refer to the [Tor Dev +Manual](https://2019.www.torproject.org/docs/tor-manual.html.en) for more +details). +## 3. Manually create a Hush onion service -2. Run a Hush hidden server ----------------------------- +You can also manually configure your node to be reachable from the Tor network. +Add these lines to your `/etc/tor/torrc` (or equivalent config file): -If you configure your Tor system accordingly, it is possible to make your node also -reachable from the Tor network. Add these lines to your /etc/tor/torrc (or equivalent -config file): + HiddenServiceDir /var/lib/tor/hush-service/ + HiddenServicePort 18030 127.0.0.1:18032 - HiddenServiceDir /var/lib/tor/hush-service/ - HiddenServicePort 18030 127.0.0.1:18030 +The directory can be different of course, but virtual port numbers should be equal to +your hushd's P2P listen port (18030 by default), and target addresses and ports +should be equal to binding address and port for inbound Tor connections (127.0.0.1:18032 by default). -The directory can be different of course, but (both) port numbers should be equal to -your hushd's P2P listen port (18030 by default). + -externalip=X You can tell hush about its publicly reachable addresses using + this option, and this can be an onion address. Given the above + configuration, you can find your onion address in + /var/lib/tor/hush-service/hostname. For connections + coming from unroutable addresses (such as 127.0.0.1, where the + Tor proxy typically runs), onion addresses are given + preference for your node to advertise itself with. - -externalip=X You can tell Hush about its publicly reachable address using - this option, and this can be a .onion address. Given the above - configuration, you can find your onion address in - /var/lib/tor/hush-service/hostname. Onion addresses are given - preference for your node to advertize itself with, for connections - coming from unroutable addresses (such as 127.0.0.1, where the - Tor proxy typically runs). + You can set multiple local addresses with -externalip. The + one that will be rumoured to a particular peer is the most + compatible one and also using heuristics, e.g. the address + with the most incoming connections, etc. - -listen You'll need to enable listening for incoming connections, as this - is off by default behind a proxy. + -listen You'll need to enable listening for incoming connections, as this + is off by default behind a proxy. - -discover When -externalip is specified, no attempt is made to discover local - IPv4 or IPv6 addresses. If you want to run a dual stack, reachable - from both Tor and IPv4 (or IPv6), you'll need to either pass your - other addresses using -externalip, or explicitly enable -discover. - Note that both addresses of a dual-stack system may be easily - linkable using traffic analysis. + -discover When -externalip is specified, no attempt is made to discover local + IPv4 or IPv6 addresses. If you want to run a dual stack, reachable + from both Tor and IPv4 (or IPv6), you'll need to either pass your + other addresses using -externalip, or explicitly enable -discover. + Note that both addresses of a dual-stack system may be easily + linkable using traffic analysis. In a typical situation, where you're only reachable via Tor, this should suffice: - ./hushd -proxy=127.0.0.1:9050 -externalip=hushc0de123.onion -listen + ./hushd -proxy=127.0.0.1:9050 -externalip=7zvj7a2imdgkdbg4f2dryd5rgtrn7upivr5eeij4cicjh65pooxeshid.onion -listen -(obviously, replace the Onion address with your own). Currently only v2 HS's are supported. -It should be noted that you still listen on all devices and another node could establish a clearnet connection, when knowing +(obviously, replace the .onion address with your own). It should be noted that you still +listen on all devices and another node could establish a clearnet connection, when knowing your address. To mitigate this, additionally bind the address of your Tor proxy: - ./hushd ... -bind=127.0.0.1 + ./hushd ... -bind=127.0.0.1 If you don't care too much about hiding your node, and want to be reachable on IPv4 as well, use `discover` instead: - ./hushd ... -discover + ./hushd ... -discover -and open port 18030 on your firewall. +and open port 18030 on your firewall (or use port mapping, i.e., `-upnp` or `-natpmp`). -If you only want to use Tor to reach onion addresses, but not use it as a proxy +If you only want to use Tor to reach .onion addresses, but not use it as a proxy for normal IPv4/IPv6 communication, use: - ./hushd -onion=127.0.0.1:9050 -externalip=hushc0de123.onion -discover + ./hushd -onion=127.0.0.1:9050 -externalip=7zvj7a2imdgkdbg4f2dryd5rgtrn7upivr5eeij4cicjh65pooxeshid.onion -discover +## 4. Privacy recommendations -3. Automatically listen on Tor --------------------------------- - -Starting with Tor version 0.2.7.1 it is possible, through Tor's control socket -API, to create and destroy 'ephemeral' hidden services programmatically. -Hush has been updated to make use of this. - -This means that if Tor is running (and proper authentication has been configured), -Hush automatically creates a hidden service to listen on. Hush will also use Tor -automatically to connect to other .onion nodes if the control socket can be -successfully opened. This will positively affect the number of available .onion -nodes and their usage. - -This new feature is enabled by default if Hush is listening (`-listen`), and -requires a Tor connection to work. It can be explicitly disabled with `-listenonion=0` -and, if not disabled, configured using the `-torcontrol` and `-torpassword` settings. -To show verbose debugging information, pass `-debug=tor`. - -Connecting to Tor's control socket API requires one of two authentication methods to be -configured. For cookie authentication the user running hushd must have write access -to the `CookieAuthFile` specified in Tor configuration. In some cases this is -preconfigured and the creation of a hidden service is automatic. If permission problems -are seen with `-debug=tor` they can be resolved by adding both the user running tor and -the user running hushd to the same group and setting permissions appropriately. On -Debian-based systems the user running hushd can be added to the debian-tor group, -which has the appropriate permissions. An alternative authentication method is the use -of the `-torpassword` flag and a `hash-password` which can be enabled and specified in -Tor configuration. - - -4. Connect to a Hush hidden server ------------------------------------ - -To test your set-up, you might want to try connecting via Tor on a different computer to just a -a single Hush hidden server. Launch hushd as follows: - - ./hushd -onion=127.0.0.1:9050 -connect=fuckzookoie6wxgio.onion - -Now use hush-cli to verify there is only a single peer connection. - - hush-cli getpeerinfo - - [ - { - "id" : 1, - "addr" : "zcashhoneypot.onion:18030", - ... - "version" : 1987420, - "subver" : "/GoldenSandtrout:3.6.0/", - ... - } - ] - -To connect to multiple Tor nodes, use: - - ./hushd -onion=127.0.0.1:9050 -addnode=hushbeef123.onion -dnsseed=0 -onlynet=onion +- Do not add anything but Hush ports to the onion service created in section 3. + If you run a web service too, create a new onion service for that. + Otherwise it is trivial to link them, which may reduce privacy. Onion + services created automatically (as in section 2) always have only one port + open. diff --git a/migratecoin.sh b/migratecoin.sh index a32d30a5f..bd18bd27c 100644 --- a/migratecoin.sh +++ b/migratecoin.sh @@ -1,5 +1,5 @@ #!/usr/usr/bin/env bash -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html # This script makes the neccesary transactions to migrate diff --git a/qa/hush/create_benchmark_archive.py b/qa/hush/create_benchmark_archive.py index 5f9a08721..eff50239f 100644 --- a/qa/hush/create_benchmark_archive.py +++ b/qa/hush/create_benchmark_archive.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html import binascii diff --git a/qa/hush/create_wallet_200k_utxos.py b/qa/hush/create_wallet_200k_utxos.py index d2174e864..742f9bf61 100644 --- a/qa/hush/create_wallet_200k_utxos.py +++ b/qa/hush/create_wallet_200k_utxos.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2017 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/hush/full-test-suite.sh b/qa/hush/full-test-suite.sh index b7fb37f0a..5113c4d8c 100755 --- a/qa/hush/full-test-suite.sh +++ b/qa/hush/full-test-suite.sh @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Execute all of the automated tests related to Hush # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/hush/full_test_suite.py b/qa/hush/full_test_suite.py index c8cc05e45..183db1640 100755 --- a/qa/hush/full_test_suite.py +++ b/qa/hush/full_test_suite.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html # Execute all of the automated tests related to Hush diff --git a/qa/pull-tester/rpc-tests.sh b/qa/pull-tester/rpc-tests.sh index 07e123b6f..b1cbabec9 100755 --- a/qa/pull-tester/rpc-tests.sh +++ b/qa/pull-tester/rpc-tests.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Released under the GPLv3 set -e -o pipefail diff --git a/qa/pull-tester/run-bitcoin-cli b/qa/pull-tester/run-bitcoin-cli index c7f09ce8a..dac53df69 100755 --- a/qa/pull-tester/run-bitcoin-cli +++ b/qa/pull-tester/run-bitcoin-cli @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Released under the GPLv3 # This is a thin wrapper around bitcoin-cli that strips the Windows-style EOLs diff --git a/qa/pull-tester/run-bitcoind-for-test.sh.in b/qa/pull-tester/run-bitcoind-for-test.sh.in index 40b6683ad..07491f0a7 100755 --- a/qa/pull-tester/run-bitcoind-for-test.sh.in +++ b/qa/pull-tester/run-bitcoind-for-test.sh.in @@ -1,7 +1,7 @@ #!/usr/bin/env bash # THIS FILE IS GENERATED FROM run-bitcoind-for-test.sh.in # Copyright (c) 2013-2014 The Bitcoin Core developers -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Released under the GPLv3 # HUSH_LOAD_TIMEOUT=500 diff --git a/qa/pull-tester/tests-config.sh.in b/qa/pull-tester/tests-config.sh.in index 6718ffbc1..5122ba085 100755 --- a/qa/pull-tester/tests-config.sh.in +++ b/qa/pull-tester/tests-config.sh.in @@ -1,7 +1,7 @@ #!/usr/bin/env bash # THIS FILE IS GENERATED FROM tests-config.sh.in # Copyright (c) 2013-2014 The Bitcoin Core developers -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Released under the GPLv3 BUILDDIR="@abs_top_builddir@" diff --git a/qa/rpc-tests/ac_private.py b/qa/rpc-tests/ac_private.py index 03675b6b1..323ca36cb 100755 --- a/qa/rpc-tests/ac_private.py +++ b/qa/rpc-tests/ac_private.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2018 SuperNET developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/addressindex.py b/qa/rpc-tests/addressindex.py index 62483e40a..942c26abb 100755 --- a/qa/rpc-tests/addressindex.py +++ b/qa/rpc-tests/addressindex.py @@ -1,6 +1,6 @@ #!/usr/bin/env python2 # Copyright (c) 2014-2015 The Bitcoin Core developers -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html # Test addressindex generation and fetching diff --git a/qa/rpc-tests/bip65-cltv-p2p.py b/qa/rpc-tests/bip65-cltv-p2p.py index 60bab6854..729801e07 100755 --- a/qa/rpc-tests/bip65-cltv-p2p.py +++ b/qa/rpc-tests/bip65-cltv-p2p.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/bipdersig-p2p.py b/qa/rpc-tests/bipdersig-p2p.py index f83f0a2c7..5466ed813 100755 --- a/qa/rpc-tests/bipdersig-p2p.py +++ b/qa/rpc-tests/bipdersig-p2p.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Distributed under the GPLv3/X11 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html # diff --git a/qa/rpc-tests/blockchain.py b/qa/rpc-tests/blockchain.py index b66a6b3bc..8718559f3 100755 --- a/qa/rpc-tests/blockchain.py +++ b/qa/rpc-tests/blockchain.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/cryptoconditions.py b/qa/rpc-tests/cryptoconditions.py index 2c6f95847..0a13cb605 100755 --- a/qa/rpc-tests/cryptoconditions.py +++ b/qa/rpc-tests/cryptoconditions.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2018 SuperNET developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/cryptoconditions_channels.py b/qa/rpc-tests/cryptoconditions_channels.py index 127df77ee..2f6487f84 100755 --- a/qa/rpc-tests/cryptoconditions_channels.py +++ b/qa/rpc-tests/cryptoconditions_channels.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2018 SuperNET developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/cryptoconditions_dice.py b/qa/rpc-tests/cryptoconditions_dice.py index 4f9d8c7c4..4a3a202a4 100755 --- a/qa/rpc-tests/cryptoconditions_dice.py +++ b/qa/rpc-tests/cryptoconditions_dice.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2018 SuperNET developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/cryptoconditions_faucet.py b/qa/rpc-tests/cryptoconditions_faucet.py index 3cccaf2db..ba7648c4d 100755 --- a/qa/rpc-tests/cryptoconditions_faucet.py +++ b/qa/rpc-tests/cryptoconditions_faucet.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2018 SuperNET developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/cryptoconditions_gateways.py b/qa/rpc-tests/cryptoconditions_gateways.py index d60452269..d31e89d9f 100755 --- a/qa/rpc-tests/cryptoconditions_gateways.py +++ b/qa/rpc-tests/cryptoconditions_gateways.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2018 SuperNET developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/cryptoconditions_heir.py b/qa/rpc-tests/cryptoconditions_heir.py index 9ce32a625..be248bb53 100755 --- a/qa/rpc-tests/cryptoconditions_heir.py +++ b/qa/rpc-tests/cryptoconditions_heir.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2018 SuperNET developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/cryptoconditions_oracles.py b/qa/rpc-tests/cryptoconditions_oracles.py index 255b372f6..d07389542 100755 --- a/qa/rpc-tests/cryptoconditions_oracles.py +++ b/qa/rpc-tests/cryptoconditions_oracles.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2018 SuperNET developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/cryptoconditions_rewards.py b/qa/rpc-tests/cryptoconditions_rewards.py index 3c1452ed4..2144ba673 100755 --- a/qa/rpc-tests/cryptoconditions_rewards.py +++ b/qa/rpc-tests/cryptoconditions_rewards.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2018 SuperNET developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/cryptoconditions_token.py b/qa/rpc-tests/cryptoconditions_token.py index dbded0062..3c00279e8 100755 --- a/qa/rpc-tests/cryptoconditions_token.py +++ b/qa/rpc-tests/cryptoconditions_token.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2018 SuperNET developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/decodescript.py b/qa/rpc-tests/decodescript.py index f4d63d317..2a971be35 100755 --- a/qa/rpc-tests/decodescript.py +++ b/qa/rpc-tests/decodescript.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2015 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/disablewallet.py b/qa/rpc-tests/disablewallet.py index bb4cda6e5..c405b4ffa 100755 --- a/qa/rpc-tests/disablewallet.py +++ b/qa/rpc-tests/disablewallet.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/dpowconfs.py b/qa/rpc-tests/dpowconfs.py index 89fb640ad..1cc75dace 100755 --- a/qa/rpc-tests/dpowconfs.py +++ b/qa/rpc-tests/dpowconfs.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2019 Duke Leto who wrote "The SuperNET developers" while never agreeing to the developer agreement nor being listed in AUTHORS # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/feature_walletfile.py b/qa/rpc-tests/feature_walletfile.py index b0364a7d3..769445cc5 100755 --- a/qa/rpc-tests/feature_walletfile.py +++ b/qa/rpc-tests/feature_walletfile.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # Copyright (c) 2017 The Bitcoin Core developers -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html """Test wallet file location.""" diff --git a/qa/rpc-tests/finalsaplingroot.py b/qa/rpc-tests/finalsaplingroot.py index b82053eb0..fb3b3ec9a 100755 --- a/qa/rpc-tests/finalsaplingroot.py +++ b/qa/rpc-tests/finalsaplingroot.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2018 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/forknotify.py b/qa/rpc-tests/forknotify.py index 1f615f930..e1636b98c 100755 --- a/qa/rpc-tests/forknotify.py +++ b/qa/rpc-tests/forknotify.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/fundrawtransaction.py b/qa/rpc-tests/fundrawtransaction.py index 3a9ac0ca6..f0e3bfbe2 100755 --- a/qa/rpc-tests/fundrawtransaction.py +++ b/qa/rpc-tests/fundrawtransaction.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/getblocktemplate.py b/qa/rpc-tests/getblocktemplate.py index 6d771b360..8c4343b32 100755 --- a/qa/rpc-tests/getblocktemplate.py +++ b/qa/rpc-tests/getblocktemplate.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2016 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/getblocktemplate_longpoll.py b/qa/rpc-tests/getblocktemplate_longpoll.py index ab393755b..911e22efd 100755 --- a/qa/rpc-tests/getblocktemplate_longpoll.py +++ b/qa/rpc-tests/getblocktemplate_longpoll.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/getblocktemplate_proposals.py b/qa/rpc-tests/getblocktemplate_proposals.py index f75032091..d718774b0 100755 --- a/qa/rpc-tests/getblocktemplate_proposals.py +++ b/qa/rpc-tests/getblocktemplate_proposals.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/getchaintips.py b/qa/rpc-tests/getchaintips.py index 84c3f7f6c..89062f232 100755 --- a/qa/rpc-tests/getchaintips.py +++ b/qa/rpc-tests/getchaintips.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/hardforkdetection.py b/qa/rpc-tests/hardforkdetection.py index bcd13e0d4..2ba4584ce 100755 --- a/qa/rpc-tests/hardforkdetection.py +++ b/qa/rpc-tests/hardforkdetection.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # # Test hard fork detection diff --git a/qa/rpc-tests/httpbasics.py b/qa/rpc-tests/httpbasics.py index ff5544a2c..525d48b2a 100755 --- a/qa/rpc-tests/httpbasics.py +++ b/qa/rpc-tests/httpbasics.py @@ -1,12 +1,10 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html -# # Test rpc http basics -# from test_framework.test_framework import BitcoinTestFramework from test_framework.util import assert_equal, start_nodes @@ -97,7 +95,7 @@ class HTTPBasicsTest (BitcoinTestFramework): conn.request('POST', '/', '{"method": "getbestblockhash"}', headers) out1 = conn.getresponse().read() assert_equal('"error":null' in out1, True) - assert_equal(conn.sock!=None, True) # connection must be closed because bitcoind should use keep-alive by default + assert_equal(conn.sock!=None, True) # connection must be closed because hushd should use keep-alive by default if __name__ == '__main__': HTTPBasicsTest().main() diff --git a/qa/rpc-tests/invalidateblock.py b/qa/rpc-tests/invalidateblock.py index ea189ff85..a63ccc15d 100755 --- a/qa/rpc-tests/invalidateblock.py +++ b/qa/rpc-tests/invalidateblock.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/invalidblockrequest.py b/qa/rpc-tests/invalidblockrequest.py index f806d07ec..001ef8a23 100755 --- a/qa/rpc-tests/invalidblockrequest.py +++ b/qa/rpc-tests/invalidblockrequest.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # # Distributed under the GPLv3/X11 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/ivk_import_export.py b/qa/rpc-tests/ivk_import_export.py index a5eaf5233..8fb943cbb 100755 --- a/qa/rpc-tests/ivk_import_export.py +++ b/qa/rpc-tests/ivk_import_export.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2019 Bartlomiej Lisiecki # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/key_import_export.py b/qa/rpc-tests/key_import_export.py index f7e13a732..469a0589a 100755 --- a/qa/rpc-tests/key_import_export.py +++ b/qa/rpc-tests/key_import_export.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2017 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/keypool.py b/qa/rpc-tests/keypool.py index 0a22cae8a..d2461f699 100755 --- a/qa/rpc-tests/keypool.py +++ b/qa/rpc-tests/keypool.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/listtransactions.py b/qa/rpc-tests/listtransactions.py index f82494ca2..c5b91ea1d 100755 --- a/qa/rpc-tests/listtransactions.py +++ b/qa/rpc-tests/listtransactions.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/maxblocksinflight.py b/qa/rpc-tests/maxblocksinflight.py index 4b7e6e624..e2a301708 100755 --- a/qa/rpc-tests/maxblocksinflight.py +++ b/qa/rpc-tests/maxblocksinflight.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # # Distributed under the GPLv3/X11 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/mempool_nu_activation.py b/qa/rpc-tests/mempool_nu_activation.py index fead09452..581f9ba76 100755 --- a/qa/rpc-tests/mempool_nu_activation.py +++ b/qa/rpc-tests/mempool_nu_activation.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2018 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/mempool_reorg.py b/qa/rpc-tests/mempool_reorg.py index e08b5985f..9d7f36341 100755 --- a/qa/rpc-tests/mempool_reorg.py +++ b/qa/rpc-tests/mempool_reorg.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/mempool_resurrect_test.py b/qa/rpc-tests/mempool_resurrect_test.py index 6afad2c7d..94f1d4af7 100755 --- a/qa/rpc-tests/mempool_resurrect_test.py +++ b/qa/rpc-tests/mempool_resurrect_test.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/mempool_spendcoinbase.py b/qa/rpc-tests/mempool_spendcoinbase.py index ee6465868..edd484af7 100755 --- a/qa/rpc-tests/mempool_spendcoinbase.py +++ b/qa/rpc-tests/mempool_spendcoinbase.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/mempool_tx_expiry.py b/qa/rpc-tests/mempool_tx_expiry.py index de43e3bf3..795ec9666 100755 --- a/qa/rpc-tests/mempool_tx_expiry.py +++ b/qa/rpc-tests/mempool_tx_expiry.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2018 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/mempool_tx_input_limit.py b/qa/rpc-tests/mempool_tx_input_limit.py index 28761aca8..2c4b50572 100755 --- a/qa/rpc-tests/mempool_tx_input_limit.py +++ b/qa/rpc-tests/mempool_tx_input_limit.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2017 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/merkle_blocks.py b/qa/rpc-tests/merkle_blocks.py index 4de09a02d..151c3cb71 100755 --- a/qa/rpc-tests/merkle_blocks.py +++ b/qa/rpc-tests/merkle_blocks.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/nodehandling.py b/qa/rpc-tests/nodehandling.py index f23e19ade..67b0ec313 100755 --- a/qa/rpc-tests/nodehandling.py +++ b/qa/rpc-tests/nodehandling.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/nspv_client_test.py b/qa/rpc-tests/nspv_client_test.py index 45606cec1..989059058 100755 --- a/qa/rpc-tests/nspv_client_test.py +++ b/qa/rpc-tests/nspv_client_test.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html import sys diff --git a/qa/rpc-tests/p2p-acceptblock.py b/qa/rpc-tests/p2p-acceptblock.py index 4dccdfae5..cd17190d0 100755 --- a/qa/rpc-tests/p2p-acceptblock.py +++ b/qa/rpc-tests/p2p-acceptblock.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # # Distributed under the GPLv3/X11 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html @@ -116,8 +116,8 @@ class TestNode(NodeConnCB): class AcceptBlockTest(BitcoinTestFramework): def add_options(self, parser): parser.add_option("--testbinary", dest="testbinary", - default=os.getenv("BITCOIND", "bitcoind"), - help="bitcoind binary to test") + default=os.getenv("BITCOIND", "hushd"), + help="hushd binary to test") def setup_chain(self): initialize_chain_clean(self.options.tmpdir, 2) diff --git a/qa/rpc-tests/p2p_node_bloom.py b/qa/rpc-tests/p2p_node_bloom.py index 6bbb3be57..ed17c2323 100755 --- a/qa/rpc-tests/p2p_node_bloom.py +++ b/qa/rpc-tests/p2p_node_bloom.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2018 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/p2p_txexpiry_dos.py b/qa/rpc-tests/p2p_txexpiry_dos.py index c870f2e74..251195ca5 100755 --- a/qa/rpc-tests/p2p_txexpiry_dos.py +++ b/qa/rpc-tests/p2p_txexpiry_dos.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2018 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/prioritisetransaction.py b/qa/rpc-tests/prioritisetransaction.py index 4038c7a8f..bfdfa8ae5 100755 --- a/qa/rpc-tests/prioritisetransaction.py +++ b/qa/rpc-tests/prioritisetransaction.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2017 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/proxy_test.py b/qa/rpc-tests/proxy_test.py index 1a200db56..8fb1a4fa0 100755 --- a/qa/rpc-tests/proxy_test.py +++ b/qa/rpc-tests/proxy_test.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2015 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html @@ -13,10 +13,10 @@ import os ''' Test plan: -- Start bitcoind's with different proxy configurations +- Start hushd's with different proxy configurations - Use addnode to initiate connections - Verify that proxies are connected to, and the right connection command is given -- Proxy configurations to test on bitcoind side: +- Proxy configurations to test on hushd side: - `-proxy` (proxy everything) - `-onion` (proxy just onions) - `-proxyrandomize` Circuit randomization @@ -26,8 +26,8 @@ Test plan: - proxy on IPv6 - Create various proxies (as threads) -- Create bitcoinds that connect to them -- Manipulate the bitcoinds using addnode (onetry) an observe effects +- Create hushds that connect to them +- Manipulate the hushds using addnode (onetry) an observe effects addnode connect to IPv4 addnode connect to IPv6 @@ -78,7 +78,7 @@ class ProxyTest(BitcoinTestFramework): node.addnode("15.61.23.23:1234", "onetry") cmd = proxies[0].queue.get() assert(isinstance(cmd, Socks5Command)) - # Note: bitcoind's SOCKS5 implementation only sends atyp DOMAINNAME, even if connecting directly to IPv4/IPv6 + # Note: hushd's SOCKS5 implementation only sends atyp DOMAINNAME, even if connecting directly to IPv4/IPv6 assert_equal(cmd.atyp, AddressType.DOMAINNAME) assert_equal(cmd.addr, "15.61.23.23") assert_equal(cmd.port, 1234) @@ -91,7 +91,7 @@ class ProxyTest(BitcoinTestFramework): node.addnode("[1233:3432:2434:2343:3234:2345:6546:4534]:5443", "onetry") cmd = proxies[1].queue.get() assert(isinstance(cmd, Socks5Command)) - # Note: bitcoind's SOCKS5 implementation only sends atyp DOMAINNAME, even if connecting directly to IPv4/IPv6 + # Note: hushd's SOCKS5 implementation only sends atyp DOMAINNAME, even if connecting directly to IPv4/IPv6 assert_equal(cmd.atyp, AddressType.DOMAINNAME) assert_equal(cmd.addr, "1233:3432:2434:2343:3234:2345:6546:4534") assert_equal(cmd.port, 5443) @@ -102,24 +102,24 @@ class ProxyTest(BitcoinTestFramework): if test_onion: # Test: outgoing onion connection through node - node.addnode("bitcoinostk4e4re.onion:8333", "onetry") + node.addnode("hushv3h6mbxd2pptj42reko3jcexcgnz5zvp3mqcu6myto3jhhn4yzyd.onion:18030", "onetry") cmd = proxies[2].queue.get() assert(isinstance(cmd, Socks5Command)) assert_equal(cmd.atyp, AddressType.DOMAINNAME) - assert_equal(cmd.addr, "bitcoinostk4e4re.onion") - assert_equal(cmd.port, 8333) + assert_equal(cmd.addr, "hushv3h6mbxd2pptj42reko3jcexcgnz5zvp3mqcu6myto3jhhn4yzyd.onion") + assert_equal(cmd.port, 18030) if not auth: assert_equal(cmd.username, None) assert_equal(cmd.password, None) rv.append(cmd) # Test: outgoing DNS name connection through node - node.addnode("node.noumenon:8333", "onetry") + node.addnode("node.noumenon:18030", "onetry") cmd = proxies[3].queue.get() assert(isinstance(cmd, Socks5Command)) assert_equal(cmd.atyp, AddressType.DOMAINNAME) assert_equal(cmd.addr, "node.noumenon") - assert_equal(cmd.port, 8333) + assert_equal(cmd.port, 18030) if not auth: assert_equal(cmd.username, None) assert_equal(cmd.password, None) diff --git a/qa/rpc-tests/pruning.py b/qa/rpc-tests/pruning.py index 44d8c8b5d..f4edea46c 100755 --- a/qa/rpc-tests/pruning.py +++ b/qa/rpc-tests/pruning.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/rawtransactions.py b/qa/rpc-tests/rawtransactions.py index b59d4f073..e5a66f2e6 100755 --- a/qa/rpc-tests/rawtransactions.py +++ b/qa/rpc-tests/rawtransactions.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/receivedby.py b/qa/rpc-tests/receivedby.py index a2e3bc224..73cc6b9ac 100755 --- a/qa/rpc-tests/receivedby.py +++ b/qa/rpc-tests/receivedby.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/regtest_signrawtransaction.py b/qa/rpc-tests/regtest_signrawtransaction.py index 520d7fca9..e47bcebac 100755 --- a/qa/rpc-tests/regtest_signrawtransaction.py +++ b/qa/rpc-tests/regtest_signrawtransaction.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2018 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/reindex.py b/qa/rpc-tests/reindex.py index f8f06d96a..a6ffda7f4 100755 --- a/qa/rpc-tests/reindex.py +++ b/qa/rpc-tests/reindex.py @@ -1,6 +1,6 @@ #!/usr/bin/env python2 # Copyright (c) 2014 The Bitcoin Core developers -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Released under the GPLv3 # # Test -reindex with CheckBlockIndex diff --git a/qa/rpc-tests/rest.py b/qa/rpc-tests/rest.py index a1ba0cc06..3368f7b2f 100755 --- a/qa/rpc-tests/rest.py +++ b/qa/rpc-tests/rest.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/rewind_index.py b/qa/rpc-tests/rewind_index.py index 65d1d2a13..d08ef4f50 100755 --- a/qa/rpc-tests/rewind_index.py +++ b/qa/rpc-tests/rewind_index.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2018 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/rpcbind_test.py b/qa/rpc-tests/rpcbind_test.py index d95e9aca5..78e13879f 100755 --- a/qa/rpc-tests/rpcbind_test.py +++ b/qa/rpc-tests/rpcbind_test.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/script_test.py b/qa/rpc-tests/script_test.py index 4175e7d13..b64df0654 100755 --- a/qa/rpc-tests/script_test.py +++ b/qa/rpc-tests/script_test.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # # Distributed under the GPLv3/X11 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/signrawtransaction_offline.py b/qa/rpc-tests/signrawtransaction_offline.py index 84f3e1888..1abf5d93d 100755 --- a/qa/rpc-tests/signrawtransaction_offline.py +++ b/qa/rpc-tests/signrawtransaction_offline.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/signrawtransactions.py b/qa/rpc-tests/signrawtransactions.py index a7fe196b1..f44903368 100755 --- a/qa/rpc-tests/signrawtransactions.py +++ b/qa/rpc-tests/signrawtransactions.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2015 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/smartfees.py b/qa/rpc-tests/smartfees.py index 19c233d4f..690eb2c52 100755 --- a/qa/rpc-tests/smartfees.py +++ b/qa/rpc-tests/smartfees.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/spentindex.py b/qa/rpc-tests/spentindex.py index 2300df6c3..a9456343f 100755 --- a/qa/rpc-tests/spentindex.py +++ b/qa/rpc-tests/spentindex.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/test_framework/authproxy.py b/qa/rpc-tests/test_framework/authproxy.py index 32cf6fd0d..99eec966a 100644 --- a/qa/rpc-tests/test_framework/authproxy.py +++ b/qa/rpc-tests/test_framework/authproxy.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/test_framework/bignum.py b/qa/rpc-tests/test_framework/bignum.py index cf6e9418f..3ac80f28b 100644 --- a/qa/rpc-tests/test_framework/bignum.py +++ b/qa/rpc-tests/test_framework/bignum.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html # This file is from python-bitcoinlib. diff --git a/qa/rpc-tests/test_framework/blockstore.py b/qa/rpc-tests/test_framework/blockstore.py index 6687be3df..a72e299c2 100644 --- a/qa/rpc-tests/test_framework/blockstore.py +++ b/qa/rpc-tests/test_framework/blockstore.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html # BlockStore: a helper class that keeps a map of blocks and implements diff --git a/qa/rpc-tests/test_framework/blocktools.py b/qa/rpc-tests/test_framework/blocktools.py index 260ea9f62..c3dbe1e91 100644 --- a/qa/rpc-tests/test_framework/blocktools.py +++ b/qa/rpc-tests/test_framework/blocktools.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html # blocktools.py - utilities for manipulating blocks and transactions diff --git a/qa/rpc-tests/test_framework/comptool.py b/qa/rpc-tests/test_framework/comptool.py index 9daaae04e..6cc86b7ee 100755 --- a/qa/rpc-tests/test_framework/comptool.py +++ b/qa/rpc-tests/test_framework/comptool.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/test_framework/equihash.py b/qa/rpc-tests/test_framework/equihash.py index e0d9cf306..0687e146c 100755 --- a/qa/rpc-tests/test_framework/equihash.py +++ b/qa/rpc-tests/test_framework/equihash.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html from operator import itemgetter diff --git a/qa/rpc-tests/test_framework/mininode.py b/qa/rpc-tests/test_framework/mininode.py index 421691bcb..cf6e27573 100755 --- a/qa/rpc-tests/test_framework/mininode.py +++ b/qa/rpc-tests/test_framework/mininode.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html # mininode.py - Bitcoin P2P network half-a-node @@ -984,24 +984,6 @@ class msg_addr(object): return "msg_addr(addrs=%s)" % (repr(self.addrs)) -class msg_alert(object): - command = "alert" - - def __init__(self): - self.alert = CAlert() - - def deserialize(self, f): - self.alert = CAlert() - self.alert.deserialize(f) - - def serialize(self): - r = "" - r += self.alert.serialize() - return r - - def __repr__(self): - return "msg_alert(alert=%s)" % (repr(self.alert), ) - class msg_inv(object): command = "inv" @@ -1370,7 +1352,6 @@ class NodeConn(asyncore.dispatcher): "version": msg_version, "verack": msg_verack, "addr": msg_addr, - "alert": msg_alert, "inv": msg_inv, "getdata": msg_getdata, "getblocks": msg_getblocks, diff --git a/qa/rpc-tests/test_framework/netutil.py b/qa/rpc-tests/test_framework/netutil.py index 57baecdc0..58ca50f4b 100644 --- a/qa/rpc-tests/test_framework/netutil.py +++ b/qa/rpc-tests/test_framework/netutil.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/test_framework/script.py b/qa/rpc-tests/test_framework/script.py index ae8a2fc7a..fac036afe 100644 --- a/qa/rpc-tests/test_framework/script.py +++ b/qa/rpc-tests/test_framework/script.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html # This file is modified from python-bitcoinlib. diff --git a/qa/rpc-tests/test_framework/socks5.py b/qa/rpc-tests/test_framework/socks5.py index 9138f221b..3ea71119c 100644 --- a/qa/rpc-tests/test_framework/socks5.py +++ b/qa/rpc-tests/test_framework/socks5.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2015 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/test_framework/test_framework.py b/qa/rpc-tests/test_framework/test_framework.py index 8fa2876ea..2fdfe028e 100755 --- a/qa/rpc-tests/test_framework/test_framework.py +++ b/qa/rpc-tests/test_framework/test_framework.py @@ -1,6 +1,6 @@ #!/usr/bin/env python2 # Copyright (c) 2014 The Bitcoin Core developers -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html # Base class for RPC testing diff --git a/qa/rpc-tests/timestampindex.py b/qa/rpc-tests/timestampindex.py index ca37d469d..770f54554 100755 --- a/qa/rpc-tests/timestampindex.py +++ b/qa/rpc-tests/timestampindex.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/txindex.py b/qa/rpc-tests/txindex.py index 89e5a6886..6d2c45c5a 100755 --- a/qa/rpc-tests/txindex.py +++ b/qa/rpc-tests/txindex.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/txn_doublespend.py b/qa/rpc-tests/txn_doublespend.py index e3952f43e..5c6a28357 100755 --- a/qa/rpc-tests/txn_doublespend.py +++ b/qa/rpc-tests/txn_doublespend.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/wallet.py b/qa/rpc-tests/wallet.py index 6ef8e3162..c50c028a3 100755 --- a/qa/rpc-tests/wallet.py +++ b/qa/rpc-tests/wallet.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/wallet_1941.py b/qa/rpc-tests/wallet_1941.py index 678e75af4..039008b22 100755 --- a/qa/rpc-tests/wallet_1941.py +++ b/qa/rpc-tests/wallet_1941.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2016 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/wallet_addresses.py b/qa/rpc-tests/wallet_addresses.py index 53f16fcc4..7c3a1f6b2 100755 --- a/qa/rpc-tests/wallet_addresses.py +++ b/qa/rpc-tests/wallet_addresses.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2018 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/wallet_anchorfork.py b/qa/rpc-tests/wallet_anchorfork.py index 46e5cf3c5..59be606f0 100755 --- a/qa/rpc-tests/wallet_anchorfork.py +++ b/qa/rpc-tests/wallet_anchorfork.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2018 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/wallet_changeindicator.py b/qa/rpc-tests/wallet_changeindicator.py index 21274208a..4ce3126ef 100755 --- a/qa/rpc-tests/wallet_changeindicator.py +++ b/qa/rpc-tests/wallet_changeindicator.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2018 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/wallet_import_export.py b/qa/rpc-tests/wallet_import_export.py index b3a266cbe..502cc3936 100755 --- a/qa/rpc-tests/wallet_import_export.py +++ b/qa/rpc-tests/wallet_import_export.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2018 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/wallet_listnotes.py b/qa/rpc-tests/wallet_listnotes.py index 66715a682..6172cc45a 100755 --- a/qa/rpc-tests/wallet_listnotes.py +++ b/qa/rpc-tests/wallet_listnotes.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2018 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/wallet_listreceived.py b/qa/rpc-tests/wallet_listreceived.py index ca48cb975..2856c642d 100755 --- a/qa/rpc-tests/wallet_listreceived.py +++ b/qa/rpc-tests/wallet_listreceived.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2018 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/wallet_mergetoaddress.py b/qa/rpc-tests/wallet_mergetoaddress.py index 0684ccf1e..8a2e2cf8f 100755 --- a/qa/rpc-tests/wallet_mergetoaddress.py +++ b/qa/rpc-tests/wallet_mergetoaddress.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2017 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/wallet_nullifiers.py b/qa/rpc-tests/wallet_nullifiers.py index d2cd485cc..6322ef4d8 100755 --- a/qa/rpc-tests/wallet_nullifiers.py +++ b/qa/rpc-tests/wallet_nullifiers.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2016 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/wallet_overwintertx.py b/qa/rpc-tests/wallet_overwintertx.py index 6f8c03dce..c6d764eb6 100755 --- a/qa/rpc-tests/wallet_overwintertx.py +++ b/qa/rpc-tests/wallet_overwintertx.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2018 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/wallet_persistence.py b/qa/rpc-tests/wallet_persistence.py index 90076b867..b40782879 100755 --- a/qa/rpc-tests/wallet_persistence.py +++ b/qa/rpc-tests/wallet_persistence.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2018 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/wallet_protectcoinbase.py b/qa/rpc-tests/wallet_protectcoinbase.py index 9f91ff55f..98ca1fe11 100755 --- a/qa/rpc-tests/wallet_protectcoinbase.py +++ b/qa/rpc-tests/wallet_protectcoinbase.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2016 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/wallet_sapling.py b/qa/rpc-tests/wallet_sapling.py index 9cb120583..c9e796b72 100755 --- a/qa/rpc-tests/wallet_sapling.py +++ b/qa/rpc-tests/wallet_sapling.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2018 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/wallet_shieldcoinbase.py b/qa/rpc-tests/wallet_shieldcoinbase.py index 4747c2c1e..889b6ad36 100755 --- a/qa/rpc-tests/wallet_shieldcoinbase.py +++ b/qa/rpc-tests/wallet_shieldcoinbase.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2017 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/wallet_shieldcoinbase_sapling.py b/qa/rpc-tests/wallet_shieldcoinbase_sapling.py index aa5d733e1..0c0aafe93 100755 --- a/qa/rpc-tests/wallet_shieldcoinbase_sapling.py +++ b/qa/rpc-tests/wallet_shieldcoinbase_sapling.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html import inspect diff --git a/qa/rpc-tests/wallet_treestate.py b/qa/rpc-tests/wallet_treestate.py index d0dc37528..20f3d4569 100755 --- a/qa/rpc-tests/wallet_treestate.py +++ b/qa/rpc-tests/wallet_treestate.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2016 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/walletbackup.py b/qa/rpc-tests/walletbackup.py index f43947869..66d67c7d2 100755 --- a/qa/rpc-tests/walletbackup.py +++ b/qa/rpc-tests/walletbackup.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/zapwallettxes.py b/qa/rpc-tests/zapwallettxes.py index e14939fd0..824c05c65 100755 --- a/qa/rpc-tests/zapwallettxes.py +++ b/qa/rpc-tests/zapwallettxes.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/qa/rpc-tests/zkey_import_export.py b/qa/rpc-tests/zkey_import_export.py index b4abff512..6c7baa35d 100755 --- a/qa/rpc-tests/zkey_import_export.py +++ b/qa/rpc-tests/zkey_import_export.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Copyright (c) 2017 The Zcash developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/share/genbuild.sh b/share/genbuild.sh index d4dc35ed4..65720456b 100755 --- a/share/genbuild.sh +++ b/share/genbuild.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2018-2022 The Hush developers +# Copyright (c) 2018-2023 The Hush developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html if [ $# -gt 1 ]; then diff --git a/src/Makefile.am b/src/Makefile.am index 5fe0118c0..e5e2ca248 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,4 +1,4 @@ -# Copyright 2016-2022 The Hush developers +# Copyright 2016-2023 The Hush developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html @@ -9,6 +9,12 @@ AM_CXXFLAGS = $(SAN_CXXFLAGS) $(HARDENED_CXXFLAGS) $(ERROR_CXXFLAGS) AM_CPPFLAGS = $(HARDENED_CPPFLAGS) EXTRA_LIBRARIES = +if ARCH_ARM +PLATFORM_VARIANT = armv8.1-a+crypto +else +PLATFORM_VARIANT = x86-64 +endif + if EMBEDDED_LEVELDB LEVELDB_CPPFLAGS += -I$(srcdir)/leveldb/include LEVELDB_CPPFLAGS += -I$(srcdir)/leveldb/helpers/memenv @@ -28,6 +34,7 @@ BITCOIN_CONFIG_INCLUDES=-I$(builddir)/config BITCOIN_INCLUDES=-I$(builddir) -I$(builddir)/obj $(BDB_CPPFLAGS) $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS) $(CRYPTO_CFLAGS) $(SSL_CFLAGS) BITCOIN_INCLUDES += -I$(srcdir)/secp256k1/include +BITCOIN_INCLUDES += -I$(srcdir)/cc/includes BITCOIN_INCLUDES += -I$(srcdir)/cryptoconditions/include BITCOIN_INCLUDES += -I$(srcdir)/cryptoconditions/src BITCOIN_INCLUDES += -I$(srcdir)/cryptoconditions/src/asn @@ -63,13 +70,13 @@ LIBBITCOIN_WALLET=libbitcoin_wallet.a endif $(LIBSECP256K1): $(wildcard secp256k1/src/*) $(wildcard secp256k1/include/*) - $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F) OPTFLAGS="-O2 -g " + $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F) OPTFLAGS="-O2 -march=$(PLATFORM_VARIANT) -g " $(LIBUNIVALUE): $(wildcard univalue/lib/*) - $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F) OPTFLAGS="-O2 -g " + $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F) OPTFLAGS="-O2 -march=$(PLATFORM_VARIANT) -g " $(LIBCRYPTOCONDITIONS): $(wildcard cryptoconditions/src/*) $(wildcard cryptoconditions/include/*) - $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F) OPTFLAGS="-O2 -g " + $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F) OPTFLAGS="-O2 -march=$(PLATFORM_VARIANT) -g " # Make is not made aware of per-object dependencies to avoid limiting building parallelization # But to build the less dependent modules first, we manually select their order here: @@ -122,7 +129,8 @@ BITCOIN_CORE_H = \ addressindex.h \ spentindex.h \ addrman.h \ - alert.h \ + attributes.h \ + addrdb.h \ amount.h \ amqp/amqpabstractnotifier.h \ amqp/amqpconfig.h \ @@ -161,6 +169,7 @@ BITCOIN_CORE_H = \ hash.h \ httprpc.h \ httpserver.h \ + i2p.h \ init.h \ key.h \ key_io.h \ @@ -175,10 +184,13 @@ BITCOIN_CORE_H = \ mruset.h \ net.h \ netbase.h \ + netaddress.h \ + netmessagemaker.h \ noui.h \ policy/fees.h \ pow.h \ prevector.h \ + span.h \ primitives/block.h \ primitives/transaction.h \ protocol.h \ @@ -218,8 +230,13 @@ BITCOIN_CORE_H = \ uint252.h \ undo.h \ util.h \ + util/readwritefile.h \ + util/sock.h \ + util/string.h \ + util/spanparsing.h \ + util/strencodings.h \ utilmoneystr.h \ - utilstrencodings.h \ + # utilstrencodings.h \ utiltime.h \ validationinterface.h \ version.h \ @@ -249,10 +266,8 @@ libbitcoin_util_a-clientversion.$(OBJEXT): obj/build.h libbitcoin_server_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(EVENT_CFLAGS) $(EVENT_PTHREADS_CFLAGS) libbitcoin_server_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) libbitcoin_server_a_SOURCES = \ - sendalert.cpp \ addrman.cpp \ - alert.cpp \ - alertkeys.h \ + addrdb.cpp \ asyncrpcoperation.cpp \ asyncrpcqueue.cpp \ bloom.cpp \ @@ -287,6 +302,7 @@ libbitcoin_server_a_SOURCES = \ deprecation.cpp \ httprpc.cpp \ httpserver.cpp \ + i2p.cpp \ init.cpp \ dbwrapper.cpp \ main.cpp \ @@ -361,6 +377,8 @@ crypto_libbitcoin_crypto_a_SOURCES = \ crypto/ripemd160.h \ crypto/sha1.cpp \ crypto/sha1.h \ + crypto/sha3.cpp \ + crypto/sha3.h \ crypto/sha256.cpp \ crypto/sha256.h \ crypto/sha512.cpp \ @@ -401,6 +419,7 @@ libbitcoin_common_a_SOURCES = \ key.cpp \ key_io.cpp \ keystore.cpp \ + netaddress.cpp \ netbase.cpp \ metrics.cpp \ primitives/block.cpp \ @@ -439,9 +458,13 @@ libbitcoin_util_a_SOURCES = \ uint256.cpp \ util.cpp \ utilmoneystr.cpp \ - utilstrencodings.cpp \ utiltime.cpp \ + util/strencodings.cpp \ util/asmap.cpp \ + util/sock.cpp \ + util/spanparsing.cpp \ + util/string.cpp \ + util/readwritefile.cpp \ $(BITCOIN_CORE_H) \ $(LIBZCASH_H) @@ -671,6 +694,8 @@ clean-local: -$(MAKE) -C univalue clean rm -f leveldb/*/*.gcno leveldb/helpers/memenv/*.gcno -rm -f config.h + -rm -f *.a + -rm -f *.so .rc.o: @test -f $(WINDRES) diff --git a/src/Makefile.gtest.include b/src/Makefile.gtest.include index 8cd1a5aba..77749db15 100644 --- a/src/Makefile.gtest.include +++ b/src/Makefile.gtest.include @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Released under the GPLv3 TESTS += hush-gtest bin_PROGRAMS += hush-gtest diff --git a/src/Makefile.test-hush.include b/src/Makefile.test-hush.include index 0cc4e43c1..393c42117 100644 --- a/src/Makefile.test-hush.include +++ b/src/Makefile.test-hush.include @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/src/RandomX/src/virtual_memory.cpp b/src/RandomX/src/virtual_memory.cpp index caf02922a..248d3a2c4 100644 --- a/src/RandomX/src/virtual_memory.cpp +++ b/src/RandomX/src/virtual_memory.cpp @@ -38,7 +38,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include # if TARGET_OS_OSX -# define USE_PTHREAD_JIT_WP 1 +# if TARGET_CPU_ARM64 +# define USE_PTHREAD_JIT_WP 1 +# else +# undef USE_PTHREAD_JIT_WP +# endif # include # endif #endif diff --git a/src/addrdb.cpp b/src/addrdb.cpp new file mode 100644 index 000000000..f477ab7bc --- /dev/null +++ b/src/addrdb.cpp @@ -0,0 +1,122 @@ +// Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2009-2016 The Bitcoin Core developers +// Copyright (c) 2016-2023 The Hush developers +// Distributed under the GPLv3 software license, see the accompanying +// file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html + +#include "addrdb.h" +#include "addrman.h" +#include "chainparams.h" +#include "clientversion.h" +#include "fs.h" +#include "hash.h" +#include "random.h" +#include "streams.h" +#include "tinyformat.h" +#include "util.h" + +namespace { + +template +bool SerializeDB(Stream& stream, const Data& data) +{ + // Write and commit header, data + try { + CHashWriter hasher(stream.GetType(), stream.GetVersion()); + stream << FLATDATA(Params().MessageStart()) << data; + hasher << FLATDATA(Params().MessageStart()) << data; + stream << hasher.GetHash(); + } catch (const std::exception& e) { + return error("%s: Serialize or I/O error - %s", __func__, e.what()); + } + + return true; +} + +template +bool SerializeFileDB(const std::string& prefix, const fs::path& path, const Data& data) +{ + // Generate random temporary filename + unsigned short randv = 0; + GetRandBytes((unsigned char*)&randv, sizeof(randv)); + std::string tmpfn = strprintf("%s.%04x", prefix, randv); + + // open temp output file, and associate with CAutoFile + fs::path pathTmp = GetDataDir() / tmpfn; + FILE *file = fsbridge::fopen(pathTmp, "wb"); + CAutoFile fileout(file, SER_DISK, CLIENT_VERSION); + if (fileout.IsNull()) + return error("%s: Failed to open file %s", __func__, pathTmp.string()); + + // Serialize + if (!SerializeDB(fileout, data)) return false; + FileCommit(fileout.Get()); + fileout.fclose(); + + // replace existing file, if any, with new file + if (!RenameOver(pathTmp, path)) + return error("%s: Rename-into-place failed", __func__); + + return true; +} + +template +bool DeserializeDB(Stream& stream, Data& data, bool fCheckSum = true) +{ + try { + CHashVerifier verifier(&stream); + // de-serialize file header (network specific magic number) and .. + unsigned char pchMsgTmp[4]; + verifier >> FLATDATA(pchMsgTmp); + // ... verify the network matches ours + if (memcmp(pchMsgTmp, Params().MessageStart(), sizeof(pchMsgTmp))) + return error("%s: Invalid network magic number", __func__); + + // de-serialize data + verifier >> data; + + // verify checksum + if (fCheckSum) { + uint256 hashTmp; + stream >> hashTmp; + if (hashTmp != verifier.GetHash()) { + return error("%s: Checksum mismatch, data corrupted", __func__); + } + } + } + catch (const std::exception& e) { + return error("%s: Deserialize or I/O error - %s", __func__, e.what()); + } + + return true; +} + +template +bool DeserializeFileDB(const fs::path& path, Data& data) +{ + // open input file, and associate with CAutoFile + FILE *file = fsbridge::fopen(path, "rb"); + CAutoFile filein(file, SER_DISK, CLIENT_VERSION); + if (filein.IsNull()) + return error("%s: Failed to open file %s", __func__, path.string()); + + return DeserializeDB(filein, data); +} + +} + +CBanDB::CBanDB() +{ + pathBanlist = GetDataDir() / "banlist.dat"; +} + +bool CBanDB::Write(const banmap_t& banSet) +{ + return SerializeFileDB("banlist", pathBanlist, banSet); +} + +bool CBanDB::Read(banmap_t& banSet) +{ + return DeserializeFileDB(pathBanlist, banSet); +} + diff --git a/src/addrdb.h b/src/addrdb.h new file mode 100644 index 000000000..a5cf7dc97 --- /dev/null +++ b/src/addrdb.h @@ -0,0 +1,90 @@ +// Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2009-2016 The Bitcoin Core developers +// Distributed under the GPLv3 software license, see the accompanying +// file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html + +#ifndef HUSH_ADDRDB_H +#define HUSH_ADDRDB_H + +#include "fs.h" +#include "serialize.h" + +#include +#include + +class CSubNet; +class CAddrMan; +class CDataStream; + +typedef enum BanReason +{ + BanReasonUnknown = 0, + BanReasonNodeMisbehaving = 1, + BanReasonManuallyAdded = 2 +} BanReason; + +class CBanEntry +{ +public: + static const int CURRENT_VERSION=1; + int nVersion; + int64_t nCreateTime; + int64_t nBanUntil; + uint8_t banReason; + + CBanEntry() + { + SetNull(); + } + + explicit CBanEntry(int64_t nCreateTimeIn) + { + SetNull(); + nCreateTime = nCreateTimeIn; + } + + ADD_SERIALIZE_METHODS; + + template + inline void SerializationOp(Stream& s, Operation ser_action) { + READWRITE(this->nVersion); + READWRITE(nCreateTime); + READWRITE(nBanUntil); + READWRITE(banReason); + } + + void SetNull() + { + nVersion = CBanEntry::CURRENT_VERSION; + nCreateTime = 0; + nBanUntil = 0; + banReason = BanReasonUnknown; + } + + std::string banReasonToString() const + { + switch (banReason) { + case BanReasonNodeMisbehaving: + return "node misbehaving"; + case BanReasonManuallyAdded: + return "manually added"; + default: + return "unknown"; + } + } +}; + +typedef std::map banmap_t; + +/** Access to the banlist database (banlist.dat) */ +class CBanDB +{ +private: + fs::path pathBanlist; +public: + CBanDB(); + bool Write(const banmap_t& banSet); + bool Read(banmap_t& banSet); +}; + +#endif // HUSH_ADDRDB_H diff --git a/src/addressindex.h b/src/addressindex.h index 778295c27..1a0c279f4 100644 --- a/src/addressindex.h +++ b/src/addressindex.h @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2015 The Bitcoin Core developers -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/src/addrman.cpp b/src/addrman.cpp index d9b8a07cb..60f27347a 100644 --- a/src/addrman.cpp +++ b/src/addrman.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2012 Pieter Wuille -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html @@ -23,6 +23,7 @@ #include "hash.h" #include "serialize.h" #include "streams.h" +#include "init.h" int CAddrInfo::GetTriedBucket(const uint256& nKey, const std::vector &asmap) const { @@ -53,6 +54,9 @@ int CAddrInfo::GetBucketPosition(const uint256 &nKey, bool fNew, int nBucket) co bool CAddrInfo::IsTerrible(int64_t nNow) const { + if (fLocal) //never remove local addresses + return false; + if (nLastTry && nLastTry >= nNow - 60) // never remove things tried in the last minute return false; @@ -71,6 +75,14 @@ bool CAddrInfo::IsTerrible(int64_t nNow) const return false; } +bool CAddrInfo::IsJustTried(int64_t nNow) const +{ + if (nLastTry && nLastTry >= nNow - 60) + return true; + + return false; +} + double CAddrInfo::GetChance(int64_t nNow) const { double fChance = 1.0; @@ -95,24 +107,30 @@ double CAddrInfo::GetChance(int64_t nNow) const CAddrInfo* CAddrMan::Find(const CNetAddr& addr, int* pnId) { - std::map::iterator it = mapAddr.find(addr); + AssertLockHeld(cs); + + const auto it = mapAddr.find(addr); if (it == mapAddr.end()) - return NULL; + return nullptr; if (pnId) *pnId = (*it).second; - std::map::iterator it2 = mapInfo.find((*it).second); + const auto it2 = mapInfo.find((*it).second); if (it2 != mapInfo.end()) return &(*it2).second; - return NULL; + return nullptr; } CAddrInfo* CAddrMan::Create(const CAddress& addr, const CNetAddr& addrSource, int* pnId) { - int nId = nIdCount++; + AssertLockHeld(cs); + + int nId = nIdCount; mapInfo[nId] = CAddrInfo(addr, addrSource); mapAddr[addr] = nId; mapInfo[nId].nRandomPos = vRandom.size(); vRandom.push_back(nId); + nNew++; + nIdCount++; if (pnId) *pnId = nId; return &mapInfo[nId]; @@ -120,6 +138,8 @@ CAddrInfo* CAddrMan::Create(const CAddress& addr, const CNetAddr& addrSource, in void CAddrMan::SwapRandom(unsigned int nRndPos1, unsigned int nRndPos2) { + AssertLockHeld(cs); + if (nRndPos1 == nRndPos2) return; @@ -128,11 +148,13 @@ void CAddrMan::SwapRandom(unsigned int nRndPos1, unsigned int nRndPos2) int nId1 = vRandom[nRndPos1]; int nId2 = vRandom[nRndPos2]; - assert(mapInfo.count(nId1) == 1); - assert(mapInfo.count(nId2) == 1); + const auto it_1{mapInfo.find(nId1)}; + const auto it_2{mapInfo.find(nId2)}; + assert(it_1 != mapInfo.end()); + assert(it_2 != mapInfo.end()); - mapInfo[nId1].nRandomPos = nRndPos2; - mapInfo[nId2].nRandomPos = nRndPos1; + it_1->second.nRandomPos = nRndPos2; + it_2->second.nRandomPos = nRndPos1; vRandom[nRndPos1] = nId2; vRandom[nRndPos2] = nId1; @@ -140,41 +162,57 @@ void CAddrMan::SwapRandom(unsigned int nRndPos1, unsigned int nRndPos2) void CAddrMan::Delete(int nId) { - assert(mapInfo.count(nId) != 0); - CAddrInfo& info = mapInfo[nId]; - assert(!info.fInTried); - assert(info.nRefCount == 0); + AssertLockHeld(cs); + + const auto it{mapInfo.find(nId)}; + if (it != mapInfo.end()) { + CAddrInfo& info = (*it).second; + assert(!info.fInTried); + assert(info.nRefCount == 0); + + SwapRandom(info.nRandomPos, vRandom.size() - 1); + vRandom.pop_back(); + mapAddr.erase(info); + mapInfo.erase(nId); + nNew--; + } - SwapRandom(info.nRandomPos, vRandom.size() - 1); - vRandom.pop_back(); - mapAddr.erase(info); - mapInfo.erase(nId); - nNew--; } void CAddrMan::ClearNew(int nUBucket, int nUBucketPos) { + AssertLockHeld(cs); + // if there is an entry in the specified bucket, delete it. if (vvNew[nUBucket][nUBucketPos] != -1) { int nIdDelete = vvNew[nUBucket][nUBucketPos]; - CAddrInfo& infoDelete = mapInfo[nIdDelete]; - assert(infoDelete.nRefCount > 0); - infoDelete.nRefCount--; - vvNew[nUBucket][nUBucketPos] = -1; - if (infoDelete.nRefCount == 0) { - Delete(nIdDelete); + const auto it{mapInfo.find(nIdDelete)}; + if (it != mapInfo.end()) { + CAddrInfo& infoDelete = (*it).second; + assert(infoDelete.nRefCount > 0); + infoDelete.nRefCount--; + vvNew[nUBucket][nUBucketPos] = -1; + if (infoDelete.nRefCount == 0) { + Delete(nIdDelete); + } } } + } void CAddrMan::MakeTried(CAddrInfo& info, int nId) { + AssertLockHeld(cs); + // remove the entry from all new buckets - for (int bucket = 0; bucket < ADDRMAN_NEW_BUCKET_COUNT; bucket++) { - int pos = info.GetBucketPosition(nKey, true, bucket); + const int start_bucket{info.GetNewBucket(nKey, m_asmap)}; + for (int n = 0; n < ADDRMAN_NEW_BUCKET_COUNT; ++n) { + const int bucket{(start_bucket + n) % ADDRMAN_NEW_BUCKET_COUNT}; + const int pos{info.GetBucketPosition(nKey, true, bucket)}; if (vvNew[bucket][pos] == nId) { vvNew[bucket][pos] = -1; info.nRefCount--; + if (info.nRefCount == 0) break; } } nNew--; @@ -215,67 +253,6 @@ void CAddrMan::MakeTried(CAddrInfo& info, int nId) info.fInTried = true; } -void CAddrMan::Good_(const CService& addr, bool test_before_evict, int64_t nTime) { - int nId; - CAddrInfo* pinfo = Find(addr, &nId); - - // if not found, bail out - if (!pinfo) - return; - - CAddrInfo& info = *pinfo; - - // check whether we are talking about the exact same CService (including same port) - if (info != addr) - return; - - // update info - info.nLastSuccess = nTime; - info.nLastTry = nTime; - info.nAttempts = 0; - // nTime is not updated here, to avoid leaking information about - // currently-connected peers. - - // if it is already in the tried set, don't do anything else - if (info.fInTried) - return; - - // find a bucket it is in now - int nRnd = RandomInt(ADDRMAN_NEW_BUCKET_COUNT); - int nUBucket = -1; - for (unsigned int n = 0; n < ADDRMAN_NEW_BUCKET_COUNT; n++) { - int nB = (n + nRnd) % ADDRMAN_NEW_BUCKET_COUNT; - int nBpos = info.GetBucketPosition(nKey, true, nB); - if (vvNew[nB][nBpos] == nId) { - nUBucket = nB; - break; - } - } - - // if no bucket is found, something bad happened; - // TODO: maybe re-add the node, but for now, just bail out - if (nUBucket == -1) - return; - - // which tried bucket to move the entry to - int tried_bucket = info.GetTriedBucket(nKey,m_asmap); - int tried_bucket_pos = info.GetBucketPosition(nKey, false, tried_bucket); - - // Will moving this address into tried evict another entry? - if (test_before_evict && (vvTried[tried_bucket][tried_bucket_pos] != -1)) { - LogPrint("addrman", "Collision inserting element into tried table, moving %s to m_tried_collisions=%d\n", addr.ToString(), m_tried_collisions.size()); - if (m_tried_collisions.size() < ADDRMAN_SET_TRIED_COLLISION_SIZE) { - m_tried_collisions.insert(nId); - } - } else { - LogPrint("addrman", "Moving %s to tried\n", addr.ToString()); - printf("%s: Moving %s to tried\n", __func__, addr.ToString().c_str() ); - - // move nId to the tried tables - MakeTried(info, nId); - } -} - void CAddrMan::ResolveCollisions_() { for (std::set::iterator it = m_tried_collisions.begin(); it != m_tried_collisions.end();) { int id_new = *it; @@ -351,13 +328,59 @@ CAddrInfo CAddrMan::SelectTriedCollision_() { return mapInfo[id_old]; } +void CAddrMan::Good_(const CService& addr, bool test_before_evict, int64_t nTime) { + int nId; + CAddrInfo* pinfo = Find(addr, &nId); + + // if not found, bail out + if (!pinfo) + return; + + CAddrInfo& info = *pinfo; + + // check whether we are talking about the exact same CService (including same port) + if (info != addr) + return; + + // update info + info.nLastSuccess = nTime; + info.nLastTry = nTime; + info.nAttempts = 0; + // nTime is not updated here, to avoid leaking information about + // currently-connected peers. + + // if it is already in the tried set, don't do anything else + if (info.fInTried) + return; + + // find a bucket it is in now + int nRnd = RandomInt(ADDRMAN_NEW_BUCKET_COUNT); + int nUBucket = -1; + for (unsigned int n = 0; n < ADDRMAN_NEW_BUCKET_COUNT; n++) { + int nB = (n + nRnd) % ADDRMAN_NEW_BUCKET_COUNT; + int nBpos = info.GetBucketPosition(nKey, true, nB); + if (vvNew[nB][nBpos] == nId) { + nUBucket = nB; + break; + } + } + + // if no bucket is found, something bad happened; + // TODO: maybe re-add the node, but for now, just bail out + if (nUBucket == -1) + return; + + LogPrint("addrman", "Moving %s to tried\n", addr.ToString()); + + // move nId to the tried tables + MakeTried(info, nId); +} bool CAddrMan::Add_(const CAddress& addr, const CNetAddr& source, int64_t nTimePenalty) { if (!addr.IsRoutable()) return false; - bool fNew = false; int nId; CAddrInfo* pinfo = Find(addr, &nId); @@ -392,19 +415,20 @@ bool CAddrMan::Add_(const CAddress& addr, const CNetAddr& source, int64_t nTimeP } else { pinfo = Create(addr, source, &nId); pinfo->nTime = std::max((int64_t)0, (int64_t)pinfo->nTime - nTimePenalty); - nNew++; - fNew = true; } int nUBucket = pinfo->GetNewBucket(nKey, source, m_asmap); int nUBucketPos = pinfo->GetBucketPosition(nKey, true, nUBucket); + bool fInsert = vvNew[nUBucket][nUBucketPos] == -1; if (vvNew[nUBucket][nUBucketPos] != nId) { - bool fInsert = vvNew[nUBucket][nUBucketPos] == -1; if (!fInsert) { - CAddrInfo& infoExisting = mapInfo[vvNew[nUBucket][nUBucketPos]]; - if (infoExisting.IsTerrible() || (infoExisting.nRefCount > 1 && pinfo->nRefCount == 0)) { - // Overwrite the existing new table entry. - fInsert = true; + const auto it{mapInfo.find(vvNew[nUBucket][nUBucketPos])}; + if (it != mapInfo.end()) { + CAddrInfo& infoExisting = (*it).second; + if (infoExisting.IsTerrible() || (infoExisting.nRefCount > 1 && pinfo->nRefCount == 0)) { + // Overwrite the existing new table entry. + fInsert = true; + } } } if (fInsert) { @@ -417,7 +441,7 @@ bool CAddrMan::Add_(const CAddress& addr, const CNetAddr& source, int64_t nTimeP } } } - return fNew; + return fInsert; } void CAddrMan::Attempt_(const CService& addr, int64_t nTime) @@ -454,10 +478,15 @@ CAddrInfo CAddrMan::Select_(bool newOnly) // Use a 50% chance for choosing between tried and new table entries. if (!newOnly && - (nTried > 0 && (nNew == 0 || RandomInt(2) == 0))) { + (nTried > 0 && (nNew == 0 || RandomInt(2) == 0))) { // use a tried node double fChanceFactor = 1.0; + double fReachableFactor = 1.0; + double fJustTried = 1.0; while (1) { + if (ShutdownRequested()) //break loop on shutdown request + return CAddrInfo(); + int i = 0; int nKBucket = RandomInt(ADDRMAN_TRIED_BUCKET_COUNT); int nKBucketPos = RandomInt(ADDRMAN_BUCKET_SIZE); @@ -472,14 +501,27 @@ CAddrInfo CAddrMan::Select_(bool newOnly) int nId = vvTried[nKBucket][nKBucketPos]; assert(mapInfo.count(nId) == 1); CAddrInfo& info = mapInfo[nId]; - if (RandomInt(1 << 30) < fChanceFactor * info.GetChance() * (1 << 30)) + if (info.IsReachableNetwork()) { + //deprioritize unreachable networks + fReachableFactor = 0.25; + } + if (info.IsJustTried()) { + //deprioritize entries just tried + fJustTried = 0.10; + } + if (RandomInt(1 << 30) < fChanceFactor * fReachableFactor * fJustTried * info.GetChance() * (1 << 30)) return info; fChanceFactor *= 1.2; } } else { // use a new node double fChanceFactor = 1.0; + double fReachableFactor = 1.0; + double fJustTried = 1.0; while (1) { + if (ShutdownRequested()) //break loop on shutdown request + return CAddrInfo(); + int i = 0; int nUBucket = RandomInt(ADDRMAN_NEW_BUCKET_COUNT); int nUBucketPos = RandomInt(ADDRMAN_BUCKET_SIZE); @@ -494,12 +536,20 @@ CAddrInfo CAddrMan::Select_(bool newOnly) int nId = vvNew[nUBucket][nUBucketPos]; assert(mapInfo.count(nId) == 1); CAddrInfo& info = mapInfo[nId]; - if (RandomInt(1 << 30) < fChanceFactor * info.GetChance() * (1 << 30)) + if (info.IsReachableNetwork()) { + //deprioritize unreachable networks + fReachableFactor = 0.25; + } + if (info.IsJustTried()) { + //deprioritize entries just tried + fJustTried = 0.10; + } + if (RandomInt(1 << 30) < fChanceFactor * fReachableFactor * fJustTried * info.GetChance() * (1 << 30)) return info; fChanceFactor *= 1.2; } } - + return CAddrInfo(); } @@ -581,24 +631,59 @@ int CAddrMan::Check_() } #endif -void CAddrMan::GetAddr_(std::vector& vAddr) +void CAddrMan::GetAddr_(std::vector& vAddr, bool wants_addrv2) { unsigned int nNodes = ADDRMAN_GETADDR_MAX_PCT * vRandom.size() / 100; if (nNodes > ADDRMAN_GETADDR_MAX) nNodes = ADDRMAN_GETADDR_MAX; + int addrv2Nodes = nNodes/5; + int ipv4Nodes = 0; + int ipv6Nodes = 0; + int torNodes = 0; + int i2pNodes = 0; + int cjdnsNodes = 0; + + // Randomize Nodes + for (unsigned int n = 0; n < vRandom.size(); n++) { + int nRndPos = RandomInt(vRandom.size() - n) + n; + SwapRandom(n, nRndPos); + } + // gather a list of random nodes, skipping those of low quality for (unsigned int n = 0; n < vRandom.size(); n++) { if (vAddr.size() >= nNodes) break; - int nRndPos = RandomInt(vRandom.size() - n) + n; - SwapRandom(n, nRndPos); assert(mapInfo.count(vRandom[n]) == 1); - const CAddrInfo& ai = mapInfo[vRandom[n]]; - if (!ai.IsTerrible()) - vAddr.push_back(ai); + + if (!ai.IsTerrible()) { + if (!wants_addrv2) { + vAddr.push_back(ai); + } else { + if (ai.IsIPv4() && ipv4Nodes <= addrv2Nodes) { + vAddr.push_back(ai); + ipv4Nodes++; + } + if (ai.IsIPv6() && ipv6Nodes <= addrv2Nodes) { + vAddr.push_back(ai); + ipv6Nodes++; + } + if (ai.IsCJDNS() && cjdnsNodes <= addrv2Nodes) { + vAddr.push_back(ai); + cjdnsNodes++; + } + if (ai.IsTor() && torNodes <= addrv2Nodes) { + vAddr.push_back(ai); + torNodes++; + } + if (ai.IsI2P() && i2pNodes <= addrv2Nodes) { + vAddr.push_back(ai); + i2pNodes++; + } + } + } } } @@ -622,10 +707,36 @@ void CAddrMan::Connected_(const CService& addr, int64_t nTime) info.nTime = nTime; } +void CAddrMan::SetLocal_(const CService& addr) +{ + CAddrInfo* pinfo = Find(addr); + + // if not found, bail out + if (!pinfo) + return; + + CAddrInfo& info = *pinfo; + + // check whether we are talking about the exact same CService (including same port) + if (info != addr) + return; + + // update info + info.fLocal = true; +} + int CAddrMan::RandomInt(int nMax){ return GetRandInt(nMax); } +void CAddrMan::GetAllPeers(std::map &info) { + + for(std::map::iterator it = mapInfo.begin(); it != mapInfo.end(); it++) { + info[(*it).second.ToStringIPPort()] = (*it).second.GetLastSuccess(); + } + return; +} + std::vector CAddrMan::DecodeAsmap(fs::path path) { std::vector bits; diff --git a/src/addrman.h b/src/addrman.h index 5738913d4..ea95f7319 100644 --- a/src/addrman.h +++ b/src/addrman.h @@ -1,5 +1,5 @@ // Copyright (c) 2012 Pieter Wuille -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** @@ -24,6 +24,7 @@ #include "protocol.h" #include "random.h" #include "sync.h" +#include "streams.h" #include "timedata.h" #include "util.h" #include "fs.h" @@ -64,18 +65,17 @@ private: //! position in vRandom int nRandomPos; + //! Address is local + bool fLocal; + friend class CAddrMan; public: - ADD_SERIALIZE_METHODS; - - template - inline void SerializationOp(Stream& s, Operation ser_action) { - READWRITE(*(CAddress*)this); - READWRITE(source); - READWRITE(nLastSuccess); - READWRITE(nAttempts); + SERIALIZE_METHODS(CAddrInfo, obj) + { + READWRITEAS(CAddress, obj); + READ_WRITE(obj.source, obj.nLastSuccess, obj.nAttempts); } void Init() @@ -86,6 +86,7 @@ public: nRefCount = 0; fInTried = false; nRandomPos = -1; + fLocal = false; } CAddrInfo(const CAddress &addrIn, const CNetAddr &addrSource) : CAddress(addrIn), source(addrSource) @@ -116,9 +117,15 @@ public: //! Determine whether the statistics about this entry are bad enough so that it can just be deleted bool IsTerrible(int64_t nNow = GetTime()) const; + //Determine if this entry was just tried + bool IsJustTried(int64_t nNow = GetTime()) const; + //! Calculate the relative chance this entry should be given when selecting nodes to connect to double GetChance(int64_t nNow = GetTime()) const; + //Returns the last successful connection + int64_t GetLastSuccess() {return nTime;} + }; /** Stochastic address manager @@ -199,8 +206,30 @@ private: //! critical section to protect the inner data structures mutable CCriticalSection cs; + //! Serialization versions. + enum Format : uint8_t { + V0_HISTORICAL = 0, //!< historic format, before commit e6b343d88 + V1_DETERMINISTIC = 1, //!< for pre-asmap files + V2_ASMAP = 2, //!< for files including asmap version + V3_BIP155 = 3, //!< same as V2_ASMAP plus addresses are in BIP155 format + }; + + //! The maximum format this software knows it can unserialize. Also, we always serialize + //! in this format. + //! The format (first byte in the serialized stream) can be higher than this and + //! still this software may be able to unserialize the file - if the second byte + //! (see `lowest_compatible` in `Unserialize()`) is less or equal to this. + static constexpr Format FILE_FORMAT = Format::V3_BIP155; + + //! The initial value of a field that is incremented every time an incompatible format + //! change is made (such that old software versions would not be able to parse and + //! understand the new file format). This is 32 because we overtook the "key size" + //! field which was 32 historically. + //! @note Don't increment this. Increment `lowest_compatible` in `Serialize()` instead. + static constexpr uint8_t INCOMPATIBILITY_BASE = 32; + //! last used nId - int nIdCount; + int nIdCount GUARDED_BY(cs){0}; //! table with information about all nIds std::map mapInfo; @@ -280,12 +309,16 @@ protected: #endif //! Select several addresses at once. - void GetAddr_(std::vector &vAddr); + void GetAddr_(std::vector &vAddr, bool wants_addrv2); //! Mark an entry as currently-connected-to. void Connected_(const CService &addr, int64_t nTime); + //! Mark an entry as local + void SetLocal_(const CService &addr); + public: + void GetAllPeers(std::map &info); // Compressed IP->ASN mapping, loaded from a file when a node starts. // Should be always empty if no file was provided. // This mapping is then used for bucketing nodes in Addrman. @@ -336,13 +369,22 @@ public: * very little in common. */ template - void Serialize(Stream &s) const + void Serialize(Stream &s_) const + EXCLUSIVE_LOCKS_REQUIRED(!cs) { LOCK(cs); - unsigned char nVersion = 2; - s << nVersion; - s << ((unsigned char)32); + // Always serialize in the latest version (FILE_FORMAT). + + OverrideStream s(&s_, s_.GetType(), s_.GetVersion() | ADDRV2_FORMAT); + + s << static_cast(FILE_FORMAT); + + // Increment `lowest_compatible` iff a newly introduced format is incompatible with + // the previous one. + static constexpr uint8_t lowest_compatible = Format::V3_BIP155; + s << static_cast(INCOMPATIBILITY_BASE + lowest_compatible); + s << nKey; s << nNew; s << nTried; @@ -393,22 +435,40 @@ public: } template - void Unserialize(Stream& s) + void Unserialize(Stream& s_) EXCLUSIVE_LOCKS_REQUIRED(!cs) { LOCK(cs); - Clear(); - unsigned char nVersion; - s >> nVersion; - unsigned char nKeySize; - s >> nKeySize; - if (nKeySize != 32) throw std::ios_base::failure("Incorrect keysize in addrman deserialization"); + std::vector().swap(vRandom); + + Format format; + s_ >> Using>(format); + + int stream_version = s_.GetVersion(); + if (format >= Format::V3_BIP155) { + // Add ADDRV2_FORMAT to the version so that the CNetAddr and CAddress + // unserialize methods know that an address in addrv2 format is coming. + stream_version |= ADDRV2_FORMAT; + } + + OverrideStream s(&s_, s_.GetType(), stream_version); + + uint8_t compat; + s >> compat; + const uint8_t lowest_compatible = compat - INCOMPATIBILITY_BASE; + if (lowest_compatible > FILE_FORMAT) { + throw std::ios_base::failure(strprintf( + "Unsupported format of addrman database: %u. It is compatible with formats >=%u, " + "but the maximum supported by this version of %s is %u.", + format, lowest_compatible, PACKAGE_NAME, static_cast(FILE_FORMAT))); + } + s >> nKey; s >> nNew; s >> nTried; int nUBuckets = 0; s >> nUBuckets; - if (nVersion != 0) { + if (format >= Format::V1_DETERMINISTIC) { nUBuckets ^= (1 << 30); } @@ -422,7 +482,7 @@ public: // Deserialize entries from the new table. for (int n = 0; n < nNew; n++) { - CAddrInfo &info = mapInfo[n]; + CAddrInfo& info = mapInfo[n]; s >> info; mapAddr[info] = n; info.nRandomPos = vRandom.size(); @@ -437,7 +497,7 @@ public: s >> info; int nKBucket = info.GetTriedBucket(nKey, m_asmap); int nKBucketPos = info.GetBucketPosition(nKey, false, nKBucket); - if (vvTried[nKBucket][nKBucketPos] == -1) { + if (info.IsValid() && vvTried[nKBucket][nKBucketPos] == -1) { info.nRandomPos = vRandom.size(); info.fInTried = true; vRandom.push_back(nIdCount); @@ -452,60 +512,84 @@ public: nTried -= nLost; // Store positions in the new table buckets to apply later (if possible). - std::map entryToBucket; // Represents which entry belonged to which bucket when serializing + // An entry may appear in up to ADDRMAN_NEW_BUCKETS_PER_ADDRESS buckets, + // so we store all bucket-entry_index pairs to iterate through later. + std::vector> bucket_entries; - for (int bucket = 0; bucket < nUBuckets; bucket++) { - int nSize = 0; - s >> nSize; - for (int n = 0; n < nSize; n++) { - int nIndex = 0; - s >> nIndex; - if (nIndex >= 0 && nIndex < nNew) { - entryToBucket[nIndex] = bucket; + for (int bucket = 0; bucket < nUBuckets; ++bucket) { + int num_entries{0}; + s >> num_entries; + for (int n = 0; n < num_entries; ++n) { + int entry_index{0}; + s >> entry_index; + if (entry_index >= 0 && entry_index < nNew) { + bucket_entries.emplace_back(bucket, entry_index); } } } - uint256 supplied_asmap_version; + // If the bucket count and asmap checksum haven't changed, then attempt + // to restore the entries to the buckets/positions they were in before + // serialization. + uint256 supplied_asmap_checksum; if (m_asmap.size() != 0) { - supplied_asmap_version = SerializeHash(m_asmap); + supplied_asmap_checksum = SerializeHash(m_asmap); } - uint256 serialized_asmap_version; - if (nVersion > 1) { - s >> serialized_asmap_version; + uint256 serialized_asmap_checksum; + if (format >= Format::V2_ASMAP) { + s >> serialized_asmap_checksum; + } + const bool restore_bucketing{nUBuckets == ADDRMAN_NEW_BUCKET_COUNT && + serialized_asmap_checksum == supplied_asmap_checksum}; + + if (!restore_bucketing) { + LogPrint("addrman", "Bucketing method was updated, re-bucketing addrman entries from disk\n"); } - for (int n = 0; n < nNew; n++) { - CAddrInfo &info = mapInfo[n]; - int bucket = entryToBucket[n]; - int nUBucketPos = info.GetBucketPosition(nKey, true, bucket); - if (nVersion == 2 && nUBuckets == ADDRMAN_NEW_BUCKET_COUNT && vvNew[bucket][nUBucketPos] == -1 && - info.nRefCount < ADDRMAN_NEW_BUCKETS_PER_ADDRESS && serialized_asmap_version == supplied_asmap_version) { - // Bucketing has not changed, using existing bucket positions for the new table - vvNew[bucket][nUBucketPos] = n; - info.nRefCount++; - } else { - // In case the new table data cannot be used (nVersion unknown, bucket count wrong or new asmap), - // try to give them a reference based on their primary source address. - LogPrint("addrman", "Bucketing method was updated, re-bucketing addrman entries from disk\n"); - bucket = info.GetNewBucket(nKey, m_asmap); - nUBucketPos = info.GetBucketPosition(nKey, true, bucket); - if (vvNew[bucket][nUBucketPos] == -1) { - vvNew[bucket][nUBucketPos] = n; - info.nRefCount++; + for (auto bucket_entry : bucket_entries) { + int bucket{bucket_entry.first}; + const int entry_index{bucket_entry.second}; + // CAddrInfo& info = mapInfo[entry_index]; + + const auto it{mapInfo.find(entry_index)}; + if (it != mapInfo.end()) { + CAddrInfo& info = (*it).second; + + // Don't store the entry in the new bucket if it's not a valid address for our addrman + if (!info.IsValid()) continue; + + // The entry shouldn't appear in more than + // ADDRMAN_NEW_BUCKETS_PER_ADDRESS. If it has already, just skip + // this bucket_entry. + if (info.nRefCount >= ADDRMAN_NEW_BUCKETS_PER_ADDRESS) continue; + + int bucket_position = info.GetBucketPosition(nKey, true, bucket); + if (restore_bucketing && vvNew[bucket][bucket_position] == -1) { + // Bucketing has not changed, using existing bucket positions for the new table + vvNew[bucket][bucket_position] = entry_index; + ++info.nRefCount; + } else { + // In case the new table data cannot be used (bucket count wrong or new asmap), + // try to give them a reference based on their primary source address. + bucket = info.GetNewBucket(nKey, m_asmap); + bucket_position = info.GetBucketPosition(nKey, true, bucket); + if (vvNew[bucket][bucket_position] == -1) { + vvNew[bucket][bucket_position] = entry_index; + ++info.nRefCount; + } } } } // Prune new entries with refcount 0 (as a result of collisions). int nLostUnk = 0; - for (std::map::const_iterator it = mapInfo.begin(); it != mapInfo.end(); ) { + for (auto it = mapInfo.cbegin(); it != mapInfo.cend(); ) { if (it->second.fInTried == false && it->second.nRefCount == 0) { - std::map::const_iterator itCopy = it++; + const auto itCopy = it++; Delete(itCopy->first); - nLostUnk++; + ++nLostUnk; } else { - it++; + ++it; } } if (nLost + nLostUnk > 0) { @@ -531,7 +615,6 @@ public: } } - nIdCount = 0; nTried = 0; nNew = 0; mapInfo.clear(); @@ -657,13 +740,13 @@ public: } //! Return a bunch of addresses, selected at random. - std::vector GetAddr() + std::vector GetAddr(bool wants_addrv2 = false) { Check(); std::vector vAddr; { LOCK(cs); - GetAddr_(vAddr); + GetAddr_(vAddr, wants_addrv2); } Check(); return vAddr; @@ -680,6 +763,17 @@ public: } } + //! Mark an entry as currently-connected-to. + void SetLocal(const CService &addr) + { + { + LOCK(cs); + Check(); + SetLocal_(addr); + Check(); + } + } + }; #endif // HUSH_ADDRMAN_H diff --git a/src/alert.cpp b/src/alert.cpp deleted file mode 100644 index 9560a0c87..000000000 --- a/src/alert.cpp +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright (c) 2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers -// Copyright (c) 2016-2022 The Hush developers -// Distributed under the GPLv3 software license, see the accompanying -// file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html -/****************************************************************************** - * Copyright © 2014-2019 The SuperNET Developers. * - * * - * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * - * the top-level directory of this distribution for the individual copyright * - * holder information and the developer policies on copyright and licensing. * - * * - * Unless otherwise agreed in a custom licensing agreement, no part of the * - * SuperNET software, including this file may be copied, modified, propagated * - * or distributed except according to the terms contained in the LICENSE file * - * * - * Removal or modification of this copyright notice is prohibited. * - * * - ******************************************************************************/ -#include "alert.h" -#include "clientversion.h" -#include "net.h" -#include "pubkey.h" -#include "timedata.h" -#include "ui_interface.h" -#include "util.h" -#include -#include -#include -#include -#include -#include -#include - -using namespace std; - -map mapAlerts; -CCriticalSection cs_mapAlerts; - -void CUnsignedAlert::SetNull() -{ - nVersion = 1; - nRelayUntil = 0; - nExpiration = 0; - nID = 0; - nCancel = 0; - setCancel.clear(); - nMinVer = 0; - nMaxVer = 0; - setSubVer.clear(); - nPriority = 0; - - strComment.clear(); - strStatusBar.clear(); - strRPCError.clear(); -} - -std::string CUnsignedAlert::ToString() const -{ - std::string strSetCancel; - BOOST_FOREACH(int n, setCancel) - strSetCancel += strprintf("%d ", n); - std::string strSetSubVer; - BOOST_FOREACH(const std::string& str, setSubVer) - strSetSubVer += "\"" + str + "\" "; - return strprintf( - "CAlert(\n" - " nVersion = %d\n" - " nRelayUntil = %d\n" - " nExpiration = %d\n" - " nID = %d\n" - " nCancel = %d\n" - " setCancel = %s\n" - " nMinVer = %d\n" - " nMaxVer = %d\n" - " setSubVer = %s\n" - " nPriority = %d\n" - " strComment = \"%s\"\n" - " strStatusBar = \"%s\"\n" - " strRPCError = \"%s\"\n" - ")\n", - nVersion, - nRelayUntil, - nExpiration, - nID, - nCancel, - strSetCancel, - nMinVer, - nMaxVer, - strSetSubVer, - nPriority, - strComment, - strStatusBar, - strRPCError); -} - -void CAlert::SetNull() -{ - CUnsignedAlert::SetNull(); - vchMsg.clear(); - vchSig.clear(); -} - -bool CAlert::IsNull() const -{ - return (nExpiration == 0); -} - -uint256 CAlert::GetHash() const -{ - return Hash(this->vchMsg.begin(), this->vchMsg.end()); -} - -bool CAlert::IsInEffect() const -{ - return false; -} - -bool CAlert::Cancels(const CAlert& alert) const -{ - if (!IsInEffect()) - return false; // this was a no-op before 31403 - return (alert.nID <= nCancel || setCancel.count(alert.nID)); -} - -bool CAlert::AppliesTo(int nVersion, const std::string& strSubVerIn) const -{ - // TODO: rework for client-version-embedded-in-strSubVer ? - return (IsInEffect() && - nMinVer <= nVersion && nVersion <= nMaxVer && - (setSubVer.empty() || setSubVer.count(strSubVerIn))); -} - -bool CAlert::AppliesToMe() const -{ - return false; -} - -bool CAlert::RelayTo(CNode* pnode) const -{ - return false; -} - -bool CAlert::CheckSignature(const std::vector& alertKey) const -{ - return false; -} - -CAlert CAlert::getAlertByHash(const uint256 &hash) -{ - CAlert retval; - return retval; -} - -bool CAlert::ProcessAlert(const std::vector& alertKey, bool fThread) -{ - return true; -} - -void CAlert::Notify(const std::string& strMessage, bool fThread) -{ - return; -} diff --git a/src/alert.h b/src/alert.h deleted file mode 100644 index f461c51c5..000000000 --- a/src/alert.h +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) 2010 Satoshi Nakamoto -// Copyright (c) 2009-2013 The Bitcoin Core developers -// Copyright (c) 2016-2022 The Hush developers -// Distributed under the GPLv3 software license, see the accompanying -// file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html - -/****************************************************************************** - * Copyright © 2014-2019 The SuperNET Developers. * - * * - * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * - * the top-level directory of this distribution for the individual copyright * - * holder information and the developer policies on copyright and licensing. * - * * - * Unless otherwise agreed in a custom licensing agreement, no part of the * - * SuperNET software, including this file may be copied, modified, propagated * - * or distributed except according to the terms contained in the LICENSE file * - * * - * Removal or modification of this copyright notice is prohibited. * - * * - ******************************************************************************/ - -#ifndef HUSH_ALERT_H -#define HUSH_ALERT_H - -#include "serialize.h" -#include "sync.h" -#include -#include -#include -#include - -class CAlert; -class CNode; -class uint256; - -extern std::map mapAlerts; -extern CCriticalSection cs_mapAlerts; - -/** Alerts are for notifying old versions if they become too obsolete and - * need to upgrade. The message is displayed in the status bar. - * Alert messages are broadcast as a vector of signed data. Unserializing may - * not read the entire buffer if the alert is for a newer version, but older - * versions can still relay the original data. - */ -class CUnsignedAlert -{ -public: - int nVersion; - int64_t nRelayUntil; // when newer nodes stop relaying to newer nodes - int64_t nExpiration; - int nID; - int nCancel; - std::set setCancel; - int nMinVer; // lowest version inclusive - int nMaxVer; // highest version inclusive - std::set setSubVer; // empty matches all - int nPriority; - - // Actions - std::string strComment; - std::string strStatusBar; - std::string strRPCError; - - ADD_SERIALIZE_METHODS; - - template - inline void SerializationOp(Stream& s, Operation ser_action) { - READWRITE(this->nVersion); - READWRITE(nRelayUntil); - READWRITE(nExpiration); - READWRITE(nID); - READWRITE(nCancel); - READWRITE(setCancel); - READWRITE(nMinVer); - READWRITE(nMaxVer); - READWRITE(setSubVer); - READWRITE(nPriority); - - READWRITE(LIMITED_STRING(strComment, 65536)); - READWRITE(LIMITED_STRING(strStatusBar, 256)); - READWRITE(LIMITED_STRING(strRPCError, 256)); - } - - void SetNull(); - - std::string ToString() const; -}; - -/** An alert is a combination of a serialized CUnsignedAlert and a signature. */ -class CAlert : public CUnsignedAlert -{ -public: - std::vector vchMsg; - std::vector vchSig; - - CAlert() - { - SetNull(); - } - - ADD_SERIALIZE_METHODS; - - template - inline void SerializationOp(Stream& s, Operation ser_action) { - READWRITE(vchMsg); - READWRITE(vchSig); - } - - void SetNull(); - bool IsNull() const; - uint256 GetHash() const; - bool IsInEffect() const; - bool Cancels(const CAlert& alert) const; - bool AppliesTo(int nVersion, const std::string& strSubVerIn) const; - bool AppliesToMe() const; - bool RelayTo(CNode* pnode) const; - bool CheckSignature(const std::vector& alertKey) const; - bool ProcessAlert(const std::vector& alertKey, bool fThread = true); // fThread means run -alertnotify in a free-running thread - static void Notify(const std::string& strMessage, bool fThread); - - /* - * Get copy of (active) alert object by hash. Returns a null alert if it is not found. - */ - static CAlert getAlertByHash(const uint256 &hash); -}; - -#endif // HUSH_ALERT_H diff --git a/src/alertkeys.h b/src/alertkeys.h deleted file mode 100644 index 0de5d269e..000000000 --- a/src/alertkeys.h +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) 2016-2022 The Hush developers -// Distributed under the GPLv3 software license, see the accompanying -// file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html -/****************************************************************************** - * Copyright © 2014-2019 The SuperNET Developers. * - * * - * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * - * the top-level directory of this distribution for the individual copyright * - * holder information and the developer policies on copyright and licensing. * - * * - * Unless otherwise agreed in a custom licensing agreement, no part of the * - * SuperNET software, including this file may be copied, modified, propagated * - * or distributed except according to the terms contained in the LICENSE file * - * * - * Removal or modification of this copyright notice is prohibited. * - * * - ******************************************************************************/ - -#ifndef HUSH_ALERTKEYS_H -#define HUSH_ALERTKEYS_H - -// REMINDER: DO NOT COMMIT YOUR PRIVATE KEYS TO THE GIT REPOSITORY, lulz - -const char* pszPrivKey = "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; -const char* pszTestNetPrivKey = "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; - -#endif - diff --git a/src/amount.cpp b/src/amount.cpp index 0e2d7ae33..4f183465d 100644 --- a/src/amount.cpp +++ b/src/amount.cpp @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin Core developers -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/amount.h b/src/amount.h index 88ba196f0..62be095e7 100644 --- a/src/amount.h +++ b/src/amount.h @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin Core developers -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/src/arith_uint256.cpp b/src/arith_uint256.cpp index da2dcd58b..02489a3e8 100644 --- a/src/arith_uint256.cpp +++ b/src/arith_uint256.cpp @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin developers -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** @@ -19,7 +19,7 @@ ******************************************************************************/ #include "arith_uint256.h" #include "uint256.h" -#include "utilstrencodings.h" +#include "util/strencodings.h" #include "crypto/common.h" #include #include diff --git a/src/arith_uint256.h b/src/arith_uint256.h index 9b462cb04..2335aae0e 100644 --- a/src/arith_uint256.h +++ b/src/arith_uint256.h @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin developers -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/src/assetchains_stop b/src/assetchains_stop index e20e4f89a..f2df4a303 100755 --- a/src/assetchains_stop +++ b/src/assetchains_stop @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers set -eo pipefail hush_cli='./hush-cli' diff --git a/src/asyncrpcoperation.cpp b/src/asyncrpcoperation.cpp index c0c274901..61079234f 100644 --- a/src/asyncrpcoperation.cpp +++ b/src/asyncrpcoperation.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2016 The Zcash developers -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/asyncrpcoperation.h b/src/asyncrpcoperation.h index 2bcf75d63..1feea67df 100644 --- a/src/asyncrpcoperation.h +++ b/src/asyncrpcoperation.h @@ -1,5 +1,5 @@ // Copyright (c) 2016 The Zcash developers -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/src/asyncrpcqueue.cpp b/src/asyncrpcqueue.cpp index c7556a4b9..49205cbec 100644 --- a/src/asyncrpcqueue.cpp +++ b/src/asyncrpcqueue.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Copyright (c) 2016 The Zcash developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/src/asyncrpcqueue.h b/src/asyncrpcqueue.h index 6369f2134..a6a7dc033 100644 --- a/src/asyncrpcqueue.h +++ b/src/asyncrpcqueue.h @@ -1,5 +1,5 @@ // Copyright (c) 2016 The Zcash developers -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/src/attributes.h b/src/attributes.h new file mode 100644 index 000000000..c5472bc81 --- /dev/null +++ b/src/attributes.h @@ -0,0 +1,20 @@ +// Copyright (c) 2009-2010 Satoshi Nakamoto +// Copyright (c) 2009-2020 The Bitcoin Core developers +// Copyright (c) 2016-2023 The Hush developers +// Distributed under the GPLv3 software license, see the accompanying +// file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html + +#ifndef HUSH_ATTRIBUTES_H +#define HUSH_ATTRIBUTES_H + +#if defined(__clang__) +# if __has_attribute(lifetimebound) +# define LIFETIMEBOUND [[clang::lifetimebound]] +# else +# define LIFETIMEBOUND +# endif +#else +# define LIFETIMEBOUND +#endif + +#endif // HUSH_ATTRIBUTES_H diff --git a/src/base58.cpp b/src/base58.cpp index deb64ddcc..bb6c75c22 100644 --- a/src/base58.cpp +++ b/src/base58.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Copyright (c) 2014 The Bitcoin Core developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/src/base58.h b/src/base58.h index 423107c15..9cc3db69a 100644 --- a/src/base58.h +++ b/src/base58.h @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin Core developers -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/src/bech32.cpp b/src/bech32.cpp index fa0562d0a..0930d0c87 100644 --- a/src/bech32.cpp +++ b/src/bech32.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2017 Pieter Wuille -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/src/bech32.h b/src/bech32.h index a0fec7558..b9470b12e 100644 --- a/src/bech32.h +++ b/src/bech32.h @@ -1,5 +1,5 @@ // Copyright (c) 2017 Pieter Wuille -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index d6ac78c25..fd66b36c9 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2013 The Bitcoin Core developers -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** @@ -22,7 +22,7 @@ #include "rpc/client.h" #include "rpc/protocol.h" #include "util.h" -#include "utilstrencodings.h" +#include "util/strencodings.h" #include #include #include diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index 4de9f9e61..c791d4ef7 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2013 The Bitcoin Core developers -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/bloom.cpp b/src/bloom.cpp index 81410adda..44c6f7f51 100644 --- a/src/bloom.cpp +++ b/src/bloom.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Copyright (c) 2012-2014 The Bitcoin Core developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/src/bloom.h b/src/bloom.h index d2eabaa8f..0abbe8e86 100644 --- a/src/bloom.h +++ b/src/bloom.h @@ -1,5 +1,5 @@ // Copyright (c) 2012-2014 The Bitcoin Core developers -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/src/cJSON.h b/src/cJSON.h index e4a31634b..0fc0bb206 100644 --- a/src/cJSON.h +++ b/src/cJSON.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers /* Copyright (c) 2009-2017 Dave Gamble and cJSON contributors diff --git a/src/cc/CCGateways.h b/src/cc/CCGateways.h index ca4adbee0..63d46ce8b 100644 --- a/src/cc/CCGateways.h +++ b/src/cc/CCGateways.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/CCHeir.h b/src/cc/CCHeir.h index 762b37b9c..2701251b3 100644 --- a/src/cc/CCHeir.h +++ b/src/cc/CCHeir.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/CCImportGateway.h b/src/cc/CCImportGateway.h index 27aade681..ec75faec1 100644 --- a/src/cc/CCImportGateway.h +++ b/src/cc/CCImportGateway.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/CCMarmara.h b/src/cc/CCMarmara.h index 67e21cc8c..58b8072b6 100644 --- a/src/cc/CCMarmara.h +++ b/src/cc/CCMarmara.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/CCOracles.h b/src/cc/CCOracles.h index 9f519706f..9ab6082a4 100644 --- a/src/cc/CCOracles.h +++ b/src/cc/CCOracles.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/CCPayments.h b/src/cc/CCPayments.h index f6c556ad3..246a980d1 100644 --- a/src/cc/CCPayments.h +++ b/src/cc/CCPayments.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/CCPegs.h b/src/cc/CCPegs.h index 309a4646e..197af430f 100644 --- a/src/cc/CCPegs.h +++ b/src/cc/CCPegs.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/CCPrices.h b/src/cc/CCPrices.h index a1238d134..592a63136 100644 --- a/src/cc/CCPrices.h +++ b/src/cc/CCPrices.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/CC_made_easy.md b/src/cc/CC_made_easy.md index cd5f62577..146b7389c 100644 --- a/src/cc/CC_made_easy.md +++ b/src/cc/CC_made_easy.md @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers /****************************************************************************** * Copyright © 2014-2019 The SuperNET Developers. * * * diff --git a/src/cc/CCassets.h b/src/cc/CCassets.h index d2fbfb051..c0b64f131 100644 --- a/src/cc/CCassets.h +++ b/src/cc/CCassets.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/CCassetsCore.cpp b/src/cc/CCassetsCore.cpp index 963ff4dd0..ea716b2b3 100644 --- a/src/cc/CCassetsCore.cpp +++ b/src/cc/CCassetsCore.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/CCassetstx.cpp b/src/cc/CCassetstx.cpp index 36eb1050d..a0c893937 100644 --- a/src/cc/CCassetstx.cpp +++ b/src/cc/CCassetstx.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/CCauction.h b/src/cc/CCauction.h index dc7994810..becbb86ff 100644 --- a/src/cc/CCauction.h +++ b/src/cc/CCauction.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/CCchannels.h b/src/cc/CCchannels.h index 39271616e..e1fca87e8 100644 --- a/src/cc/CCchannels.h +++ b/src/cc/CCchannels.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/CCcustom.cpp b/src/cc/CCcustom.cpp index 4df015f5b..b463df52b 100644 --- a/src/cc/CCcustom.cpp +++ b/src/cc/CCcustom.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/CCdice.h b/src/cc/CCdice.h index 3082d8495..b1401ad2a 100644 --- a/src/cc/CCdice.h +++ b/src/cc/CCdice.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/CCfaucet.h b/src/cc/CCfaucet.h index 7e59c1342..4e3c40c1d 100644 --- a/src/cc/CCfaucet.h +++ b/src/cc/CCfaucet.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/CCfsm.h b/src/cc/CCfsm.h index f88ccbf0c..8c6f487f2 100644 --- a/src/cc/CCfsm.h +++ b/src/cc/CCfsm.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/CCinclude.h b/src/cc/CCinclude.h index 3ab89bd2e..3af9e0711 100644 --- a/src/cc/CCinclude.h +++ b/src/cc/CCinclude.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/CClotto.h b/src/cc/CClotto.h index 5c05fa42c..ad9c7131a 100644 --- a/src/cc/CClotto.h +++ b/src/cc/CClotto.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/CCrewards.h b/src/cc/CCrewards.h index 090712ba6..e78e20cdd 100644 --- a/src/cc/CCrewards.h +++ b/src/cc/CCrewards.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/CCtokens.cpp b/src/cc/CCtokens.cpp index ed95a528e..236b4c3ed 100644 --- a/src/cc/CCtokens.cpp +++ b/src/cc/CCtokens.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/CCtokens.h b/src/cc/CCtokens.h index 211de2794..6111165c6 100644 --- a/src/cc/CCtokens.h +++ b/src/cc/CCtokens.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/CCtokenutils.cpp b/src/cc/CCtokenutils.cpp index 201acaeea..03a1d29a3 100644 --- a/src/cc/CCtokenutils.cpp +++ b/src/cc/CCtokenutils.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/CCtx.cpp b/src/cc/CCtx.cpp index c4b683933..bc358dcbe 100644 --- a/src/cc/CCtx.cpp +++ b/src/cc/CCtx.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/CCutilbits.cpp b/src/cc/CCutilbits.cpp index c74f26784..e1db0a1f9 100644 --- a/src/cc/CCutilbits.cpp +++ b/src/cc/CCutilbits.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/CCutils.cpp b/src/cc/CCutils.cpp index 0fc5f212b..d4a8aa6d8 100644 --- a/src/cc/CCutils.cpp +++ b/src/cc/CCutils.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/Makefile b/src/cc/Makefile index 3e988f279..24b94226a 100644 --- a/src/cc/Makefile +++ b/src/cc/Makefile @@ -2,9 +2,10 @@ SHELL = /bin/sh CC = gcc CC_DARWIN = g++-6 CC_WIN = x86_64-w64-mingw32-gcc-posix -CFLAGS_DARWIN = -std=c++11 -arch x86_64 -I/usr/local/Cellar/gcc\@6/6.4.0_2/include/c++/6.4.0/ -I../../depends/$(shell echo `../..//depends/config.guess`/include) -I../univalue/include -I../cryptoconditions/include -I../cryptoconditions/src -I../cryptoconditions/src/asn -I.. -I. -fPIC -c -Wl,-undefined -Wl,dynamic_lookup -dynamiclib -CFLAGS = -std=c++11 -I../../depends/$(shell echo `../..//depends/config.guess`/include) -I../univalue/include -I../cryptoconditions/include -I../cryptoconditions/src -I../cryptoconditions/src/asn -I.. -I. -fPIC -shared -c -CFLAGS_WIN = -std=c++11 -I../../depends/$(shell echo `../..//depends/config.guess`/include) -I../univalue/include -I../cryptoconditions/include -I../cryptoconditions/src -I../cryptoconditions/src/asn -I.. -I. -fPIC -shared -c +CFLAGS = -arch x86_64 +CXXFLAGS_DARWIN = -std=c++11 -arch x86_64 -I/usr/local/Cellar/gcc\@6/6.4.0_2/include/c++/6.4.0/ -I../../depends/$(shell echo `../..//depends/config.guess`/include) -I../univalue/include -I../cryptoconditions/include -I../cryptoconditions/src -I../cryptoconditions/src/asn -I.. -I. -fPIC -c -Wl,-undefined -Wl,dynamic_lookup -dynamiclib +CXXFLAGS = -std=c++11 -I../../depends/$(shell echo `../..//depends/config.guess`/include) -I../univalue/include -I../cryptoconditions/include -I../cryptoconditions/src -I../cryptoconditions/src/asn -I.. -I. -fPIC -shared -c +CXXFLAGS_WIN = -std=c++11 -I../../depends/$(shell echo `../..//depends/config.guess`/include) -I../univalue/include -I../cryptoconditions/include -I../cryptoconditions/src -I../cryptoconditions/src/asn -I.. -I. -fPIC -shared -c DEBUGFLAGS = -O0 -D _DEBUG RELEASEFLAGS = -O2 -D NDEBUG -combine -fwhole-program $(info $(OS)) @@ -13,21 +14,27 @@ $(info $(OS)) TARGET = ../libcc.so TARGET_DARWIN = ../libcc.dylib TARGET_WIN = ../libcc.dll -SOURCES = cclib.cpp -#HEADERS = $(shell echo ../cryptoconditions/include/*.h) +SOURCES = cclib.cpp ../cJSON.c +OBJS = cclib.o ../cJSON.o all: $(TARGET) -$(TARGET): $(SOURCES) +%.o: %.c + $(CC) -o $@ $< $(CFLAGS) $(DEBUGFLAGS) + +%.o: %.cpp + $(CC) -o $@ $< $(CXXFLAGS) $(DEBUGFLAGS) + +$(TARGET): $(OBJS) $(info Building cclib to src/) ifeq ($(OS),Darwin) - $(CC_DARWIN) $(CFLAGS_DARWIN) $(DEBUGFLAGS) -o $(TARGET_DARWIN) $(SOURCES) + $(CC_DARWIN) $(CXXFLAGS_DARWIN) $(DEBUGFLAGS) -o $(TARGET_DARWIN) $(OBJS) else ifeq ($(OS),Linux) - $(CC) $(CFLAGS) $(DEBUGFLAGS) -o $(TARGET) $(SOURCES) + $(CC) $(CXXFLAGS) $(DEBUGFLAGS) -o $(TARGET) $(OBJS) #else ifeq ($(WIN_HOST),True) - todo: pass ENV var from build.sh if WIN host else $(info WINDOWS) - $(CC_WIN) $(CFLAGS_WIN) $(DEBUGFLAGS) -o $(TARGET_WIN) $(SOURCES) + $(CC_WIN) $(CXXFLAGS_WIN) $(DEBUGFLAGS) -o $(TARGET_WIN) $(OBJS) endif clean: diff --git a/src/cc/assets.cpp b/src/cc/assets.cpp index b4fdecc92..ebc977dc0 100644 --- a/src/cc/assets.cpp +++ b/src/cc/assets.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/auction.cpp b/src/cc/auction.cpp index bdfd11f4c..ad4ac8f56 100644 --- a/src/cc/auction.cpp +++ b/src/cc/auction.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/betprotocol.cpp b/src/cc/betprotocol.cpp index d6a3cb5a8..fc6b98dc3 100644 --- a/src/cc/betprotocol.cpp +++ b/src/cc/betprotocol.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/betprotocol.h b/src/cc/betprotocol.h index 5bfe78ef8..b8c4cf49e 100644 --- a/src/cc/betprotocol.h +++ b/src/cc/betprotocol.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/cclib.cpp b/src/cc/cclib.cpp index 6046c2235..9f902a140 100644 --- a/src/cc/cclib.cpp +++ b/src/cc/cclib.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/channels.cpp b/src/cc/channels.cpp index aeb13a311..498047196 100644 --- a/src/cc/channels.cpp +++ b/src/cc/channels.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/crypto777/OS_portable.h b/src/cc/crypto777/OS_portable.h index 52f92a383..c4a7ecb0b 100644 --- a/src/cc/crypto777/OS_portable.h +++ b/src/cc/crypto777/OS_portable.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers /****************************************************************************** * Copyright © 2014-2019 The SuperNET Developers. * * * diff --git a/src/cc/customcc.cpp b/src/cc/customcc.cpp index cc4f335f0..ee27bc5be 100644 --- a/src/cc/customcc.cpp +++ b/src/cc/customcc.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cc/customcc.h b/src/cc/customcc.h index 9d5b18911..5741dd4a1 100644 --- a/src/cc/customcc.h +++ b/src/cc/customcc.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cc/dapps/Makefile b/src/cc/dapps/Makefile index 22b543614..fa8b11b19 100644 --- a/src/cc/dapps/Makefile +++ b/src/cc/dapps/Makefile @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2022 The Hush Developers +# Copyright (c) 2016-2023 The Hush Developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html # Just type make to compile all dat dapp code, fellow cypherpunkz diff --git a/src/cc/dapps/cJSON.c b/src/cc/dapps/cJSON.c index 2901f4968..3101e440d 100644 --- a/src/cc/dapps/cJSON.c +++ b/src/cc/dapps/cJSON.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cc/dapps/dappinc.h b/src/cc/dapps/dappinc.h index 29639ba83..50ad1ec98 100644 --- a/src/cc/dapps/dappinc.h +++ b/src/cc/dapps/dappinc.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/dapps/dappstd.c b/src/cc/dapps/dappstd.c index 73ca6773c..52ea11f33 100644 --- a/src/cc/dapps/dappstd.c +++ b/src/cc/dapps/dappstd.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/dapps/hushdex.c b/src/cc/dapps/hushdex.c index 202265de4..890ec52c4 100644 --- a/src/cc/dapps/hushdex.c +++ b/src/cc/dapps/hushdex.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/dapps/zmigrate.c b/src/cc/dapps/zmigrate.c index 115dc02b0..d8bbe675e 100644 --- a/src/cc/dapps/zmigrate.c +++ b/src/cc/dapps/zmigrate.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/dice.cpp b/src/cc/dice.cpp index 222da953a..6b0d06075 100644 --- a/src/cc/dice.cpp +++ b/src/cc/dice.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/dilithium.c b/src/cc/dilithium.c index 733f3716b..7b531002d 100644 --- a/src/cc/dilithium.c +++ b/src/cc/dilithium.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/src/cc/dilithium.h b/src/cc/dilithium.h index 5023a6a51..91d0a0753 100644 --- a/src/cc/dilithium.h +++ b/src/cc/dilithium.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html #include diff --git a/src/cc/disputepayout.cpp b/src/cc/disputepayout.cpp index 23017a664..d6bc92c8a 100644 --- a/src/cc/disputepayout.cpp +++ b/src/cc/disputepayout.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/eval.cpp b/src/cc/eval.cpp index d3d62a4ac..e490781b2 100644 --- a/src/cc/eval.cpp +++ b/src/cc/eval.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/eval.h b/src/cc/eval.h index 1c4fb2616..c403967d3 100644 --- a/src/cc/eval.h +++ b/src/cc/eval.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/faucet.cpp b/src/cc/faucet.cpp index d46920a50..8142fc472 100644 --- a/src/cc/faucet.cpp +++ b/src/cc/faucet.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/fsm.cpp b/src/cc/fsm.cpp index 2deeb1a62..d2998a388 100644 --- a/src/cc/fsm.cpp +++ b/src/cc/fsm.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/games/prices.c b/src/cc/games/prices.c index ad264f008..69e3fae95 100644 --- a/src/cc/games/prices.c +++ b/src/cc/games/prices.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/src/cc/games/prices.cpp b/src/cc/games/prices.cpp index 85d84b730..a7eac9659 100644 --- a/src/cc/games/prices.cpp +++ b/src/cc/games/prices.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/games/prices.h b/src/cc/games/prices.h index 0d4e32e49..1debb9445 100644 --- a/src/cc/games/prices.h +++ b/src/cc/games/prices.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/src/cc/games/tetris.c b/src/cc/games/tetris.c index 882e8b4cf..d7de6f278 100644 --- a/src/cc/games/tetris.c +++ b/src/cc/games/tetris.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/src/cc/games/tetris.cpp b/src/cc/games/tetris.cpp index fc1830686..b0ffaff56 100644 --- a/src/cc/games/tetris.cpp +++ b/src/cc/games/tetris.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers /****************************************************************************** * Copyright © 2014-2019 The SuperNET Developers. * diff --git a/src/cc/games/tetris.h b/src/cc/games/tetris.h index 0a9b2e3d2..be899ed34 100644 --- a/src/cc/games/tetris.h +++ b/src/cc/games/tetris.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/src/cc/gamescc.cpp b/src/cc/gamescc.cpp index 02719d985..ad1364c11 100644 --- a/src/cc/gamescc.cpp +++ b/src/cc/gamescc.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/gamescc.h b/src/cc/gamescc.h index 04ac92861..4ac8885cc 100644 --- a/src/cc/gamescc.h +++ b/src/cc/gamescc.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html #ifndef H_GAMESCC_H diff --git a/src/cc/gateways.cpp b/src/cc/gateways.cpp index 90f0e81b8..5d51c3767 100644 --- a/src/cc/gateways.cpp +++ b/src/cc/gateways.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/heir.cpp b/src/cc/heir.cpp index 78a767bac..8f94e6bcb 100644 --- a/src/cc/heir.cpp +++ b/src/cc/heir.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/heir_validate.h b/src/cc/heir_validate.h index b2fbec20a..b5c5e0c62 100644 --- a/src/cc/heir_validate.h +++ b/src/cc/heir_validate.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html #ifndef HEIR_VALIDATE_H diff --git a/src/cc/import.cpp b/src/cc/import.cpp index 4b0b86060..bb88e8831 100644 --- a/src/cc/import.cpp +++ b/src/cc/import.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/importgateway.cpp b/src/cc/importgateway.cpp index 95d2b5acc..ea4ea4318 100644 --- a/src/cc/importgateway.cpp +++ b/src/cc/importgateway.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/importpayout.cpp b/src/cc/importpayout.cpp index b4da2d352..6bc8fc97c 100644 --- a/src/cc/importpayout.cpp +++ b/src/cc/importpayout.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/includes/cJSON.h b/src/cc/includes/cJSON.h index 4db0fc3cb..ee0f0591a 100644 --- a/src/cc/includes/cJSON.h +++ b/src/cc/includes/cJSON.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cc/includes/curve25519.h b/src/cc/includes/curve25519.h index b8ccac1a1..d54ad652d 100644 --- a/src/cc/includes/curve25519.h +++ b/src/cc/includes/curve25519.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/includes/libgfshare.h b/src/cc/includes/libgfshare.h index 9dd21a35c..9bd5d2a0a 100644 --- a/src/cc/includes/libgfshare.h +++ b/src/cc/includes/libgfshare.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cc/includes/tweetnacl.h b/src/cc/includes/tweetnacl.h index 188cdf525..d9ce00d1d 100644 --- a/src/cc/includes/tweetnacl.h +++ b/src/cc/includes/tweetnacl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html #ifndef TWEETNACL_H diff --git a/src/cc/includes/uthash.h b/src/cc/includes/uthash.h index edcfdfcf8..7fd889033 100644 --- a/src/cc/includes/uthash.h +++ b/src/cc/includes/uthash.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/src/cc/includes/utlist.h b/src/cc/includes/utlist.h index c9481f3a2..a300e9a6e 100644 --- a/src/cc/includes/utlist.h +++ b/src/cc/includes/utlist.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cc/lotto.cpp b/src/cc/lotto.cpp index 187270fa3..c7621178a 100644 --- a/src/cc/lotto.cpp +++ b/src/cc/lotto.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/makecclib b/src/cc/makecclib index dc389ecaf..8bd2427fb 100755 --- a/src/cc/makecclib +++ b/src/cc/makecclib @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/src/cc/makerogue b/src/cc/makerogue index 2bbcbb0cb..99b4f889f 100755 --- a/src/cc/makerogue +++ b/src/cc/makerogue @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2016-2022 The Hush developers +# Copyright 2016-2023 The Hush developers cd rogue; make clean; diff --git a/src/cc/musig.cpp b/src/cc/musig.cpp index ef90df7ba..1c050c112 100644 --- a/src/cc/musig.cpp +++ b/src/cc/musig.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/oracles.cpp b/src/cc/oracles.cpp index 179ad7414..e1307810b 100644 --- a/src/cc/oracles.cpp +++ b/src/cc/oracles.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/payments.cpp b/src/cc/payments.cpp index 886e9a2d9..d212cc387 100644 --- a/src/cc/payments.cpp +++ b/src/cc/payments.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/pegs.cpp b/src/cc/pegs.cpp index 056c9b44a..a9aa9e9ab 100644 --- a/src/cc/pegs.cpp +++ b/src/cc/pegs.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/prices.cpp b/src/cc/prices.cpp index 4eb1c65f3..3c9bb2556 100644 --- a/src/cc/prices.cpp +++ b/src/cc/prices.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/rewards.cpp b/src/cc/rewards.cpp index e48076700..3dd6f07ec 100644 --- a/src/cc/rewards.cpp +++ b/src/cc/rewards.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/rogue/Makefile.in b/src/cc/rogue/Makefile.in index fa089d0ce..d8aa7f5e6 100644 --- a/src/cc/rogue/Makefile.in +++ b/src/cc/rogue/Makefile.in @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # Distributed under the GPLv3 software license, see the accompanying # file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html ############################################################################### diff --git a/src/cc/rogue/armor.c b/src/cc/rogue/armor.c index 2c74b3a90..9a90aebde 100644 --- a/src/cc/rogue/armor.c +++ b/src/cc/rogue/armor.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cc/rogue/chase.c b/src/cc/rogue/chase.c index 188e36b39..d5964936b 100644 --- a/src/cc/rogue/chase.c +++ b/src/cc/rogue/chase.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cc/rogue/command.c b/src/cc/rogue/command.c index 678c13066..e5c5adce9 100644 --- a/src/cc/rogue/command.c +++ b/src/cc/rogue/command.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cc/rogue/cursesd.c b/src/cc/rogue/cursesd.c index 40a9c4d5a..b744e4015 100644 --- a/src/cc/rogue/cursesd.c +++ b/src/cc/rogue/cursesd.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/rogue/cursesd.h b/src/cc/rogue/cursesd.h index 589a99361..47615b752 100644 --- a/src/cc/rogue/cursesd.h +++ b/src/cc/rogue/cursesd.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/rogue/daemon.c b/src/cc/rogue/daemon.c index 2a4734960..fbed7c2c0 100644 --- a/src/cc/rogue/daemon.c +++ b/src/cc/rogue/daemon.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cc/rogue/daemons.c b/src/cc/rogue/daemons.c index 11bf96f82..c5fa67397 100644 --- a/src/cc/rogue/daemons.c +++ b/src/cc/rogue/daemons.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cc/rogue/extern.c b/src/cc/rogue/extern.c index c12a61295..506768506 100644 --- a/src/cc/rogue/extern.c +++ b/src/cc/rogue/extern.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cc/rogue/extern.h b/src/cc/rogue/extern.h index ed749986b..8148e5543 100644 --- a/src/cc/rogue/extern.h +++ b/src/cc/rogue/extern.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cc/rogue/fight.c b/src/cc/rogue/fight.c index 24f477621..304c48288 100644 --- a/src/cc/rogue/fight.c +++ b/src/cc/rogue/fight.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cc/rogue/init.c b/src/cc/rogue/init.c index 4755c8e60..18d5c3f7f 100644 --- a/src/cc/rogue/init.c +++ b/src/cc/rogue/init.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cc/rogue/io.c b/src/cc/rogue/io.c index 0996b3e29..1f6d737b6 100644 --- a/src/cc/rogue/io.c +++ b/src/cc/rogue/io.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cc/rogue/list.c b/src/cc/rogue/list.c index c0e97ca41..4fa1f9da8 100644 --- a/src/cc/rogue/list.c +++ b/src/cc/rogue/list.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cc/rogue/mach_dep.c b/src/cc/rogue/mach_dep.c index 5d9bf07ee..36daf97ab 100644 --- a/src/cc/rogue/mach_dep.c +++ b/src/cc/rogue/mach_dep.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cc/rogue/main.c b/src/cc/rogue/main.c index 01324ec3f..4186812f3 100644 --- a/src/cc/rogue/main.c +++ b/src/cc/rogue/main.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/rogue/mdport.c b/src/cc/rogue/mdport.c index caeb57946..ffb46e714 100644 --- a/src/cc/rogue/mdport.c +++ b/src/cc/rogue/mdport.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cc/rogue/misc.c b/src/cc/rogue/misc.c index 5da9ce0aa..b2aaffc9a 100644 --- a/src/cc/rogue/misc.c +++ b/src/cc/rogue/misc.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cc/rogue/monsters.c b/src/cc/rogue/monsters.c index 6485082e4..ee309c291 100644 --- a/src/cc/rogue/monsters.c +++ b/src/cc/rogue/monsters.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cc/rogue/move.c b/src/cc/rogue/move.c index d4107150c..4e20e54b4 100644 --- a/src/cc/rogue/move.c +++ b/src/cc/rogue/move.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cc/rogue/new_level.c b/src/cc/rogue/new_level.c index def062547..3acc57622 100644 --- a/src/cc/rogue/new_level.c +++ b/src/cc/rogue/new_level.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cc/rogue/options.c b/src/cc/rogue/options.c index 5cf0150b5..a90edc149 100644 --- a/src/cc/rogue/options.c +++ b/src/cc/rogue/options.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cc/rogue/pack.c b/src/cc/rogue/pack.c index 0ad0e7420..63c135f7a 100644 --- a/src/cc/rogue/pack.c +++ b/src/cc/rogue/pack.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cc/rogue/passages.c b/src/cc/rogue/passages.c index e9aea4611..4bba3f2d7 100644 --- a/src/cc/rogue/passages.c +++ b/src/cc/rogue/passages.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cc/rogue/potions.c b/src/cc/rogue/potions.c index 4d952ada6..ac78594c1 100644 --- a/src/cc/rogue/potions.c +++ b/src/cc/rogue/potions.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cc/rogue/rings.c b/src/cc/rogue/rings.c index cb1b9f5b3..7398fd776 100644 --- a/src/cc/rogue/rings.c +++ b/src/cc/rogue/rings.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cc/rogue/rip.c b/src/cc/rogue/rip.c index 43a2a42ae..730a0c61f 100644 --- a/src/cc/rogue/rip.c +++ b/src/cc/rogue/rip.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cc/rogue/rogue.c b/src/cc/rogue/rogue.c index 54ad07f1b..858a2deb9 100644 --- a/src/cc/rogue/rogue.c +++ b/src/cc/rogue/rogue.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cc/rogue/rogue.h b/src/cc/rogue/rogue.h index 1b3e4a070..522da8421 100644 --- a/src/cc/rogue/rogue.h +++ b/src/cc/rogue/rogue.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cc/rogue/rogue_player.h b/src/cc/rogue/rogue_player.h index 474198b6c..82003237c 100644 --- a/src/cc/rogue/rogue_player.h +++ b/src/cc/rogue/rogue_player.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cc/rogue/rooms.c b/src/cc/rogue/rooms.c index a5521f516..b5109f466 100644 --- a/src/cc/rogue/rooms.c +++ b/src/cc/rogue/rooms.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cc/rogue/save.c b/src/cc/rogue/save.c index 3d09bb0c4..cd11d9d54 100644 --- a/src/cc/rogue/save.c +++ b/src/cc/rogue/save.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cc/rogue/score.h b/src/cc/rogue/score.h index c97b27cf3..8b3aa9cd1 100644 --- a/src/cc/rogue/score.h +++ b/src/cc/rogue/score.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cc/rogue/scrolls.c b/src/cc/rogue/scrolls.c index 6153aad5d..a06d4bb1e 100644 --- a/src/cc/rogue/scrolls.c +++ b/src/cc/rogue/scrolls.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cc/rogue/state.c b/src/cc/rogue/state.c index 08a6d469f..c2753145f 100644 --- a/src/cc/rogue/state.c +++ b/src/cc/rogue/state.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cc/rogue/sticks.c b/src/cc/rogue/sticks.c index 416adc423..254f0c404 100644 --- a/src/cc/rogue/sticks.c +++ b/src/cc/rogue/sticks.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cc/rogue/things.c b/src/cc/rogue/things.c index 3ef9e889e..166eb32d2 100644 --- a/src/cc/rogue/things.c +++ b/src/cc/rogue/things.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cc/rogue/vers.c b/src/cc/rogue/vers.c index 7973d231b..bcaf9bb8a 100644 --- a/src/cc/rogue/vers.c +++ b/src/cc/rogue/vers.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cc/rogue/weapons.c b/src/cc/rogue/weapons.c index a2c36a406..530a4302f 100644 --- a/src/cc/rogue/weapons.c +++ b/src/cc/rogue/weapons.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cc/rogue/wizard.c b/src/cc/rogue/wizard.c index ee28bb1d5..a1721ec73 100644 --- a/src/cc/rogue/wizard.c +++ b/src/cc/rogue/wizard.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cc/rogue/xcrypt.c b/src/cc/rogue/xcrypt.c index c5d9f1bad..6effe3b57 100644 --- a/src/cc/rogue/xcrypt.c +++ b/src/cc/rogue/xcrypt.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cc/rogue_rpc.cpp b/src/cc/rogue_rpc.cpp index 22b154b0d..88d18b620 100644 --- a/src/cc/rogue_rpc.cpp +++ b/src/cc/rogue_rpc.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/src/cc/sudoku.cpp b/src/cc/sudoku.cpp index d887cd6c4..5d410eb1d 100644 --- a/src/cc/sudoku.cpp +++ b/src/cc/sudoku.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html // From https://github.com/attractivechaos/plb/blob/master/sudoku/incoming/sudoku_solver.c diff --git a/src/cc/utils.h b/src/cc/utils.h index 5d2bc2cba..52acd17e3 100644 --- a/src/cc/utils.h +++ b/src/cc/utils.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/chain.cpp b/src/chain.cpp index e04bc1736..1e87b22e1 100644 --- a/src/chain.cpp +++ b/src/chain.cpp @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin Core developers -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/chain.h b/src/chain.h index 2e49e64c4..eb94559bd 100644 --- a/src/chain.h +++ b/src/chain.h @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin Core developers -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 6f44af2da..6eb1368ff 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -1,6 +1,6 @@ // Copyright (c) 2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin Core developers -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html ///////////////////////////////////////////////////////////////////////////////// @@ -24,7 +24,7 @@ #include "main.h" #include "crypto/equihash.h" #include "util.h" -#include "utilstrencodings.h" +#include "util/strencodings.h" #include #include #include "chainparamsseeds.h" @@ -142,7 +142,6 @@ public: pchMessageStart[1] = 0xee; pchMessageStart[2] = 0xe4; pchMessageStart[3] = 0x8d; - vAlertPubKey = ParseHex("038a1bd41a08f38edda51042988022933c5775dfce81f7bae0b32a9179650352ac"); nDefaultPort = 5420; nMinerThreads = 0; nMaxTipAge = 24 * 60 * 60; @@ -206,7 +205,7 @@ public: bech32HRPs[SAPLING_INCOMING_VIEWING_KEY] = "zivks"; bech32HRPs[SAPLING_EXTENDED_SPEND_KEY] = "secret-extended-key-main"; - vFixedSeeds = std::vector(pnSeed6_main, pnSeed6_main + ARRAYLEN(pnSeed6_main)); + vFixedSeeds = std::vector(std::begin(chainparams_seed_main), std::end(chainparams_seed_main)); fMiningRequiresPeers = true; fDefaultConsistencyChecks = false; @@ -280,7 +279,6 @@ public: pchMessageStart[1] = 0x1F; pchMessageStart[2] = 0x7E; pchMessageStart[3] = 0x62; - vAlertPubKey = ParseHex("038a1bd41a08f38edda51042988022933c5775dfce81f7bae0b32a9179650352ac"); nMaxTipAge = 24 * 60 * 60; nPruneAfterHeight = 1000; @@ -315,7 +313,7 @@ public: bech32HRPs[SAPLING_INCOMING_VIEWING_KEY] = "zivktestsapling"; bech32HRPs[SAPLING_EXTENDED_SPEND_KEY] = "secret-extended-key-test"; - vFixedSeeds = std::vector(pnSeed6_test, pnSeed6_test + ARRAYLEN(pnSeed6_test)); + vFixedSeeds = std::vector(std::begin(chainparams_seed_test), std::end(chainparams_seed_test)); //fRequireRPCPassword = true; fMiningRequiresPeers = false;//true; @@ -1383,9 +1381,175 @@ void *chainparams_commandline() { (1085000, uint256S("0x00000003e9ed1a3e3593e19554280c5aa789e2182a42243e9f7bb63bd08ef4d7")) (1086000, uint256S("0x000000069c32b803dca7ce354f422735c4b1995c43266de5bf288399e0f70324")) (1087000, uint256S("0x000000027a91bb3d167380a39dc55ad2f8df57d95d08936407b2b1f257b91df6")) - ,(int64_t) 1663567436, // time of last checkpointed block - (int64_t) 1788273, // total txs - (double) 3139 // txs in the last day before block 1087529 + + // Generated at 1675984534 via hush3 util/checkpoints.pl by Duke Leto + (1088000, uint256S("0x00000002c42e2c0fc2dd7110304fb3d67daafaf0ebeab611a55b7d4dd18d8650")) + (1089000, uint256S("0x000000018e43dece08da3175dc77095b766a26915d12cf74f1af9442740449e0")) + (1090000, uint256S("0x000000020838fa90a1cda91c014d907d39c39c66e411d170ca4828efb3af4c79")) + (1091000, uint256S("0x00000004bffbb9be4d9f1a61c0021775f854ab1f590ca306c404787c035a4807")) + (1092000, uint256S("0x000000006383674d4e847e03a294ac6a63fef8cffe97029f07c92d26b8ec56fe")) + (1093000, uint256S("0x000000010e765f2f7664ca856435cd14ccc07535665ad1bf717df2bcd5f6f2ad")) + (1094000, uint256S("0x0000000407986aa26a0d1e7e955000e1fd55df0d8d80334b1fbb2d69669b6836")) + (1095000, uint256S("0x000000020d09d8e345132fd62d01adc063cadef4722c3273a1825e1b8bf0d9ab")) + (1096000, uint256S("0x000000000b3c0853a862f6ab950e90b9c8d4e31c6e64dbaf35566208ab75a9df")) + (1097000, uint256S("0x000000006fd4db1bb4dc48ed382f388bba054025e94b4b677cb88c9604ccd0a7")) + (1098000, uint256S("0x00000000eaacf730729706231ecaab40268d7cc5899b38a88577fcb1529f165e")) + (1099000, uint256S("0x00000000cbc9a34bd3006fc58f532afe06879c37baf1203a97399d647d08df49")) + (1100000, uint256S("0x000000055746ed129f6e080e1ad7cf1c3b7991f61d9deb88009070eb466046b7")) + (1101000, uint256S("0x0000000292feaaf9d63cde979314cba3d3da073a2ba0787987bb2d1c152fc046")) + (1102000, uint256S("0x000000058252f88934fc156c1a5e640cfa3527c59b4b5642a912b616fcf1895c")) + (1103000, uint256S("0x000000001052f5e5504227a2ecca6fe8bd537aeacd7e37f42763a0e45fe2441f")) + (1104000, uint256S("0x000000011040c25528d28cf58af8cb64cebcd655187f03740bb252a3f8122492")) + (1105000, uint256S("0x00000005717505e51912bfded85c605ecbb5d7993dc62ed8d8b4f642a37785ae")) + (1106000, uint256S("0x00000004af60a5433510940f3f513e280cc735f9c6634f6c21f09af06e47e79b")) + (1107000, uint256S("0x00000008accf0c9ae0e366dddf9a20b243cafdf63168b73347e85eaaad34c70a")) + (1108000, uint256S("0x00000002590edf9273758c843fc2ebca3a4c25c926d9756186478b67c2636f3d")) + (1109000, uint256S("0x00000006fac3ea21aca8de55fff64cdb44654fb1bbaaa7122d15bed0ba369064")) + (1110000, uint256S("0x00000000fdab3549e08f9ca12857c83f42c4f010b2fda2dba66ede48a5dc7e57")) + (1111000, uint256S("0x0000000495bb04fb535d76dd6e76986f3d8dced4d1e7f09ba06e6ab7aa740d03")) + (1112000, uint256S("0x000000055e62518723147d9b2113b00e77d4ba9773864b44bd2ed960b97416a9")) + (1113000, uint256S("0x000000071bec6afe075e0ca4c2d02a0b699f71387babb0271d7dc62fc642970d")) + (1114000, uint256S("0x000000056148323bc501945ed0433c286a523f84432159322b45ba344d6cb38f")) + (1115000, uint256S("0x0000000638c218c77a322ae0c8a259299ef0b0a6eefcf4a7501afdb40689383e")) + (1116000, uint256S("0x00000002dfd21b8fc5f15597a29639cc94a76444a1fbb3b09ca6bcc81f01f513")) + (1117000, uint256S("0x0000000482187d47d169b46b796f50e3c33742f47a33edbd4afb08f13cb849ba")) + (1118000, uint256S("0x0000000163118a8e695b808e67c34f4a5d30f25b3492a443d5e62d85913ca04c")) + (1119000, uint256S("0x0000000543b33b3e83f2b96e8dda83dc2a2606fd74ae803dacb65f66baa0d595")) + (1120000, uint256S("0x00000006b40bb5d87feefa917c203eaa024285f894a7784e7c28822f10dfad14")) + (1121000, uint256S("0x000000039fba003a7e63c9fe0588fb80dbc23ca34d0032fc9e38ccab15a699d0")) + (1122000, uint256S("0x000000007b8cc5ed0c44c78f3d19b5a8a5de2e8c2fbb6538d56637e414a1a424")) + (1123000, uint256S("0x000000076281d748a0242e05f7d33125ef686d031d52f94634e015224cdd60c5")) + (1124000, uint256S("0x00000007917a10e30dc6ade1e98cf7a6bed78ec6de429ac4913f7c02acff1f41")) + (1125000, uint256S("0x000000026d94bab5f164519547f7c1d25664fd26a23ec96a18e50de6cb02f39b")) + (1126000, uint256S("0x00000002a44f24af5feed7d1fb4cede90fd05ef404428b7ce7f3bd7b3202a1ce")) + (1127000, uint256S("0x000000008c43bb7a1fb542d890f2e4892a5e5ef6e1365dbe8806d2a55ae8d387")) + (1128000, uint256S("0x00000006c072b5f08c55a280ef7d5d21c5f9230a8f68f613225cf74db010a444")) + (1129000, uint256S("0x00000001c9c85f1c02439e82f724137db939c9e8c77af8e70173d0e40a0b3af3")) + (1130000, uint256S("0x000000076f4faeb53342aac9204affdbacb1709885a4a245e64740343d665326")) + (1131000, uint256S("0x00000004397ee6c65cd0eedf8807fe40f826506a18bda1d75bc3232ea6d18c99")) + (1132000, uint256S("0x00000001e451ea9ba1baed5944beb0533f30b019d530309dcc64910b1b1b8452")) + (1133000, uint256S("0x00000005fcd34538acfa636f031fd3f508c20e07e9052b664597c8185af0d3e0")) + (1134000, uint256S("0x00000001f2ffa9616240a9674f5fec0ac0564daf1483424d674b3b5c8524edf1")) + (1135000, uint256S("0x00000006aecdd129c22bb8f2d86b6dd23db163d9452850d875cab607d0d1988b")) + (1136000, uint256S("0x000000043cb8bdc396e2769e7a88860d9d20d7a59f271789a44d3056b59bc024")) + (1137000, uint256S("0x000000052666465ba541e16a2ccb766901dac6b45af67820865f550e3c4117d0")) + (1138000, uint256S("0x000000053cd2a374a3aa42b238fcd5f47f5c0b50e119c29669ddfb27cfa747e2")) + (1139000, uint256S("0x00000005e6bab6dcd63c7bf8cb2d27e103d860e2dba5e82b22352fd09fbcbe9a")) + (1140000, uint256S("0x00000008265a1b52f46556220ef184bd924a47ca13dea30a2e01ae91c614d521")) + (1141000, uint256S("0x00000002b799b12a272ffecd74b19d9ce4d4fe184e414f133c9db5c086a20ad5")) + (1142000, uint256S("0x00000004fbe0bf705da37792af72bdcd65c982e78ca15bb16fede76b2c3094d7")) + (1143000, uint256S("0x00000003be8cce9f701ace74151817f71e3731125892832465238d3c972d290c")) + (1144000, uint256S("0x000000068a415ca795b3b717590b21c25ac680ba308c3b2b08b81c299b56e31d")) + (1145000, uint256S("0x0000000317e5a350e0dae1027c20645e4d3c36c339c5c780ef2c0186856efc5d")) + (1146000, uint256S("0x00000006edf1d01d525d34475d4f11442eb8a2c59ddc4c10a7d5a1c972b1e7dc")) + (1147000, uint256S("0x000000020f16fac207427d6ec232f2ef554778a090c32155f43f90420381845d")) + (1148000, uint256S("0x00000003fe28c78fdd1231b327a40da2b32fa41ac5c5e343309034ee5785ba1d")) + (1149000, uint256S("0x000000007abcb62c8e83df22359876a8cff94674ecb3947b0922d3eef751ec02")) + (1150000, uint256S("0x0000000650e627bd7da6868f14070aff8fdbd31ef7125fe77851976ed3adfc54")) + (1151000, uint256S("0x00000002854a57a378bfbd335ba3e9f3f220c48d1604b70b233667466e6de130")) + (1152000, uint256S("0x000000013d9f22b3557a3eae21cb9739451a168fde0714649d98a8ff1ed36937")) + (1153000, uint256S("0x00000005fea3b98885ef8284dbc2ccae53330fbd940d0011acdf6588a49feb59")) + (1154000, uint256S("0x00000003429e13ad0a0cd0cea72c4422b9d9c87b0ebefb0d9f74648b60569edd")) + (1155000, uint256S("0x00000006dfe8d708ceefa5c6f28c4eef8e2cececf81211b305ee8d9d1e4b2a30")) + (1156000, uint256S("0x0000000960bf07a13ea2b0808c8c8f9631ffbf870769660a3517e342bae23d2f")) + (1157000, uint256S("0x00000003baa90aad3b9a28ba28d95b2d93c3a1fd5ee59649f9343f0b800df45a")) + (1158000, uint256S("0x000000038e4dc332187256627973277ad744870d265ca2f96fb81a13898a69c0")) + (1159000, uint256S("0x00000004e5ae2a139e17de72bac6b012c738f975f7d37feccf62232b2541c4c9")) + (1160000, uint256S("0x000000006904fea1620eb53ad7f912197881e3d47a8a6683d943efc0ff43c94e")) + (1161000, uint256S("0x00000004589195775511a5ea92411eb37c4cf8bc7b6d4d2388c666200e6770b7")) + (1162000, uint256S("0x0000000231fe740494f062669c13accc1c3cba62214b2ed7c93ed74259573675")) + (1163000, uint256S("0x000000054519199a161a43a9e690576059b823e481c0e0fc2baeafb6ab2ec642")) + (1164000, uint256S("0x000000027897fe94751d463964461257f89835b968009a5498719ae2141c71f6")) + (1165000, uint256S("0x00000001fde2686f240e6670fa722e0a346caa3dc510c9c832314af7648a2ee2")) + (1166000, uint256S("0x000000059b344a03db6dfa9dd6bb8f006155d943c3ed2e21009a175337a7aefa")) + (1167000, uint256S("0x0000000400e9418a5e5877ccd79f236a6139a5277a8104c027d85db8ec088105")) + (1168000, uint256S("0x00000002e8b3dacca4dc0833e4a9e2cbbf78dab53e9f0ae143f4d315fddc88ce")) + (1169000, uint256S("0x0000000330f37afdf21d9085991ee921e8ae3fafe4494d9e054b408fb56f1bc5")) + (1170000, uint256S("0x00000002adc92872d2031c7f142d7c3cb85ffa90b3a656d2b2061e997e7b8770")) + (1171000, uint256S("0x00000006e837c8a29d752739000167ab1b1ffec2cb5822c129b2c28acce00b5e")) + (1172000, uint256S("0x00000002baeedc6492367e25459f1facb2e478adab3369264bad86bd36eefcec")) + (1173000, uint256S("0x00000000aaf69980bc72f37fa87cb8b6e67083df5ee00e767fbcda90e958a05d")) + (1174000, uint256S("0x000000073883ae59028049bd849d1d588f16c9d750337d7a2d0e593f42087b89")) + (1175000, uint256S("0x00000000c5f7849a2a38329061d4a802e5682bf20ea21d4cff4c0eb2c77b27a1")) + (1176000, uint256S("0x00000007a67a59afe4f0132f2daa79246ee2a8574a8b216c41912836dd0bdc43")) + (1177000, uint256S("0x00000003caf28467a541bdeef8d87e5cd1006fbfdb35a2480715601c207d6a96")) + (1178000, uint256S("0x000000021b2de9ab84878ac507ae626bbf5f41981ae8b5dd53809e62bb927093")) + (1179000, uint256S("0x00000009677998fba7c3a952475730666da5392a79defa896bc9ede5a44131c8")) + (1180000, uint256S("0x00000007747404722bfbab50f0a42b8c950c636d332263f2dc189f72b8832df4")) + (1181000, uint256S("0x0000000617bb091494d3158fc2ef014ce11ec3920f16a0ea291f288980e453e0")) + (1182000, uint256S("0x000000085cdf357b7eac144b765a63e9a76b9b26501c45ad1ba76e96061d23d2")) + (1183000, uint256S("0x00000005179a1b05631ba9d46ce57da700397797d808d489600345f1f8be1e94")) + (1184000, uint256S("0x0000000895ad9c2d9b2903e1ce8d7dc83b5f68ea7c70c34bc309d2b381f7eb79")) + (1185000, uint256S("0x000000070d264220351e1d1bd5a9d8c7d1a4585c04856f749262b55ef40abffa")) + (1186000, uint256S("0x0000000497315ad1286045d458e8b5208feb0b4ef78c8d895739f551a2024245")) + (1187000, uint256S("0x00000003676ae259e1b343c7df5dedf3e76ba96c9fcff7c29d002382a66cb2ed")) + (1188000, uint256S("0x000000041b554feb0d831fc2818ab68d259d18940db3dab317d8b76281d04f76")) + (1189000, uint256S("0x00000001c08e6d57ae32dcd130495bbf477aa2e0ba239ae3794c2e667dfeaf25")) + (1190000, uint256S("0x000000012c06d63527fc546d26d426fc0a1ca861d7261b87b899b52603bd6476")) + (1191000, uint256S("0x00000000237e77b25ca87430b0956d3071dceefa4087b15434e8aaf995446af9")) + (1192000, uint256S("0x00000004622f8f297bf642428f6c856e669096b2e5f670e0fb98bcf7ff760699")) + (1193000, uint256S("0x000000031331f9962f234f8542aad5e2f8e8f6f4d5d1a7d7f7111fe6b8ff3388")) + (1194000, uint256S("0x0000000315942d3677f377108cb90ab78a4def34ee3638c0293a3694c08247ed")) + (1195000, uint256S("0x00000005588624111c5659969c4603dae7a321093e117d1b86e1ce36dfa59043")) + (1196000, uint256S("0x0000000171b3dffc7a999a53522e6d705cad236340fe4c8a70e4f06cf408a0a5")) + (1197000, uint256S("0x0000000107dd22f5c96d4e4c347766d9fcf9b7a03ab65177bb185a84a7f23e4b")) + (1198000, uint256S("0x000000031ebcfb2ab9672ef855251fbca96fa274dfde94e64a4f909f8cd3d43c")) + (1199000, uint256S("0x000000038b953b235acd6f5a6140649993f380042339c59633158f09a673a061")) + (1200000, uint256S("0x00000008b51ed341723143be685bfa5dc7d0623a7892958fab0e91f1a0b067bd")) + (1201000, uint256S("0x00000005448c7a0aeda8d975ab2cad101185aa0021ca56f348cc814d76e494de")) + (1202000, uint256S("0x000000034d9fd12360fc9b61c2b7d3d258e433903980831eff5a139fcb5e7969")) + (1203000, uint256S("0x0000000801ec6bd4a84ce37e6bf35133f26899014f9044fd5eca5eccac5188d1")) + (1204000, uint256S("0x00000005e48ca83c0b50881d31bbc07708b03119b2f176aa5cb447140637fee3")) + (1205000, uint256S("0x00000001392769fbe9d1b549347188e7c6900db2bd704f045e6ca489beae018e")) + (1206000, uint256S("0x000000051c5c0c5a0066567571e032870629ae69e363249edb89e4d56eb311c0")) + (1207000, uint256S("0x00000004203c479698293d96ed36c0716ae6493391ae6adc2e5236100f83ae40")) + (1208000, uint256S("0x00000001972ec2ee647e9b6b8dc3b713bedff826cba12765e579fcdeb8be501b")) + (1209000, uint256S("0x00000001f35be87e27e07382c71695681ba8dad01182f42cefc8b6fdefdfcce6")) + (1210000, uint256S("0x000000001466676d37c27e82694b03318fda2e81a363d16ff8d7fbe8a76d8693")) + (1211000, uint256S("0x0000000637f96880dc302378cded2019cf008974fb9f46f974d2dd2d13f672a9")) + (1212000, uint256S("0x000000074528eab351d79f82b0e44a89ba2a2c0a4561e75c8cb2f63c4610bbcf")) + (1213000, uint256S("0x0000000471a897a0576d34aeb4c3e740bb2bbe3d16f2af04e6191ef5cc9c5747")) + (1214000, uint256S("0x000000029c375c216d74848a75a19b459921f8e2a5c86f953737634a878fec0e")) + (1215000, uint256S("0x000000074cae91dfcb9c7d888d2c03465aad5f3321fb769f68cb0806ce1c025c")) + (1216000, uint256S("0x00000008372aa1d849f8959c259943f5eb1d2f07331e62a0ae5a15e0a8243580")) + (1217000, uint256S("0x00000001b2f59097c6e15affbdc4c013088c5145cdbd86b09a6a64893d68624e")) + (1218000, uint256S("0x000000039bcbbf21170cdb2688439de3ca39f9cfe781408932917950b25ad649")) + (1219000, uint256S("0x00000004159e554fa29498c2abdf9c23fc2a7b703a905f252cda2a53b377c5ec")) + (1220000, uint256S("0x00000006e1c2ff124328e47c93b36f491d02ea6b3f73a5035d448123977afa3a")) + (1221000, uint256S("0x00000002e29d71fd9032a14be6e05538d091ca8be41bf9bbe7c648e562991f2b")) + (1222000, uint256S("0x00000002277603d2d735ef89e33497fe5ee60413f15cf45cf0c185c7f1c5d240")) + (1223000, uint256S("0x000000055c22a01b0f4fe99aaa72221d5e41f0f1bf9d4c8544fe616a3d138e1f")) + (1224000, uint256S("0x000000028afd93c37d53830dab4b1dcbf656ea99ea1bc5332e8941a2b9aed2b5")) + (1225000, uint256S("0x00000006477c2ff2b13af2d4fe8b386e184442daa5c8d9cb31293099ff9bdb31")) + (1226000, uint256S("0x000000021717f01436a9677af5ad8836e8eec203f657d82d0a368df92de315aa")) + (1227000, uint256S("0x000000069e3ad932d5e29a21b64fea1e54c0bcec291bab7c7f3d4d22f01553ad")) + (1228000, uint256S("0x00000005119c8d2e0886d513477364a93bea863344b8bf87415445426cb6778d")) + (1229000, uint256S("0x00000004427be49483384a8c7ffb5c06fac61dfdc0a75b0a03e3ca0ea41e513a")) + (1230000, uint256S("0x00000004ce24d10589f23cc53ac76df507dff75495431c279fb8ebb771791073")) + (1231000, uint256S("0x00000001efd76d368ee107b1647e3700afb5c173d0d637b4d749e904d06fdb35")) + (1232000, uint256S("0x0000000129a4b6e0ead541c57159a6ac051dc8aa7459b9eac592edeb851ad7b6")) + (1233000, uint256S("0x00000006b821eaf79d718e817d59186ff0d7d2dcfa0898891e93e275b3d63cb0")) + (1234000, uint256S("0x00000002efdd622c85230eb4d3978bd4396e58af45304ab1ac28ef5089cd19d4")) + (1235000, uint256S("0x000000060e07823a1529a26fd2a731247ee8985dd77bba511ed23e1d9d075001")) + (1236000, uint256S("0x00000001c86c1d13488565710495fcdd02f3d5f6b1b3fa75b8633e1a8d83a70e")) + (1237000, uint256S("0x000000049093e5f965deb09ecc0778be58181d79c1c25f309a2a7939b1e636c3")) + (1238000, uint256S("0x0000000326a511be9b410c430f9c1770c025c27dddceadf47ddedaf844d3ccb9")) + (1239000, uint256S("0x000000017e9a177c1a3a3f79dd703badebc790dd99a35fb2287a7f2b3b71547c")) + (1240000, uint256S("0x000000042929e3117f22829289d73ed8c33032ecd813e65da9d25ee48139c5de")) + (1241000, uint256S("0x00000001289c575a3697606ebfe35d0cfaaa1ed0c6e0f6c75a75b77889c08b0e")) + (1242000, uint256S("0x000000040c7bf04faf5873d8107962db45e56d33d37ce6dcd319826834111016")) + (1243000, uint256S("0x000000009fd238b0ce665f9d96204c2a3e5b1e36744385a88c58781ad8298726")) + (1244000, uint256S("0x00000001096334e88f76b6f5b073d8c72543745ba0a52612f525fb6c7f181fe3")) + (1245000, uint256S("0x00000000467dfb301c6db05c5d0725aa0133a473456160de8e132779bfad25e0")) + (1246000, uint256S("0x0000000222addd93922d679f8b9c60f0dc87db0172662c770ab9d68ee2774c93")) + (1247000, uint256S("0x0000000347b1078686786223140a6e4a3d1d13769ae095bb369469905b30d7ea")) + (1248000, uint256S("0x000000031d981183243697659fe453d2fc529845b64e72e55fc9f2b358a6e0a7")) + (1249000, uint256S("0x00000001170d6ae54d494bd2dbf29c5ab7f560f51874987d7dbe129d549c097f")) + (1250000, uint256S("0x000000033226eef40d094c8aa88d03bbc9146856c52248760e28c45426787352")) + (1251000, uint256S("0x0000000281c7f7ef75ac6539791e26b9744cccd59414b04ddc4697bcd3595209")) + ,(int64_t) 1675926362, // time of last checkpointed block + (int64_t) 2022392, // total txs + (double) 1371 // txs in the last day before block 1251770 }; // END HUSH mainnet checkpoint data diff --git a/src/chainparams.h b/src/chainparams.h index 9e2707b31..f2b2e589a 100644 --- a/src/chainparams.h +++ b/src/chainparams.h @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin Core developers -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html @@ -36,11 +36,6 @@ struct CDNSSeedData { CDNSSeedData(const std::string &strName, const std::string &strHost) : name(strName), host(strHost) {} }; -struct SeedSpec6 { - uint8_t addr[16]; - uint16_t port; -}; - typedef std::map MapCheckpoints; @@ -85,7 +80,6 @@ public: const Consensus::Params& GetConsensus() const { return consensus; } const CMessageHeader::MessageStartChars& MessageStart() const { return pchMessageStart; } - const std::vector& AlertKey() const { return vAlertPubKey; } int GetDefaultPort() const { return nDefaultPort; } const CBlock& GenesisBlock() const { return genesis; } @@ -109,7 +103,7 @@ public: const std::vector& DNSSeeds() const { return vSeeds; } const std::vector& Base58Prefix(Base58Type type) const { return base58Prefixes[type]; } const std::string& Bech32HRP(Bech32Type type) const { return bech32HRPs[type]; } - const std::vector& FixedSeeds() const { return vFixedSeeds; } + const std::vector& FixedSeeds() const { return vFixedSeeds; } const CCheckpointData& Checkpoints() const { return checkpointData; } /** Return the founder's reward address and script for a given block height */ std::string GetFoundersRewardAddressAtHeight(int height) const; @@ -134,8 +128,6 @@ public: protected: CChainParams() {} - //! Raw pub key bytes for the broadcast alert signing key. - std::vector vAlertPubKey; int nMinerThreads = 0; long nMaxTipAge = 0; int nDefaultPort = 0; @@ -149,7 +141,7 @@ protected: std::string strCurrencyUnits; uint32_t bip44CoinType; CBlock genesis; - std::vector vFixedSeeds; + std::vector vFixedSeeds; bool fMiningRequiresPeers = false; bool fDefaultConsistencyChecks = false; bool fRequireStandard = false; diff --git a/src/chainparamsbase.cpp b/src/chainparamsbase.cpp index 4244e7f53..f892589ed 100644 --- a/src/chainparamsbase.cpp +++ b/src/chainparamsbase.cpp @@ -1,6 +1,6 @@ // Copyright (c) 2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin Core developers -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/chainparamsbase.h b/src/chainparamsbase.h index f4fc66e92..18f10e36c 100644 --- a/src/chainparamsbase.h +++ b/src/chainparamsbase.h @@ -1,5 +1,5 @@ // Copyright (c) 2014 The Bitcoin Core developers -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/src/chainparamsseeds.h b/src/chainparamsseeds.h index 663a9bcac..1fd92af93 100644 --- a/src/chainparamsseeds.h +++ b/src/chainparamsseeds.h @@ -1,37 +1,32 @@ -// Copyright (c) 2016-2022 The Hush developers -/****************************************************************************** - * Copyright © 2014-2019 The SuperNET Developers. * - * * - * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * - * the top-level directory of this distribution for the individual copyright * - * holder information and the developer policies on copyright and licensing. * - * * - * Unless otherwise agreed in a custom licensing agreement, no part of the * - * SuperNET software, including this file may be copied, modified, propagated * - * or distributed except according to the terms contained in the LICENSE file * - * * - * Removal or modification of this copyright notice is prohibited. * - * * - ******************************************************************************/ - +// Copyright (c) 2016-2023 The Hush developers +// Distributed under the GPLv3 software license, see the accompanying +// file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html +// THIS FILE IS AUTOGENERATED, DO NOT MODIFY DIRECTLY +// Instead, update contrib/seeds/nodes_main.txt then run +// ./contrib/seeds/generate-seeds.py contrib/seeds > src/chainparamsseeds.h +// OR run: make seeds #ifndef HUSH_CHAINPARAMSSEEDS_H #define HUSH_CHAINPARAMSSEEDS_H -/** - * List of fixed seed nodes for the bitcoin network - * AUTOGENERATED by contrib/seeds/generate-seeds.py - * - * Each line contains a 16-byte IPv6 address and a port. - * IPv4 as well as onion addresses are wrapped inside a IPv6 address accordingly. - */ -static SeedSpec6 pnSeed6_main[] = { - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0x19,0x30,0xec}, 27485}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0x19,0x30,0xec}, 27487}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0x40,0x69,0x6f}, 27485}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0x40,0x69,0x6f}, 27487}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0x19,0x30,0x48}, 27485}, - {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0x19,0x30,0x48}, 27487} +// List of fixed seed nodes for the Hush network +// Each line contains a BIP155 serialized address. +// +static const uint8_t chainparams_seed_main[] = { + 0x01,0x04,0xb9,0xf1,0x3d,0x2b,0x00,0x00, // 185.241.61.43 + 0x01,0x04,0x57,0xfb,0x4c,0xa6,0x00,0x00, // 87.251.76.166 + 0x01,0x04,0x2d,0x52,0x44,0xe9,0x00,0x00, // 45.82.68.233 + 0x01,0x04,0x57,0xfb,0x4c,0x21,0x00,0x00, // 87.251.76.33 + 0x01,0x04,0x89,0x4a,0x04,0xc6,0x00,0x00, // 137.74.4.198 + 0x01,0x04,0x95,0x1c,0x66,0xdb,0x00,0x00, // 149.28.102.219 + 0x01,0x04,0x6b,0xae,0x46,0xfb,0x00,0x00, // 107.174.70.251 + 0x04,0x20,0xef,0xad,0x0c,0x95,0x3e,0x61,0xee,0x69,0x57,0x67,0xdb,0x4f,0xb7,0x8d,0xc2,0x35,0x1c,0x6b,0x96,0xf4,0x1f,0x7a,0xb4,0x06,0x09,0x3a,0x64,0x33,0xf4,0x0b,0x2c,0x94,0x00,0x00, // 56wqzfj6mhxgsv3h3nh3pdocguogxfxud55libqjhjsdh5alfsko2iqd.onion + 0x04,0x20,0x3d,0x24,0x7a,0xec,0xfe,0x60,0x6e,0x3d,0x3d,0xf3,0x4f,0x35,0x12,0x29,0xdb,0x48,0x89,0x71,0x19,0xb9,0xee,0x6a,0xfd,0xb2,0x02,0xa7,0x99,0x89,0xbb,0x69,0x39,0xdb,0x00,0x00, // hushv3h6mbxd2pptj42reko3jcexcgnz5zvp3mqcu6myto3jhhn4yzyd.onion + 0x04,0x20,0x3d,0x24,0x7a,0xee,0xf5,0x39,0x20,0x7e,0x69,0x92,0xda,0xc7,0xa6,0x9f,0xbd,0xeb,0x29,0x21,0x20,0x93,0x52,0x03,0xf3,0x60,0x41,0xfc,0xb8,0xf9,0x06,0x29,0x96,0x24,0x00,0x00, // hushv3xvheqh42ms3ld2nh555muscietkib7gycb7s4psbrjsysfywqd.onion + 0x02,0x10,0x2a,0x0c,0xb6,0x41,0x06,0xf1,0x00,0x34,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00, // 2a0c:b641:6f1:34::2 + 0x02,0x10,0x2a,0x0c,0xb6,0x41,0x06,0xf1,0x00,0x0c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00, // 2a0c:b641:6f1:c::2 + 0x05,0x20,0x42,0xd3,0x08,0x7d,0xad,0x65,0xb4,0x84,0xe8,0x99,0x5e,0xf7,0xc1,0x12,0x36,0xb3,0x0d,0x96,0x30,0x2c,0x70,0xb6,0xde,0x48,0x03,0x44,0xc7,0xab,0x9d,0x1b,0xbb,0x8f,0x00,0x00, // iljqq7nnmw2ij2ezl334cerwwmgzmmbmoc3n4saditd2xhi3xohq.b32.i2p }; -static SeedSpec6 pnSeed6_test[] = { +static const uint8_t chainparams_seed_test[] = { + 0x01,0x04,0x01,0x02,0x03,0x04,0x00,0x00, // 1.2.3.4 }; #endif // HUSH_CHAINPARAMSSEEDS_H diff --git a/src/checkpoints.cpp b/src/checkpoints.cpp index c9ac9b783..898c7adca 100644 --- a/src/checkpoints.cpp +++ b/src/checkpoints.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2009-2014 The Bitcoin Core developers -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/checkpoints.h b/src/checkpoints.h index 75462e1d1..441e8ceca 100644 --- a/src/checkpoints.h +++ b/src/checkpoints.h @@ -1,5 +1,5 @@ // Copyright (c) 2009-2014 The Bitcoin Core developers -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/checkqueue.h b/src/checkqueue.h index bea5ed1bb..cf26ded24 100644 --- a/src/checkqueue.h +++ b/src/checkqueue.h @@ -1,5 +1,5 @@ // Copyright (c) 2012-2014 The Bitcoin Core developers -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/src/clientversion.cpp b/src/clientversion.cpp index 49af10dda..b377fb1b0 100644 --- a/src/clientversion.cpp +++ b/src/clientversion.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2012-2014 The Bitcoin Core developers -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/clientversion.h b/src/clientversion.h index 6b805fdc4..86489bafb 100644 --- a/src/clientversion.h +++ b/src/clientversion.h @@ -1,6 +1,6 @@ // Copyright (c) 2009-2014 The Bitcoin Core developers // Copyright (c) 2016-2017 The Zcash developers -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html // What happened to the SuperNET developers, who cared about privacy? @@ -30,7 +30,7 @@ // Must be kept in sync with configure.ac , ugh! #define CLIENT_VERSION_MAJOR 3 #define CLIENT_VERSION_MINOR 9 -#define CLIENT_VERSION_REVISION 2 +#define CLIENT_VERSION_REVISION 3 #define CLIENT_VERSION_BUILD 50 //! Set to true for release, false for prerelease or test build @@ -40,7 +40,7 @@ * Copyright year (2009-this) * Todo: update this when changing our copyright comments in the source */ -#define COPYRIGHT_YEAR 2022 +#define COPYRIGHT_YEAR 2023 #endif //HAVE_CONFIG_H diff --git a/src/coincontrol.h b/src/coincontrol.h index e7dfbf13d..accc5279d 100644 --- a/src/coincontrol.h +++ b/src/coincontrol.h @@ -1,5 +1,5 @@ // Copyright (c) 2011-2013 The Bitcoin Core developers -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/src/coins.cpp b/src/coins.cpp index 57e692444..63d50e5d5 100644 --- a/src/coins.cpp +++ b/src/coins.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2012-2014 The Bitcoin Core developers -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** @@ -24,6 +24,9 @@ #include "hush_defs.h" #include "importcoin.h" #include +#include "util.h" +extern bool fZdebug; + /** * calculate number of bytes for the bitmask, and its number of non-zero bytes * each bit in the bitmask represents the availability of one output, but the diff --git a/src/coins.h b/src/coins.h index c9cae350b..18b77b342 100644 --- a/src/coins.h +++ b/src/coins.h @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin Core developers -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/compat.h b/src/compat.h index 045774e27..e6ffa269f 100644 --- a/src/compat.h +++ b/src/compat.h @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin Core developers -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** @@ -78,6 +78,8 @@ typedef u_int SOCKET; #define SOCKET_ERROR -1 #endif +#define WSAEAGAIN EAGAIN + #ifdef _WIN32 #ifndef S_IRUSR #define S_IRUSR 0400 @@ -109,8 +111,14 @@ typedef u_int SOCKET; size_t strnlen( const char *start, size_t max_len); #endif // HAVE_DECL_STRNLEN -bool static inline IsSelectableSocket(SOCKET s) { -#ifdef _WIN32 +#ifndef WIN32 +typedef void* sockopt_arg_type; +#else +typedef char* sockopt_arg_type; +#endif + +bool static inline IsSelectableSocket(const SOCKET& s) { +#ifdef WIN32 return true; #else return (s < FD_SETSIZE); diff --git a/src/compressor.cpp b/src/compressor.cpp index b3f06e47e..290fa9e5a 100644 --- a/src/compressor.cpp +++ b/src/compressor.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin Core developers // Distributed under the GPLv3 software license, see the accompanying diff --git a/src/compressor.h b/src/compressor.h index cf4ba6a35..35d989b38 100644 --- a/src/compressor.h +++ b/src/compressor.h @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin Core developers -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/src/consensus/consensus.h b/src/consensus/consensus.h index 2e22952ed..28996f8b6 100644 --- a/src/consensus/consensus.h +++ b/src/consensus/consensus.h @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin Core developers -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/consensus/params.h b/src/consensus/params.h index 3a6e2cceb..82d50a12d 100644 --- a/src/consensus/params.h +++ b/src/consensus/params.h @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin Core developers -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/consensus/upgrades.cpp b/src/consensus/upgrades.cpp index 9be24c20b..1144c8e6b 100644 --- a/src/consensus/upgrades.cpp +++ b/src/consensus/upgrades.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Copyright (c) 2018 The Zcash developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/src/consensus/upgrades.h b/src/consensus/upgrades.h index 278c3e462..56951087c 100644 --- a/src/consensus/upgrades.h +++ b/src/consensus/upgrades.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Copyright (c) 2018 The Zcash developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/src/consensus/validation.h b/src/consensus/validation.h index 848018728..8ae53c89a 100644 --- a/src/consensus/validation.h +++ b/src/consensus/validation.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin Core developers // Distributed under the GPLv3 software license, see the accompanying diff --git a/src/core_io.h b/src/core_io.h index 3e413e343..d67e8e362 100644 --- a/src/core_io.h +++ b/src/core_io.h @@ -1,5 +1,5 @@ // Copyright (c) 2009-2014 The Bitcoin Core developers -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/src/core_memusage.h b/src/core_memusage.h index 636bbf79f..770ccee31 100644 --- a/src/core_memusage.h +++ b/src/core_memusage.h @@ -1,5 +1,5 @@ // Copyright (c) 2015 The Bitcoin Core developers -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/src/core_read.cpp b/src/core_read.cpp index 3e01a37e3..0a2a906b4 100644 --- a/src/core_read.cpp +++ b/src/core_read.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Copyright (c) 2009-2014 The Bitcoin Core developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html @@ -27,7 +27,7 @@ #include "streams.h" #include #include "util.h" -#include "utilstrencodings.h" +#include "util/strencodings.h" #include "version.h" #include diff --git a/src/core_write.cpp b/src/core_write.cpp index 8b890db21..530721d8f 100644 --- a/src/core_write.cpp +++ b/src/core_write.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Copyright (c) 2009-2014 The Bitcoin Core developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html @@ -29,7 +29,7 @@ #include #include "util.h" #include "utilmoneystr.h" -#include "utilstrencodings.h" +#include "util/strencodings.h" #include #include diff --git a/src/crosschain.cpp b/src/crosschain.cpp index 68c5ce23d..92f4f816c 100644 --- a/src/crosschain.cpp +++ b/src/crosschain.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/crosschain.h b/src/crosschain.h index 4d085166e..bbde384bc 100644 --- a/src/crosschain.h +++ b/src/crosschain.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/crosschain_authority.cpp b/src/crosschain_authority.cpp index d3c1ff6e1..15de1c68b 100644 --- a/src/crosschain_authority.cpp +++ b/src/crosschain_authority.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html #include "cc/eval.h" diff --git a/src/crypto/common.h b/src/crypto/common.h index 2b6be0901..45f0f6942 100644 --- a/src/crypto/common.h +++ b/src/crypto/common.h @@ -1,6 +1,6 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Copyright (c) 2014 The Bitcoin Core developers -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Released under the GPLv3 // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html @@ -62,6 +62,13 @@ void static inline WriteLE64(unsigned char* ptr, uint64_t x) memcpy(ptr, (char*)&v, 8); } +uint16_t static inline ReadBE16(const unsigned char* ptr) +{ + uint16_t x; + memcpy((char*)&x, ptr, 2); + return be16toh(x); +} + uint32_t static inline ReadBE32(const unsigned char* ptr) { uint32_t x; diff --git a/src/crypto/equihash.cpp b/src/crypto/equihash.cpp index 9dc920212..e3ef37c81 100644 --- a/src/crypto/equihash.cpp +++ b/src/crypto/equihash.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Copyright (c) 2016 Jack Grigg // Copyright (c) 2016 The Zcash developers // Distributed under the GPLv3 software license, see the accompanying diff --git a/src/crypto/equihash.h b/src/crypto/equihash.h index 23530cc61..71cb8a01c 100644 --- a/src/crypto/equihash.h +++ b/src/crypto/equihash.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Copyright (c) 2016 Jack Grigg // Copyright (c) 2016 The Zcash developers // Distributed under the GPLv3 software license, see the accompanying @@ -8,7 +8,7 @@ #define HUSH_EQUIHASH_H #include "crypto/sha256.h" -#include "utilstrencodings.h" +#include "util/strencodings.h" #include "sodium.h" #include "hush_nk.h" #include diff --git a/src/crypto/hmac_sha256.cpp b/src/crypto/hmac_sha256.cpp index 61622d9e4..793e371bd 100644 --- a/src/crypto/hmac_sha256.cpp +++ b/src/crypto/hmac_sha256.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Copyright (c) 2014 The Bitcoin Core developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/src/crypto/hmac_sha256.h b/src/crypto/hmac_sha256.h index 1847e78d1..548808cc8 100644 --- a/src/crypto/hmac_sha256.h +++ b/src/crypto/hmac_sha256.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Copyright (c) 2014 The Bitcoin Core developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/src/crypto/hmac_sha512.cpp b/src/crypto/hmac_sha512.cpp index c4409613c..fe7177613 100644 --- a/src/crypto/hmac_sha512.cpp +++ b/src/crypto/hmac_sha512.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Copyright (c) 2014 The Bitcoin Core developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/src/crypto/hmac_sha512.h b/src/crypto/hmac_sha512.h index 5deaae851..d6fd9209c 100644 --- a/src/crypto/hmac_sha512.h +++ b/src/crypto/hmac_sha512.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Copyright (c) 2014 The Bitcoin Core developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/src/crypto/ripemd160.cpp b/src/crypto/ripemd160.cpp index f5c88e7df..03d2fd8fb 100644 --- a/src/crypto/ripemd160.cpp +++ b/src/crypto/ripemd160.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Copyright (c) 2014 The Bitcoin Core developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/src/crypto/ripemd160.h b/src/crypto/ripemd160.h index 28d76c6ba..bfdd1781d 100644 --- a/src/crypto/ripemd160.h +++ b/src/crypto/ripemd160.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Copyright (c) 2014 The Bitcoin Core developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/src/crypto/sha1.cpp b/src/crypto/sha1.cpp index f29489ba0..e064df774 100644 --- a/src/crypto/sha1.cpp +++ b/src/crypto/sha1.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Copyright (c) 2014 The Bitcoin Core developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/src/crypto/sha1.h b/src/crypto/sha1.h index 982915dc3..c7763e1e5 100644 --- a/src/crypto/sha1.h +++ b/src/crypto/sha1.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Copyright (c) 2014 The Bitcoin Core developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/src/crypto/sha256.cpp b/src/crypto/sha256.cpp index fd39de951..c68e79d3c 100644 --- a/src/crypto/sha256.cpp +++ b/src/crypto/sha256.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Copyright (c) 2014 The Bitcoin Core developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/src/crypto/sha256.h b/src/crypto/sha256.h index e54cd94a5..0098623e1 100644 --- a/src/crypto/sha256.h +++ b/src/crypto/sha256.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Copyright (c) 2014-2016 The Bitcoin Core developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/src/crypto/sha256_sse4.cpp b/src/crypto/sha256_sse4.cpp index dda4401f0..c1148d712 100644 --- a/src/crypto/sha256_sse4.cpp +++ b/src/crypto/sha256_sse4.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Copyright (c) 2017 The Bitcoin Core developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/src/crypto/sha3.cpp b/src/crypto/sha3.cpp new file mode 100644 index 000000000..77d67d290 --- /dev/null +++ b/src/crypto/sha3.cpp @@ -0,0 +1,162 @@ +// Copyright (c) 2020 The Bitcoin Core developers +// Copyright (c) 2016-2023 The Hush developers +// Distributed under the GPLv3 software license, see the accompanying +// file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html + +// Based on https://github.com/mjosaarinen/tiny_sha3/blob/master/sha3.c +// by Markku-Juhani O. Saarinen + +#include "crypto/sha3.h" +#include "crypto/common.h" +#include "span.h" + +#include +#include // For std::begin and std::end. + +#include + +// Internal implementation code. +namespace +{ +uint64_t Rotl(uint64_t x, int n) { return (x << n) | (x >> (64 - n)); } +} // namespace + +void KeccakF(uint64_t (&st)[25]) +{ + static constexpr uint64_t RNDC[24] = { + 0x0000000000000001, 0x0000000000008082, 0x800000000000808a, 0x8000000080008000, + 0x000000000000808b, 0x0000000080000001, 0x8000000080008081, 0x8000000000008009, + 0x000000000000008a, 0x0000000000000088, 0x0000000080008009, 0x000000008000000a, + 0x000000008000808b, 0x800000000000008b, 0x8000000000008089, 0x8000000000008003, + 0x8000000000008002, 0x8000000000000080, 0x000000000000800a, 0x800000008000000a, + 0x8000000080008081, 0x8000000000008080, 0x0000000080000001, 0x8000000080008008 + }; + static constexpr int ROUNDS = 24; + + for (int round = 0; round < ROUNDS; ++round) { + uint64_t bc0, bc1, bc2, bc3, bc4, t; + + // Theta + bc0 = st[0] ^ st[5] ^ st[10] ^ st[15] ^ st[20]; + bc1 = st[1] ^ st[6] ^ st[11] ^ st[16] ^ st[21]; + bc2 = st[2] ^ st[7] ^ st[12] ^ st[17] ^ st[22]; + bc3 = st[3] ^ st[8] ^ st[13] ^ st[18] ^ st[23]; + bc4 = st[4] ^ st[9] ^ st[14] ^ st[19] ^ st[24]; + t = bc4 ^ Rotl(bc1, 1); st[0] ^= t; st[5] ^= t; st[10] ^= t; st[15] ^= t; st[20] ^= t; + t = bc0 ^ Rotl(bc2, 1); st[1] ^= t; st[6] ^= t; st[11] ^= t; st[16] ^= t; st[21] ^= t; + t = bc1 ^ Rotl(bc3, 1); st[2] ^= t; st[7] ^= t; st[12] ^= t; st[17] ^= t; st[22] ^= t; + t = bc2 ^ Rotl(bc4, 1); st[3] ^= t; st[8] ^= t; st[13] ^= t; st[18] ^= t; st[23] ^= t; + t = bc3 ^ Rotl(bc0, 1); st[4] ^= t; st[9] ^= t; st[14] ^= t; st[19] ^= t; st[24] ^= t; + + // Rho Pi + t = st[1]; + bc0 = st[10]; st[10] = Rotl(t, 1); t = bc0; + bc0 = st[7]; st[7] = Rotl(t, 3); t = bc0; + bc0 = st[11]; st[11] = Rotl(t, 6); t = bc0; + bc0 = st[17]; st[17] = Rotl(t, 10); t = bc0; + bc0 = st[18]; st[18] = Rotl(t, 15); t = bc0; + bc0 = st[3]; st[3] = Rotl(t, 21); t = bc0; + bc0 = st[5]; st[5] = Rotl(t, 28); t = bc0; + bc0 = st[16]; st[16] = Rotl(t, 36); t = bc0; + bc0 = st[8]; st[8] = Rotl(t, 45); t = bc0; + bc0 = st[21]; st[21] = Rotl(t, 55); t = bc0; + bc0 = st[24]; st[24] = Rotl(t, 2); t = bc0; + bc0 = st[4]; st[4] = Rotl(t, 14); t = bc0; + bc0 = st[15]; st[15] = Rotl(t, 27); t = bc0; + bc0 = st[23]; st[23] = Rotl(t, 41); t = bc0; + bc0 = st[19]; st[19] = Rotl(t, 56); t = bc0; + bc0 = st[13]; st[13] = Rotl(t, 8); t = bc0; + bc0 = st[12]; st[12] = Rotl(t, 25); t = bc0; + bc0 = st[2]; st[2] = Rotl(t, 43); t = bc0; + bc0 = st[20]; st[20] = Rotl(t, 62); t = bc0; + bc0 = st[14]; st[14] = Rotl(t, 18); t = bc0; + bc0 = st[22]; st[22] = Rotl(t, 39); t = bc0; + bc0 = st[9]; st[9] = Rotl(t, 61); t = bc0; + bc0 = st[6]; st[6] = Rotl(t, 20); t = bc0; + st[1] = Rotl(t, 44); + + // Chi Iota + bc0 = st[0]; bc1 = st[1]; bc2 = st[2]; bc3 = st[3]; bc4 = st[4]; + st[0] = bc0 ^ (~bc1 & bc2) ^ RNDC[round]; + st[1] = bc1 ^ (~bc2 & bc3); + st[2] = bc2 ^ (~bc3 & bc4); + st[3] = bc3 ^ (~bc4 & bc0); + st[4] = bc4 ^ (~bc0 & bc1); + bc0 = st[5]; bc1 = st[6]; bc2 = st[7]; bc3 = st[8]; bc4 = st[9]; + st[5] = bc0 ^ (~bc1 & bc2); + st[6] = bc1 ^ (~bc2 & bc3); + st[7] = bc2 ^ (~bc3 & bc4); + st[8] = bc3 ^ (~bc4 & bc0); + st[9] = bc4 ^ (~bc0 & bc1); + bc0 = st[10]; bc1 = st[11]; bc2 = st[12]; bc3 = st[13]; bc4 = st[14]; + st[10] = bc0 ^ (~bc1 & bc2); + st[11] = bc1 ^ (~bc2 & bc3); + st[12] = bc2 ^ (~bc3 & bc4); + st[13] = bc3 ^ (~bc4 & bc0); + st[14] = bc4 ^ (~bc0 & bc1); + bc0 = st[15]; bc1 = st[16]; bc2 = st[17]; bc3 = st[18]; bc4 = st[19]; + st[15] = bc0 ^ (~bc1 & bc2); + st[16] = bc1 ^ (~bc2 & bc3); + st[17] = bc2 ^ (~bc3 & bc4); + st[18] = bc3 ^ (~bc4 & bc0); + st[19] = bc4 ^ (~bc0 & bc1); + bc0 = st[20]; bc1 = st[21]; bc2 = st[22]; bc3 = st[23]; bc4 = st[24]; + st[20] = bc0 ^ (~bc1 & bc2); + st[21] = bc1 ^ (~bc2 & bc3); + st[22] = bc2 ^ (~bc3 & bc4); + st[23] = bc3 ^ (~bc4 & bc0); + st[24] = bc4 ^ (~bc0 & bc1); + } +} + +SHA3_256_& SHA3_256_::Write(Span data) +{ + if (m_bufsize && m_bufsize + data.size() >= sizeof(m_buffer)) { + // Fill the buffer and process it. + std::copy(data.begin(), data.begin() + sizeof(m_buffer) - m_bufsize, m_buffer + m_bufsize); + data = data.subspan(sizeof(m_buffer) - m_bufsize); + m_state[m_pos++] ^= ReadLE64(m_buffer); + m_bufsize = 0; + if (m_pos == RATE_BUFFERS) { + KeccakF(m_state); + m_pos = 0; + } + } + while (data.size() >= sizeof(m_buffer)) { + // Process chunks directly from the buffer. + m_state[m_pos++] ^= ReadLE64(data.data()); + data = data.subspan(8); + if (m_pos == RATE_BUFFERS) { + KeccakF(m_state); + m_pos = 0; + } + } + if (data.size()) { + // Keep the remainder in the buffer. + std::copy(data.begin(), data.end(), m_buffer + m_bufsize); + m_bufsize += data.size(); + } + return *this; +} + +SHA3_256_& SHA3_256_::Finalize(Span output) +{ + assert(output.size() == OUTPUT_SIZE); + std::fill(m_buffer + m_bufsize, m_buffer + sizeof(m_buffer), 0); + m_buffer[m_bufsize] ^= 0x06; + m_state[m_pos] ^= ReadLE64(m_buffer); + m_state[RATE_BUFFERS - 1] ^= 0x8000000000000000; + KeccakF(m_state); + for (unsigned i = 0; i < 4; ++i) { + WriteLE64(output.data() + 8 * i, m_state[i]); + } + return *this; +} + +SHA3_256_& SHA3_256_::Reset() +{ + m_bufsize = 0; + m_pos = 0; + std::fill(std::begin(m_state), std::end(m_state), 0); + return *this; +} diff --git a/src/crypto/sha3.h b/src/crypto/sha3.h new file mode 100644 index 000000000..62e06c476 --- /dev/null +++ b/src/crypto/sha3.h @@ -0,0 +1,42 @@ +// Copyright (c) 2020 The Bitcoin Core developers +// Copyright (c) 2016-2023 The Hush developers +// Distributed under the GPLv3 software license, see the accompanying +// file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html + +#ifndef HUSH_CRYPTO_SHA3_H +#define HUSH_CRYPTO_SHA3_H + +#include "span.h" + +#include +#include + +//! The Keccak-f[1600] transform. +void KeccakF(uint64_t (&st)[25]); + +class SHA3_256_ +{ +private: + uint64_t m_state[25] = {0}; + unsigned char m_buffer[8]; + unsigned m_bufsize = 0; + unsigned m_pos = 0; + + //! Sponge rate in bits. + static constexpr unsigned RATE_BITS = 1088; + + //! Sponge rate expressed as a multiple of the buffer size. + static constexpr unsigned RATE_BUFFERS = RATE_BITS / (8 * sizeof(m_buffer)); + + static_assert(RATE_BITS % (8 * sizeof(m_buffer)) == 0, "Rate must be a multiple of 8 bytes"); + +public: + static constexpr size_t OUTPUT_SIZE = 32; + + SHA3_256_() {} + SHA3_256_& Write(Span data); + SHA3_256_& Finalize(Span output); + SHA3_256_& Reset(); +}; + +#endif // HUSH_CRYPTO_SHA3_H diff --git a/src/crypto/sha512.cpp b/src/crypto/sha512.cpp index 7099fbbbe..d68d0efec 100644 --- a/src/crypto/sha512.cpp +++ b/src/crypto/sha512.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Copyright (c) 2014 The Bitcoin Core developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/src/crypto/sha512.h b/src/crypto/sha512.h index 9a348f874..48ceea484 100644 --- a/src/crypto/sha512.h +++ b/src/crypto/sha512.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Copyright (c) 2014 The Bitcoin Core developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/src/cryptoconditions/AUTHORS b/src/cryptoconditions/AUTHORS index 3baf5f36e..ddfc3f623 100644 --- a/src/cryptoconditions/AUTHORS +++ b/src/cryptoconditions/AUTHORS @@ -4,6 +4,6 @@ Copyright 2017 Scott Sadler # Current Authors -Copyright (c) 2016-2022 The Hush Developers +Copyright (c) 2016-2023 The Hush Developers Relicensed to GPLv3 on Nov 21st 2020. diff --git a/src/cryptoconditions/Makefile.am b/src/cryptoconditions/Makefile.am index 615ac5783..01d5a98bc 100644 --- a/src/cryptoconditions/Makefile.am +++ b/src/cryptoconditions/Makefile.am @@ -1,3 +1,6 @@ +# Copyright 2016-2023 The Hush developers +# Distributed under the GPLv3 software license, see the accompanying +# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html lib_LTLIBRARIES=libcryptoconditions.la noinst_LTLIBRARIES=$(CRYPTOCONDITIONS_CORE) SUBDIRS = src/include/secp256k1 diff --git a/src/cryptoconditions/src/anon.c b/src/cryptoconditions/src/anon.c index 3ec319cde..28257f5f2 100644 --- a/src/cryptoconditions/src/anon.c +++ b/src/cryptoconditions/src/anon.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers /****************************************************************************** * Copyright © 2014-2019 The SuperNET Developers. * * * diff --git a/src/cryptoconditions/src/asn/BIT_STRING.c b/src/cryptoconditions/src/asn/BIT_STRING.c index 89df2aebf..ad1e77f69 100644 --- a/src/cryptoconditions/src/asn/BIT_STRING.c +++ b/src/cryptoconditions/src/asn/BIT_STRING.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /*- diff --git a/src/cryptoconditions/src/asn/BIT_STRING.h b/src/cryptoconditions/src/asn/BIT_STRING.h index 415dc9475..4301d2469 100644 --- a/src/cryptoconditions/src/asn/BIT_STRING.h +++ b/src/cryptoconditions/src/asn/BIT_STRING.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /*- diff --git a/src/cryptoconditions/src/asn/CompoundSha256Condition.c b/src/cryptoconditions/src/asn/CompoundSha256Condition.c index a6670a69f..1146d850f 100644 --- a/src/cryptoconditions/src/asn/CompoundSha256Condition.c +++ b/src/cryptoconditions/src/asn/CompoundSha256Condition.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cryptoconditions/src/asn/CompoundSha256Condition.h b/src/cryptoconditions/src/asn/CompoundSha256Condition.h index c80c38e63..5188619f3 100644 --- a/src/cryptoconditions/src/asn/CompoundSha256Condition.h +++ b/src/cryptoconditions/src/asn/CompoundSha256Condition.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cryptoconditions/src/asn/Condition.c b/src/cryptoconditions/src/asn/Condition.c index 022d40199..08a39ad96 100644 --- a/src/cryptoconditions/src/asn/Condition.c +++ b/src/cryptoconditions/src/asn/Condition.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cryptoconditions/src/asn/Condition.h b/src/cryptoconditions/src/asn/Condition.h index f89f3691e..c2aaebcad 100644 --- a/src/cryptoconditions/src/asn/Condition.h +++ b/src/cryptoconditions/src/asn/Condition.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cryptoconditions/src/asn/ConditionTypes.c b/src/cryptoconditions/src/asn/ConditionTypes.c index 8bde4c5ff..bd6050c91 100644 --- a/src/cryptoconditions/src/asn/ConditionTypes.c +++ b/src/cryptoconditions/src/asn/ConditionTypes.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cryptoconditions/src/asn/ConditionTypes.h b/src/cryptoconditions/src/asn/ConditionTypes.h index a517a835e..441c1b163 100644 --- a/src/cryptoconditions/src/asn/ConditionTypes.h +++ b/src/cryptoconditions/src/asn/ConditionTypes.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cryptoconditions/src/asn/Ed25519FingerprintContents.c b/src/cryptoconditions/src/asn/Ed25519FingerprintContents.c index 7f84b2d59..f3bccd3b4 100644 --- a/src/cryptoconditions/src/asn/Ed25519FingerprintContents.c +++ b/src/cryptoconditions/src/asn/Ed25519FingerprintContents.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cryptoconditions/src/asn/Ed25519FingerprintContents.h b/src/cryptoconditions/src/asn/Ed25519FingerprintContents.h index 7030f86cf..66e78e74e 100644 --- a/src/cryptoconditions/src/asn/Ed25519FingerprintContents.h +++ b/src/cryptoconditions/src/asn/Ed25519FingerprintContents.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cryptoconditions/src/asn/Ed25519Sha512Fulfillment.c b/src/cryptoconditions/src/asn/Ed25519Sha512Fulfillment.c index f95636c4b..b2e37f835 100644 --- a/src/cryptoconditions/src/asn/Ed25519Sha512Fulfillment.c +++ b/src/cryptoconditions/src/asn/Ed25519Sha512Fulfillment.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cryptoconditions/src/asn/Ed25519Sha512Fulfillment.h b/src/cryptoconditions/src/asn/Ed25519Sha512Fulfillment.h index 739467750..75547ffd6 100644 --- a/src/cryptoconditions/src/asn/Ed25519Sha512Fulfillment.h +++ b/src/cryptoconditions/src/asn/Ed25519Sha512Fulfillment.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cryptoconditions/src/asn/EvalFulfillment.c b/src/cryptoconditions/src/asn/EvalFulfillment.c index 06453f83a..c08eece96 100644 --- a/src/cryptoconditions/src/asn/EvalFulfillment.c +++ b/src/cryptoconditions/src/asn/EvalFulfillment.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cryptoconditions/src/asn/EvalFulfillment.h b/src/cryptoconditions/src/asn/EvalFulfillment.h index b09f0b1cc..b99acf0be 100644 --- a/src/cryptoconditions/src/asn/EvalFulfillment.h +++ b/src/cryptoconditions/src/asn/EvalFulfillment.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cryptoconditions/src/asn/Fulfillment.c b/src/cryptoconditions/src/asn/Fulfillment.c index 428372bcf..daef2754c 100644 --- a/src/cryptoconditions/src/asn/Fulfillment.c +++ b/src/cryptoconditions/src/asn/Fulfillment.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cryptoconditions/src/asn/Fulfillment.h b/src/cryptoconditions/src/asn/Fulfillment.h index 5d409f46d..9f7a06990 100644 --- a/src/cryptoconditions/src/asn/Fulfillment.h +++ b/src/cryptoconditions/src/asn/Fulfillment.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cryptoconditions/src/asn/INTEGER.c b/src/cryptoconditions/src/asn/INTEGER.c index b3b1b7434..c1273d279 100644 --- a/src/cryptoconditions/src/asn/INTEGER.c +++ b/src/cryptoconditions/src/asn/INTEGER.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /*- diff --git a/src/cryptoconditions/src/asn/INTEGER.h b/src/cryptoconditions/src/asn/INTEGER.h index e8d56f155..2270ed5d4 100644 --- a/src/cryptoconditions/src/asn/INTEGER.h +++ b/src/cryptoconditions/src/asn/INTEGER.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /*- diff --git a/src/cryptoconditions/src/asn/NativeEnumerated.c b/src/cryptoconditions/src/asn/NativeEnumerated.c index 4f71048d2..b5d4a03e6 100644 --- a/src/cryptoconditions/src/asn/NativeEnumerated.c +++ b/src/cryptoconditions/src/asn/NativeEnumerated.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /*- diff --git a/src/cryptoconditions/src/asn/NativeEnumerated.h b/src/cryptoconditions/src/asn/NativeEnumerated.h index 036fe1f7a..5f2b666e0 100644 --- a/src/cryptoconditions/src/asn/NativeEnumerated.h +++ b/src/cryptoconditions/src/asn/NativeEnumerated.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /*- diff --git a/src/cryptoconditions/src/asn/NativeInteger.c b/src/cryptoconditions/src/asn/NativeInteger.c index 16a23aa64..20c5f2a06 100644 --- a/src/cryptoconditions/src/asn/NativeInteger.c +++ b/src/cryptoconditions/src/asn/NativeInteger.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /*- diff --git a/src/cryptoconditions/src/asn/NativeInteger.h b/src/cryptoconditions/src/asn/NativeInteger.h index 76d9d16b3..543ed6481 100644 --- a/src/cryptoconditions/src/asn/NativeInteger.h +++ b/src/cryptoconditions/src/asn/NativeInteger.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /*- diff --git a/src/cryptoconditions/src/asn/OCTET_STRING.c b/src/cryptoconditions/src/asn/OCTET_STRING.c index c7d818352..63963d6df 100644 --- a/src/cryptoconditions/src/asn/OCTET_STRING.c +++ b/src/cryptoconditions/src/asn/OCTET_STRING.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /*- diff --git a/src/cryptoconditions/src/asn/OCTET_STRING.h b/src/cryptoconditions/src/asn/OCTET_STRING.h index d0a080877..015285dec 100644 --- a/src/cryptoconditions/src/asn/OCTET_STRING.h +++ b/src/cryptoconditions/src/asn/OCTET_STRING.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /*- diff --git a/src/cryptoconditions/src/asn/PrefixFingerprintContents.c b/src/cryptoconditions/src/asn/PrefixFingerprintContents.c index 4c6171fcd..fa1112870 100644 --- a/src/cryptoconditions/src/asn/PrefixFingerprintContents.c +++ b/src/cryptoconditions/src/asn/PrefixFingerprintContents.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cryptoconditions/src/asn/PrefixFingerprintContents.h b/src/cryptoconditions/src/asn/PrefixFingerprintContents.h index aa9b79a01..60242f5b7 100644 --- a/src/cryptoconditions/src/asn/PrefixFingerprintContents.h +++ b/src/cryptoconditions/src/asn/PrefixFingerprintContents.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cryptoconditions/src/asn/PrefixFulfillment.c b/src/cryptoconditions/src/asn/PrefixFulfillment.c index 51d8e7a74..979455327 100644 --- a/src/cryptoconditions/src/asn/PrefixFulfillment.c +++ b/src/cryptoconditions/src/asn/PrefixFulfillment.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cryptoconditions/src/asn/PrefixFulfillment.h b/src/cryptoconditions/src/asn/PrefixFulfillment.h index b6c6f410f..4f93883c4 100644 --- a/src/cryptoconditions/src/asn/PrefixFulfillment.h +++ b/src/cryptoconditions/src/asn/PrefixFulfillment.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cryptoconditions/src/asn/PreimageFulfillment.c b/src/cryptoconditions/src/asn/PreimageFulfillment.c index c98df0ed1..6275229be 100644 --- a/src/cryptoconditions/src/asn/PreimageFulfillment.c +++ b/src/cryptoconditions/src/asn/PreimageFulfillment.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cryptoconditions/src/asn/PreimageFulfillment.h b/src/cryptoconditions/src/asn/PreimageFulfillment.h index 8329b47df..723f1b710 100644 --- a/src/cryptoconditions/src/asn/PreimageFulfillment.h +++ b/src/cryptoconditions/src/asn/PreimageFulfillment.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cryptoconditions/src/asn/RsaFingerprintContents.c b/src/cryptoconditions/src/asn/RsaFingerprintContents.c index a21b33069..349701a22 100644 --- a/src/cryptoconditions/src/asn/RsaFingerprintContents.c +++ b/src/cryptoconditions/src/asn/RsaFingerprintContents.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cryptoconditions/src/asn/RsaFingerprintContents.h b/src/cryptoconditions/src/asn/RsaFingerprintContents.h index 095ebd4ce..8ea66fd28 100644 --- a/src/cryptoconditions/src/asn/RsaFingerprintContents.h +++ b/src/cryptoconditions/src/asn/RsaFingerprintContents.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cryptoconditions/src/asn/RsaSha256Fulfillment.c b/src/cryptoconditions/src/asn/RsaSha256Fulfillment.c index 52d58d1fa..0f6d59913 100644 --- a/src/cryptoconditions/src/asn/RsaSha256Fulfillment.c +++ b/src/cryptoconditions/src/asn/RsaSha256Fulfillment.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cryptoconditions/src/asn/RsaSha256Fulfillment.h b/src/cryptoconditions/src/asn/RsaSha256Fulfillment.h index 64a78cbf2..8cb612ee6 100644 --- a/src/cryptoconditions/src/asn/RsaSha256Fulfillment.h +++ b/src/cryptoconditions/src/asn/RsaSha256Fulfillment.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cryptoconditions/src/asn/Secp256k1FingerprintContents.c b/src/cryptoconditions/src/asn/Secp256k1FingerprintContents.c index b7ea1b971..5203a5eba 100644 --- a/src/cryptoconditions/src/asn/Secp256k1FingerprintContents.c +++ b/src/cryptoconditions/src/asn/Secp256k1FingerprintContents.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cryptoconditions/src/asn/Secp256k1FingerprintContents.h b/src/cryptoconditions/src/asn/Secp256k1FingerprintContents.h index 7fbadb386..4d0f9d3e0 100644 --- a/src/cryptoconditions/src/asn/Secp256k1FingerprintContents.h +++ b/src/cryptoconditions/src/asn/Secp256k1FingerprintContents.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cryptoconditions/src/asn/Secp256k1Fulfillment.c b/src/cryptoconditions/src/asn/Secp256k1Fulfillment.c index 53689d049..6ecc313e4 100644 --- a/src/cryptoconditions/src/asn/Secp256k1Fulfillment.c +++ b/src/cryptoconditions/src/asn/Secp256k1Fulfillment.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cryptoconditions/src/asn/Secp256k1Fulfillment.h b/src/cryptoconditions/src/asn/Secp256k1Fulfillment.h index a672a55d6..8f4e59ef5 100644 --- a/src/cryptoconditions/src/asn/Secp256k1Fulfillment.h +++ b/src/cryptoconditions/src/asn/Secp256k1Fulfillment.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cryptoconditions/src/asn/SimpleSha256Condition.c b/src/cryptoconditions/src/asn/SimpleSha256Condition.c index 0633348fc..4478ea6d3 100644 --- a/src/cryptoconditions/src/asn/SimpleSha256Condition.c +++ b/src/cryptoconditions/src/asn/SimpleSha256Condition.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cryptoconditions/src/asn/SimpleSha256Condition.h b/src/cryptoconditions/src/asn/SimpleSha256Condition.h index 3e883d5d3..d277238b5 100644 --- a/src/cryptoconditions/src/asn/SimpleSha256Condition.h +++ b/src/cryptoconditions/src/asn/SimpleSha256Condition.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cryptoconditions/src/asn/ThresholdFingerprintContents.c b/src/cryptoconditions/src/asn/ThresholdFingerprintContents.c index 38248ccfc..d233afc17 100644 --- a/src/cryptoconditions/src/asn/ThresholdFingerprintContents.c +++ b/src/cryptoconditions/src/asn/ThresholdFingerprintContents.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cryptoconditions/src/asn/ThresholdFingerprintContents.h b/src/cryptoconditions/src/asn/ThresholdFingerprintContents.h index fcaf3c032..47847e530 100644 --- a/src/cryptoconditions/src/asn/ThresholdFingerprintContents.h +++ b/src/cryptoconditions/src/asn/ThresholdFingerprintContents.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cryptoconditions/src/asn/ThresholdFulfillment.c b/src/cryptoconditions/src/asn/ThresholdFulfillment.c index ef8aa26fa..c5047a302 100644 --- a/src/cryptoconditions/src/asn/ThresholdFulfillment.c +++ b/src/cryptoconditions/src/asn/ThresholdFulfillment.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cryptoconditions/src/asn/ThresholdFulfillment.h b/src/cryptoconditions/src/asn/ThresholdFulfillment.h index 1c2a38a3c..2e17457ef 100644 --- a/src/cryptoconditions/src/asn/ThresholdFulfillment.h +++ b/src/cryptoconditions/src/asn/ThresholdFulfillment.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cryptoconditions/src/asn/asn_SET_OF.c b/src/cryptoconditions/src/asn/asn_SET_OF.c index 8223117e3..04348a6f1 100644 --- a/src/cryptoconditions/src/asn/asn_SET_OF.c +++ b/src/cryptoconditions/src/asn/asn_SET_OF.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /*- diff --git a/src/cryptoconditions/src/asn/asn_SET_OF.h b/src/cryptoconditions/src/asn/asn_SET_OF.h index 7346d4d59..88c8a8536 100644 --- a/src/cryptoconditions/src/asn/asn_SET_OF.h +++ b/src/cryptoconditions/src/asn/asn_SET_OF.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /*- diff --git a/src/cryptoconditions/src/asn/asn_application.h b/src/cryptoconditions/src/asn/asn_application.h index 1fc5994bd..8e9e7de84 100644 --- a/src/cryptoconditions/src/asn/asn_application.h +++ b/src/cryptoconditions/src/asn/asn_application.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /*- diff --git a/src/cryptoconditions/src/asn/asn_codecs.h b/src/cryptoconditions/src/asn/asn_codecs.h index 2194160de..f374e59b1 100644 --- a/src/cryptoconditions/src/asn/asn_codecs.h +++ b/src/cryptoconditions/src/asn/asn_codecs.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /*- diff --git a/src/cryptoconditions/src/asn/asn_codecs_prim.c b/src/cryptoconditions/src/asn/asn_codecs_prim.c index 9cbce8a52..17a698f3a 100644 --- a/src/cryptoconditions/src/asn/asn_codecs_prim.c +++ b/src/cryptoconditions/src/asn/asn_codecs_prim.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /*- diff --git a/src/cryptoconditions/src/asn/asn_codecs_prim.h b/src/cryptoconditions/src/asn/asn_codecs_prim.h index 45c4368af..4c0ec7de0 100644 --- a/src/cryptoconditions/src/asn/asn_codecs_prim.h +++ b/src/cryptoconditions/src/asn/asn_codecs_prim.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /*- diff --git a/src/cryptoconditions/src/asn/asn_internal.h b/src/cryptoconditions/src/asn/asn_internal.h index 7e864792f..057b1c41a 100644 --- a/src/cryptoconditions/src/asn/asn_internal.h +++ b/src/cryptoconditions/src/asn/asn_internal.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /*- diff --git a/src/cryptoconditions/src/asn/asn_system.h b/src/cryptoconditions/src/asn/asn_system.h index 0f8e85652..1309aed3e 100644 --- a/src/cryptoconditions/src/asn/asn_system.h +++ b/src/cryptoconditions/src/asn/asn_system.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /*- diff --git a/src/cryptoconditions/src/asn/ber_decoder.c b/src/cryptoconditions/src/asn/ber_decoder.c index e1aa1cd73..bf14491a9 100644 --- a/src/cryptoconditions/src/asn/ber_decoder.c +++ b/src/cryptoconditions/src/asn/ber_decoder.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /*- diff --git a/src/cryptoconditions/src/asn/ber_decoder.h b/src/cryptoconditions/src/asn/ber_decoder.h index 94c27b5d5..99ad97507 100644 --- a/src/cryptoconditions/src/asn/ber_decoder.h +++ b/src/cryptoconditions/src/asn/ber_decoder.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /*- diff --git a/src/cryptoconditions/src/asn/ber_tlv_length.c b/src/cryptoconditions/src/asn/ber_tlv_length.c index 79c723421..7014a016f 100644 --- a/src/cryptoconditions/src/asn/ber_tlv_length.c +++ b/src/cryptoconditions/src/asn/ber_tlv_length.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /*- diff --git a/src/cryptoconditions/src/asn/ber_tlv_length.h b/src/cryptoconditions/src/asn/ber_tlv_length.h index 1f09d0dde..5881bc71b 100644 --- a/src/cryptoconditions/src/asn/ber_tlv_length.h +++ b/src/cryptoconditions/src/asn/ber_tlv_length.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /*- diff --git a/src/cryptoconditions/src/asn/ber_tlv_tag.c b/src/cryptoconditions/src/asn/ber_tlv_tag.c index a0e7f8c08..657de5857 100644 --- a/src/cryptoconditions/src/asn/ber_tlv_tag.c +++ b/src/cryptoconditions/src/asn/ber_tlv_tag.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /*- diff --git a/src/cryptoconditions/src/asn/ber_tlv_tag.h b/src/cryptoconditions/src/asn/ber_tlv_tag.h index 47ffa5772..82908ae26 100644 --- a/src/cryptoconditions/src/asn/ber_tlv_tag.h +++ b/src/cryptoconditions/src/asn/ber_tlv_tag.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /*- diff --git a/src/cryptoconditions/src/asn/constr_CHOICE.c b/src/cryptoconditions/src/asn/constr_CHOICE.c index 73094b0bf..163f940b6 100644 --- a/src/cryptoconditions/src/asn/constr_CHOICE.c +++ b/src/cryptoconditions/src/asn/constr_CHOICE.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cryptoconditions/src/asn/constr_CHOICE.h b/src/cryptoconditions/src/asn/constr_CHOICE.h index ec2e6a506..d5eff9d0c 100644 --- a/src/cryptoconditions/src/asn/constr_CHOICE.h +++ b/src/cryptoconditions/src/asn/constr_CHOICE.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /*- diff --git a/src/cryptoconditions/src/asn/constr_SEQUENCE.c b/src/cryptoconditions/src/asn/constr_SEQUENCE.c index 696dc0220..d1735875e 100644 --- a/src/cryptoconditions/src/asn/constr_SEQUENCE.c +++ b/src/cryptoconditions/src/asn/constr_SEQUENCE.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /*- diff --git a/src/cryptoconditions/src/asn/constr_SEQUENCE.h b/src/cryptoconditions/src/asn/constr_SEQUENCE.h index 11a55a4f1..a2092e461 100644 --- a/src/cryptoconditions/src/asn/constr_SEQUENCE.h +++ b/src/cryptoconditions/src/asn/constr_SEQUENCE.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /*- diff --git a/src/cryptoconditions/src/asn/constr_SET_OF.c b/src/cryptoconditions/src/asn/constr_SET_OF.c index 84196dc0e..aeb39d1a2 100644 --- a/src/cryptoconditions/src/asn/constr_SET_OF.c +++ b/src/cryptoconditions/src/asn/constr_SET_OF.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /*- diff --git a/src/cryptoconditions/src/asn/constr_SET_OF.h b/src/cryptoconditions/src/asn/constr_SET_OF.h index 184ce08fc..d3731b07d 100644 --- a/src/cryptoconditions/src/asn/constr_SET_OF.h +++ b/src/cryptoconditions/src/asn/constr_SET_OF.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /*- diff --git a/src/cryptoconditions/src/asn/constr_TYPE.c b/src/cryptoconditions/src/asn/constr_TYPE.c index 09c5e22da..bf7584ee5 100644 --- a/src/cryptoconditions/src/asn/constr_TYPE.c +++ b/src/cryptoconditions/src/asn/constr_TYPE.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /*- diff --git a/src/cryptoconditions/src/asn/constr_TYPE.h b/src/cryptoconditions/src/asn/constr_TYPE.h index 6a4a4c793..920a7fbe0 100644 --- a/src/cryptoconditions/src/asn/constr_TYPE.h +++ b/src/cryptoconditions/src/asn/constr_TYPE.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /*- diff --git a/src/cryptoconditions/src/asn/constraints.c b/src/cryptoconditions/src/asn/constraints.c index 9156af35f..ae8d31a6a 100644 --- a/src/cryptoconditions/src/asn/constraints.c +++ b/src/cryptoconditions/src/asn/constraints.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html #include "asn_internal.h" diff --git a/src/cryptoconditions/src/asn/constraints.h b/src/cryptoconditions/src/asn/constraints.h index 071a33f40..ab540e7f6 100644 --- a/src/cryptoconditions/src/asn/constraints.h +++ b/src/cryptoconditions/src/asn/constraints.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /*- diff --git a/src/cryptoconditions/src/asn/der_encoder.c b/src/cryptoconditions/src/asn/der_encoder.c index 5b8aff86e..b734f3825 100644 --- a/src/cryptoconditions/src/asn/der_encoder.c +++ b/src/cryptoconditions/src/asn/der_encoder.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /*- diff --git a/src/cryptoconditions/src/asn/der_encoder.h b/src/cryptoconditions/src/asn/der_encoder.h index 21c0021e0..369bf28f0 100644 --- a/src/cryptoconditions/src/asn/der_encoder.h +++ b/src/cryptoconditions/src/asn/der_encoder.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /*- diff --git a/src/cryptoconditions/src/asn/per_decoder.c b/src/cryptoconditions/src/asn/per_decoder.c index 25d078149..d55138543 100644 --- a/src/cryptoconditions/src/asn/per_decoder.c +++ b/src/cryptoconditions/src/asn/per_decoder.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html #include "asn_application.h" diff --git a/src/cryptoconditions/src/asn/per_decoder.h b/src/cryptoconditions/src/asn/per_decoder.h index d3a038a4a..d3d1e98ae 100644 --- a/src/cryptoconditions/src/asn/per_decoder.h +++ b/src/cryptoconditions/src/asn/per_decoder.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /*- diff --git a/src/cryptoconditions/src/asn/per_encoder.c b/src/cryptoconditions/src/asn/per_encoder.c index 063a0be06..f462a02d7 100644 --- a/src/cryptoconditions/src/asn/per_encoder.c +++ b/src/cryptoconditions/src/asn/per_encoder.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html #include "asn_application.h" diff --git a/src/cryptoconditions/src/asn/per_encoder.h b/src/cryptoconditions/src/asn/per_encoder.h index c9b451c70..951614e89 100644 --- a/src/cryptoconditions/src/asn/per_encoder.h +++ b/src/cryptoconditions/src/asn/per_encoder.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /*- diff --git a/src/cryptoconditions/src/asn/per_opentype.c b/src/cryptoconditions/src/asn/per_opentype.c index 573667e74..d96fa39f8 100644 --- a/src/cryptoconditions/src/asn/per_opentype.c +++ b/src/cryptoconditions/src/asn/per_opentype.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cryptoconditions/src/asn/per_opentype.h b/src/cryptoconditions/src/asn/per_opentype.h index f0b998784..6eea6ee43 100644 --- a/src/cryptoconditions/src/asn/per_opentype.h +++ b/src/cryptoconditions/src/asn/per_opentype.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cryptoconditions/src/asn/per_support.c b/src/cryptoconditions/src/asn/per_support.c index 39fb38b5e..88c5e479a 100644 --- a/src/cryptoconditions/src/asn/per_support.c +++ b/src/cryptoconditions/src/asn/per_support.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cryptoconditions/src/asn/per_support.h b/src/cryptoconditions/src/asn/per_support.h index cdb064a5a..3b60f5158 100644 --- a/src/cryptoconditions/src/asn/per_support.h +++ b/src/cryptoconditions/src/asn/per_support.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cryptoconditions/src/asn/xer_decoder.c b/src/cryptoconditions/src/asn/xer_decoder.c index a09e1b7d1..5ed9c06dd 100644 --- a/src/cryptoconditions/src/asn/xer_decoder.c +++ b/src/cryptoconditions/src/asn/xer_decoder.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cryptoconditions/src/asn/xer_decoder.h b/src/cryptoconditions/src/asn/xer_decoder.h index 6ee5fb61a..ff4d8c852 100644 --- a/src/cryptoconditions/src/asn/xer_decoder.h +++ b/src/cryptoconditions/src/asn/xer_decoder.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /*- diff --git a/src/cryptoconditions/src/asn/xer_encoder.c b/src/cryptoconditions/src/asn/xer_encoder.c index 26c9c92da..c76e95471 100644 --- a/src/cryptoconditions/src/asn/xer_encoder.c +++ b/src/cryptoconditions/src/asn/xer_encoder.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /*- diff --git a/src/cryptoconditions/src/asn/xer_encoder.h b/src/cryptoconditions/src/asn/xer_encoder.h index fb58a37d6..aeff71aec 100644 --- a/src/cryptoconditions/src/asn/xer_encoder.h +++ b/src/cryptoconditions/src/asn/xer_encoder.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /*- diff --git a/src/cryptoconditions/src/asn/xer_support.c b/src/cryptoconditions/src/asn/xer_support.c index 85c6e320f..d590743af 100644 --- a/src/cryptoconditions/src/asn/xer_support.c +++ b/src/cryptoconditions/src/asn/xer_support.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cryptoconditions/src/asn/xer_support.h b/src/cryptoconditions/src/asn/xer_support.h index b041f3310..76329442b 100644 --- a/src/cryptoconditions/src/asn/xer_support.h +++ b/src/cryptoconditions/src/asn/xer_support.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cryptoconditions/src/cryptoconditions.c b/src/cryptoconditions/src/cryptoconditions.c index a6b2d9156..3f34bfdf2 100644 --- a/src/cryptoconditions/src/cryptoconditions.c +++ b/src/cryptoconditions/src/cryptoconditions.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cryptoconditions/src/ed25519.c b/src/cryptoconditions/src/ed25519.c index 604c07c02..9bc31209a 100644 --- a/src/cryptoconditions/src/ed25519.c +++ b/src/cryptoconditions/src/ed25519.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cryptoconditions/src/eval.c b/src/cryptoconditions/src/eval.c index 3b33110f7..b312a2f5c 100644 --- a/src/cryptoconditions/src/eval.c +++ b/src/cryptoconditions/src/eval.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cryptoconditions/src/include/cJSON.c b/src/cryptoconditions/src/include/cJSON.c index 3a4c6f7d3..3e0b711b0 100644 --- a/src/cryptoconditions/src/include/cJSON.c +++ b/src/cryptoconditions/src/include/cJSON.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cryptoconditions/src/include/cJSON.h b/src/cryptoconditions/src/include/cJSON.h index 8b643f561..d0f2d1d11 100644 --- a/src/cryptoconditions/src/include/cJSON.h +++ b/src/cryptoconditions/src/include/cJSON.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/cryptoconditions/src/include/libbase58.h b/src/cryptoconditions/src/include/libbase58.h index 87b546e5e..d0831c18d 100644 --- a/src/cryptoconditions/src/include/libbase58.h +++ b/src/cryptoconditions/src/include/libbase58.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cryptoconditions/src/include/sha256.c b/src/cryptoconditions/src/include/sha256.c index 743ac3420..e372e0be6 100644 --- a/src/cryptoconditions/src/include/sha256.c +++ b/src/cryptoconditions/src/include/sha256.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /*- diff --git a/src/cryptoconditions/src/include/sha256.h b/src/cryptoconditions/src/include/sha256.h index 594127427..417b6cea3 100644 --- a/src/cryptoconditions/src/include/sha256.h +++ b/src/cryptoconditions/src/include/sha256.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /*- diff --git a/src/cryptoconditions/src/include/tweetnacl.c b/src/cryptoconditions/src/include/tweetnacl.c index 5bc6fb071..020717184 100644 --- a/src/cryptoconditions/src/include/tweetnacl.c +++ b/src/cryptoconditions/src/include/tweetnacl.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html #include "tweetnacl.h" diff --git a/src/cryptoconditions/src/include/tweetnacl.h b/src/cryptoconditions/src/include/tweetnacl.h index 80c7d833e..e22b15736 100644 --- a/src/cryptoconditions/src/include/tweetnacl.h +++ b/src/cryptoconditions/src/include/tweetnacl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html #ifndef TWEETNACL_H diff --git a/src/cryptoconditions/src/internal.h b/src/cryptoconditions/src/internal.h index f84a2ec09..1f6bfa563 100644 --- a/src/cryptoconditions/src/internal.h +++ b/src/cryptoconditions/src/internal.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers /****************************************************************************** * Copyright © 2014-2019 The SuperNET Developers. * * * diff --git a/src/cryptoconditions/src/json_rpc.c b/src/cryptoconditions/src/json_rpc.c index 42be07b5a..e259323a5 100644 --- a/src/cryptoconditions/src/json_rpc.c +++ b/src/cryptoconditions/src/json_rpc.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cryptoconditions/src/prefix.c b/src/cryptoconditions/src/prefix.c index e639a6cc9..ae7e2d44f 100644 --- a/src/cryptoconditions/src/prefix.c +++ b/src/cryptoconditions/src/prefix.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cryptoconditions/src/preimage.c b/src/cryptoconditions/src/preimage.c index 4518f2402..5cedf5f48 100644 --- a/src/cryptoconditions/src/preimage.c +++ b/src/cryptoconditions/src/preimage.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cryptoconditions/src/secp256k1.c b/src/cryptoconditions/src/secp256k1.c index ffcca123c..9131bc268 100644 --- a/src/cryptoconditions/src/secp256k1.c +++ b/src/cryptoconditions/src/secp256k1.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cryptoconditions/src/threshold.c b/src/cryptoconditions/src/threshold.c index 28fcaa6ed..7b1d99e5e 100644 --- a/src/cryptoconditions/src/threshold.c +++ b/src/cryptoconditions/src/threshold.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/cryptoconditions/src/utils.c b/src/cryptoconditions/src/utils.c index 69e5a8b7c..0c9b24416 100644 --- a/src/cryptoconditions/src/utils.c +++ b/src/cryptoconditions/src/utils.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/dbwrapper.cpp b/src/dbwrapper.cpp index 1d62f1a01..18777f835 100644 --- a/src/dbwrapper.cpp +++ b/src/dbwrapper.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2012-2014 The Bitcoin Core developers -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/src/dbwrapper.h b/src/dbwrapper.h index 3a1813caf..13c6a0e96 100644 --- a/src/dbwrapper.h +++ b/src/dbwrapper.h @@ -1,5 +1,5 @@ // Copyright (c) 2012-2014 The Bitcoin Core developers -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/src/deprecation.cpp b/src/deprecation.cpp index 3c68fc07e..8d20b87b5 100644 --- a/src/deprecation.cpp +++ b/src/deprecation.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2017 The Zcash developers -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html @@ -19,8 +19,6 @@ ******************************************************************************/ #include "deprecation.h" - -#include "alert.h" #include "clientversion.h" #include "init.h" #include "ui_interface.h" @@ -51,7 +49,6 @@ void EnforceNodeDeprecation(int nHeight, bool forceLogging, bool fThread) { DEPRECATION_HEIGHT) + " " + _("You should upgrade to the latest version of Hush."); LogPrintf("*** %s\n", msg); - CAlert::Notify(msg, fThread); uiInterface.ThreadSafeMessageBox(msg, "", CClientUIInterface::MSG_ERROR); } StartShutdown(); @@ -60,7 +57,6 @@ void EnforceNodeDeprecation(int nHeight, bool forceLogging, bool fThread) { DEPRECATION_HEIGHT) + " " + _("You should upgrade to the latest version of Hush."); LogPrintf("*** %s\n", msg); - CAlert::Notify(msg, fThread); uiInterface.ThreadSafeMessageBox(msg, "", CClientUIInterface::MSG_WARNING); } } diff --git a/src/deprecation.h b/src/deprecation.h index c9c765e98..8cd724229 100644 --- a/src/deprecation.h +++ b/src/deprecation.h @@ -1,5 +1,5 @@ // Copyright (c) 2017 The Zcash developers -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/src/dragonx-cli b/src/dragonx-cli new file mode 100755 index 000000000..5b9eaa511 --- /dev/null +++ b/src/dragonx-cli @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +# Copyright 2016-2023 The Hush Developers +# Copyright 2022 The DragonX Developers +# Released under the GPLv3 + +# set working directory to the location of this script +# readlink -f does not always exist +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +cd $DIR +DIR="$( cd "$( dirname "$( readlink "${BASH_SOURCE[0]}" )" )" && pwd )" +cd $DIR + +./hush-cli -ac_name=DRAGONX $@ diff --git a/src/dragonxd b/src/dragonxd new file mode 100755 index 000000000..86707c137 --- /dev/null +++ b/src/dragonxd @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +# Copyright 2016-2023 The Hush Developers +# Copyright 2022 The DragonX Developers +# Released under the GPLv3 + +# set working directory to the location of this script +# readlink -f does not always exist +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +cd $DIR +DIR="$( cd "$( dirname "$( readlink "${BASH_SOURCE[0]}" )" )" && pwd )" +cd $DIR + +SEEDNODE=176.126.87.241 + +# Remember Remember the 5th November for freedom of speech is not free!! +./hush-smart-chain -ac_name=DRAGONX -ac_algo=randomx -ac_halving=3500000 -ac_reward=300000000 -ac_blocktime=36 -ac_private=1 -addnode=$SEEDNODE $@ diff --git a/src/fs.cpp b/src/fs.cpp index baef9c2e2..17cccdf44 100644 --- a/src/fs.cpp +++ b/src/fs.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers #include "fs.h" namespace fsbridge { diff --git a/src/fs.h b/src/fs.h index ba5b16a05..c7c205292 100644 --- a/src/fs.h +++ b/src/fs.h @@ -1,5 +1,5 @@ // Copyright (c) 2017 The Bitcoin Core developers -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/src/gtest/json_test_vectors.cpp b/src/gtest/json_test_vectors.cpp index 73a28c422..5999597a2 100644 --- a/src/gtest/json_test_vectors.cpp +++ b/src/gtest/json_test_vectors.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html #include "json_test_vectors.h" diff --git a/src/gtest/json_test_vectors.h b/src/gtest/json_test_vectors.h index 82b7fda66..74f9faddf 100644 --- a/src/gtest/json_test_vectors.h +++ b/src/gtest/json_test_vectors.h @@ -1,9 +1,9 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html #include -#include "utilstrencodings.h" +#include "util/strencodings.h" #include "version.h" #include "serialize.h" #include "streams.h" diff --git a/src/gtest/main.cpp b/src/gtest/main.cpp index e7340cecf..c7d67b111 100644 --- a/src/gtest/main.cpp +++ b/src/gtest/main.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html #include "gmock/gmock.h" diff --git a/src/gtest/test_block.cpp b/src/gtest/test_block.cpp index b19687e96..e50b85949 100644 --- a/src/gtest/test_block.cpp +++ b/src/gtest/test_block.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html #include diff --git a/src/gtest/test_checkblock.cpp b/src/gtest/test_checkblock.cpp index 306ab6e6a..9d1c21f7e 100644 --- a/src/gtest/test_checkblock.cpp +++ b/src/gtest/test_checkblock.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html #include diff --git a/src/gtest/test_checktransaction.cpp b/src/gtest/test_checktransaction.cpp index 7bdfb10e0..164b4868f 100644 --- a/src/gtest/test_checktransaction.cpp +++ b/src/gtest/test_checktransaction.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html #include diff --git a/src/gtest/test_deprecation.cpp b/src/gtest/test_deprecation.cpp index af546b860..454afe40c 100644 --- a/src/gtest/test_deprecation.cpp +++ b/src/gtest/test_deprecation.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // Released under the GPLv3 @@ -11,7 +11,7 @@ #include "init.h" #include "ui_interface.h" #include "util.h" -#include "utilstrencodings.h" +#include "util/strencodings.h" #include #include diff --git a/src/gtest/test_equihash.cpp b/src/gtest/test_equihash.cpp index 47d6db175..d4c5b4486 100644 --- a/src/gtest/test_equihash.cpp +++ b/src/gtest/test_equihash.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html #if defined(HAVE_CONFIG_H) diff --git a/src/gtest/test_httprpc.cpp b/src/gtest/test_httprpc.cpp index 0dc27975e..e84375311 100644 --- a/src/gtest/test_httprpc.cpp +++ b/src/gtest/test_httprpc.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html #include diff --git a/src/gtest/test_keys.cpp b/src/gtest/test_keys.cpp index ca18ddf79..6ac2960a7 100644 --- a/src/gtest/test_keys.cpp +++ b/src/gtest/test_keys.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html #include diff --git a/src/gtest/test_keystore.cpp b/src/gtest/test_keystore.cpp index 80a1200f3..8fe0e28f9 100644 --- a/src/gtest/test_keystore.cpp +++ b/src/gtest/test_keystore.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html #include diff --git a/src/gtest/test_libzcash_utils.cpp b/src/gtest/test_libzcash_utils.cpp index a0dc21e2d..12ff81571 100644 --- a/src/gtest/test_libzcash_utils.cpp +++ b/src/gtest/test_libzcash_utils.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html #include diff --git a/src/gtest/test_mempool.cpp b/src/gtest/test_mempool.cpp index ea6bcf52b..171536542 100644 --- a/src/gtest/test_mempool.cpp +++ b/src/gtest/test_mempool.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html #include diff --git a/src/gtest/test_merkletree.cpp b/src/gtest/test_merkletree.cpp index 224d69a3e..bedbfa9b0 100644 --- a/src/gtest/test_merkletree.cpp +++ b/src/gtest/test_merkletree.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html #include @@ -19,7 +19,7 @@ #include -#include "utilstrencodings.h" +#include "util/strencodings.h" #include "version.h" #include "serialize.h" #include "streams.h" diff --git a/src/gtest/test_metrics.cpp b/src/gtest/test_metrics.cpp index 84f027cb9..0a4bd9303 100644 --- a/src/gtest/test_metrics.cpp +++ b/src/gtest/test_metrics.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html #include diff --git a/src/gtest/test_miner.cpp b/src/gtest/test_miner.cpp index 9f2362b91..3578d2de3 100644 --- a/src/gtest/test_miner.cpp +++ b/src/gtest/test_miner.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html #include diff --git a/src/gtest/test_noteencryption.cpp b/src/gtest/test_noteencryption.cpp index 96a0a2d5c..3ae4d4c05 100644 --- a/src/gtest/test_noteencryption.cpp +++ b/src/gtest/test_noteencryption.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html #include diff --git a/src/gtest/test_pedersen_hash.cpp b/src/gtest/test_pedersen_hash.cpp index d5d43c0ae..21d9c4008 100644 --- a/src/gtest/test_pedersen_hash.cpp +++ b/src/gtest/test_pedersen_hash.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html #include diff --git a/src/gtest/test_pow.cpp b/src/gtest/test_pow.cpp index 10b0211af..37d152fd0 100644 --- a/src/gtest/test_pow.cpp +++ b/src/gtest/test_pow.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html #include diff --git a/src/gtest/test_random.cpp b/src/gtest/test_random.cpp index 6622ae082..446e943bc 100644 --- a/src/gtest/test_random.cpp +++ b/src/gtest/test_random.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html #include diff --git a/src/gtest/test_rpc.cpp b/src/gtest/test_rpc.cpp index c64b7604c..245509da0 100644 --- a/src/gtest/test_rpc.cpp +++ b/src/gtest/test_rpc.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html #include @@ -10,7 +10,7 @@ #include "primitives/block.h" #include "rpc/server.h" #include "streams.h" -#include "utilstrencodings.h" +#include "util/strencodings.h" extern UniValue blockToJSON(const CBlock& block, const CBlockIndex* blockindex, bool txDetails = false); diff --git a/src/gtest/test_sapling_note.cpp b/src/gtest/test_sapling_note.cpp index d157d9f9f..44a95d985 100644 --- a/src/gtest/test_sapling_note.cpp +++ b/src/gtest/test_sapling_note.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html #include diff --git a/src/gtest/test_tautology.cpp b/src/gtest/test_tautology.cpp index 44daccdc4..b2be7bc03 100644 --- a/src/gtest/test_tautology.cpp +++ b/src/gtest/test_tautology.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html #include diff --git a/src/gtest/test_transaction_builder.cpp b/src/gtest/test_transaction_builder.cpp index 9e4fae718..6644f9bfc 100644 --- a/src/gtest/test_transaction_builder.cpp +++ b/src/gtest/test_transaction_builder.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html #include "chainparams.h" diff --git a/src/gtest/test_txid.cpp b/src/gtest/test_txid.cpp index 6cf5dbd6c..20caedb54 100644 --- a/src/gtest/test_txid.cpp +++ b/src/gtest/test_txid.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html #include @@ -8,7 +8,7 @@ #include "streams.h" #include "uint256.h" #include "util.h" -#include "utilstrencodings.h" +#include "util/strencodings.h" /* Test that removing #1144 succeeded by verifying the hash of a transaction is over the entire serialized form. diff --git a/src/gtest/test_upgrades.cpp b/src/gtest/test_upgrades.cpp index d8e26f0dd..6a5a940dd 100644 --- a/src/gtest/test_upgrades.cpp +++ b/src/gtest/test_upgrades.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html #include diff --git a/src/gtest/test_validation.cpp b/src/gtest/test_validation.cpp index 41e394d4f..54832e5a1 100644 --- a/src/gtest/test_validation.cpp +++ b/src/gtest/test_validation.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html #include diff --git a/src/gtest/test_zip32.cpp b/src/gtest/test_zip32.cpp index 4391c7592..fa3e5d551 100644 --- a/src/gtest/test_zip32.cpp +++ b/src/gtest/test_zip32.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html #include diff --git a/src/gtest/utils.cpp b/src/gtest/utils.cpp index ed284ae12..24c97893e 100644 --- a/src/gtest/utils.cpp +++ b/src/gtest/utils.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html int GenZero(int n) diff --git a/src/hash.cpp b/src/hash.cpp index 529940270..336975827 100644 --- a/src/hash.cpp +++ b/src/hash.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2013-2014 The Bitcoin Core developers -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/src/hash.h b/src/hash.h index a37c00a1d..be26686e3 100644 --- a/src/hash.h +++ b/src/hash.h @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2013 The Bitcoin Core developers -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html @@ -28,9 +28,7 @@ #include "serialize.h" #include "uint256.h" #include "version.h" - #include "sodium.h" - #include typedef uint256 ChainCode; @@ -48,6 +46,18 @@ public: sha.Reset().Write(buf, sha.OUTPUT_SIZE).Finalize(hash); } + CHash256& Write(Span input) { + sha.Write(input.data(), input.size()); + return *this; + } + + void Finalize(Span output) { + assert(output.size() == OUTPUT_SIZE); + unsigned char buf[CSHA256::OUTPUT_SIZE]; + sha.Finalize(buf); + sha.Reset().Write(buf, CSHA256::OUTPUT_SIZE).Finalize(output.data()); + } + CHash256& Write(const unsigned char *data, size_t len) { sha.Write(data, len); return *this; @@ -120,6 +130,23 @@ inline uint256 Hash(const T1 p1begin, const T1 p1end, return result; } +/** Compute the 256-bit hash of an object. */ +template +inline uint256 Hash(const T& in1) +{ + uint256 result; + CHash256().Write(MakeUCharSpan(in1)).Finalize(result); + return result; +} + +/** Compute the 256-bit hash of the concatenation of two objects. */ +template +inline uint256 Hash(const T1& in1, const T2& in2) { + uint256 result; + CHash256().Write(MakeUCharSpan(in1)).Write(MakeUCharSpan(in2)).Finalize(result); + return result; +} + /** Compute the 160-bit hash an object. */ template inline uint160 Hash160(const T1 pbegin, const T1 pend) @@ -178,6 +205,40 @@ public: } }; +/** Reads data from an underlying stream, while hashing the read data. */ +template +class CHashVerifier : public CHashWriter +{ +private: + Source* source; + +public: + explicit CHashVerifier(Source* source_) : CHashWriter(source_->GetType(), source_->GetVersion()), source(source_) {} + + void read(char* pch, size_t nSize) + { + source->read(pch, nSize); + this->write(pch, nSize); + } + + void ignore(size_t nSize) + { + char data[1024]; + while (nSize > 0) { + size_t now = std::min(nSize, 1024); + read(data, now); + nSize -= now; + } + } + + template + CHashVerifier& operator>>(T&& obj) + { + // Unserialize from this stream + ::Unserialize(*this, obj); + return (*this); + } +}; /** A writer stream (for serialization) that computes a 256-bit BLAKE2b hash. */ class CBLAKE2bWriter @@ -221,6 +282,7 @@ public: } }; + /** Compute the 256-bit hash of an object's serialization. */ template uint256 SerializeHash(const T& obj, int nType=SER_GETHASH, int nVersion=PROTOCOL_VERSION) @@ -230,6 +292,7 @@ uint256 SerializeHash(const T& obj, int nType=SER_GETHASH, int nVersion=PROTOCOL return ss.GetHash(); } + unsigned int MurmurHash3(unsigned int nHashSeed, const std::vector& vDataToHash); void BIP32Hash(const ChainCode &chainCode, unsigned int nChild, unsigned char header, const unsigned char data[32], unsigned char output[64]); diff --git a/src/httprpc.cpp b/src/httprpc.cpp index 5b70c3215..1ef126784 100644 --- a/src/httprpc.cpp +++ b/src/httprpc.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** @@ -24,7 +24,7 @@ #include "random.h" #include "sync.h" #include "util.h" -#include "utilstrencodings.h" +#include "util/strencodings.h" #include "ui_interface.h" #include // boost::trim diff --git a/src/httprpc.h b/src/httprpc.h index ef3a7243b..5ea70cb61 100644 --- a/src/httprpc.h +++ b/src/httprpc.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Copyright (c) 2015 The Bitcoin Core developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/src/httpserver.cpp b/src/httpserver.cpp index 2f9761a93..59e35ddc9 100644 --- a/src/httpserver.cpp +++ b/src/httpserver.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2015 The Bitcoin Core developers -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html @@ -7,11 +7,13 @@ #include "chainparamsbase.h" #include "compat.h" #include "util.h" +#include "util/strencodings.h" #include "netbase.h" #include "rpc/protocol.h" // For HTTP status codes #include "sync.h" #include "ui_interface.h" -#include "utilstrencodings.h" +#include "util/strencodings.h" + #include #include #include @@ -22,6 +24,7 @@ #include #include #include +#include #include #include @@ -157,6 +160,7 @@ public: boost::unique_lock lock(cs); return queue.size(); } + size_t MaxDepth() { boost::unique_lock lock(cs); @@ -167,6 +171,7 @@ public: boost::unique_lock lock(cs); return numThreads; } + }; struct HTTPPathHandler @@ -196,7 +201,6 @@ std::vector pathHandlers; //! Bound listening sockets std::vector boundSockets; - int getWorkQueueDepth() { return workQueue->Depth(); @@ -227,12 +231,17 @@ static bool ClientAllowed(const CNetAddr& netaddr) static bool InitHTTPAllowList() { rpc_allow_subnets.clear(); - rpc_allow_subnets.push_back(CSubNet("127.0.0.0/8")); // always allow IPv4 local subnet - rpc_allow_subnets.push_back(CSubNet("::1")); // always allow IPv6 localhost + CNetAddr localv4; + CNetAddr localv6; + LookupHost("127.0.0.1", localv4, false); + LookupHost("::1", localv6, false); + rpc_allow_subnets.push_back(CSubNet(localv4, 8)); // always allow IPv4 local subnet + rpc_allow_subnets.push_back(CSubNet(localv6)); // always allow IPv6 localhost if (mapMultiArgs.count("-rpcallowip")) { const std::vector& vAllow = mapMultiArgs["-rpcallowip"]; BOOST_FOREACH (std::string strAllow, vAllow) { - CSubNet subnet(strAllow); + CSubNet subnet; + LookupSubNet(strAllow.c_str(), subnet); if (!subnet.IsValid()) { uiInterface.ThreadSafeMessageBox( strprintf("Invalid -rpcallowip subnet specification: %s. Valid are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24).", strAllow), @@ -273,6 +282,16 @@ static std::string RequestMethodString(HTTPRequest::RequestMethod m) /** HTTP request callback */ static void http_request_cb(struct evhttp_request* req, void* arg) { + // Disable reading to work around a libevent bug, fixed in 2.2.0. + if (event_get_version_number() >= 0x02010600 && event_get_version_number() < 0x02020001) { + evhttp_connection* conn = evhttp_request_get_connection(req); + if (conn) { + bufferevent* bev = evhttp_connection_get_bufferevent(conn); + if (bev) { + bufferevent_disable(bev, EV_READ); + } + } + } std::unique_ptr hreq(new HTTPRequest(req)); // Early address-based allow check @@ -315,11 +334,10 @@ static void http_request_cb(struct evhttp_request* req, void* arg) if (i != iend) { std::unique_ptr item(new HTTPWorkItem(hreq.release(), path, i->handler)); assert(workQueue); - if (workQueue->Enqueue(item.get())) { + if (workQueue->Enqueue(item.get())) item.release(); /* if true, queue took ownership */ - } else { - item->req->WriteReply(HTTP_INTERNAL, strprintf("Work queue depth %d exceeded", workQueue->Depth() )); - } + else + item->req->WriteReply(HTTP_INTERNAL, "Work queue depth exceeded"); } else { hreq->WriteReply(HTTP_NOTFOUND); } @@ -541,7 +559,7 @@ struct event_base* EventBase() static void httpevent_callback_fn(evutil_socket_t, short, void* data) { // Static handler: simply call inner handler - HTTPEvent *self = ((HTTPEvent*)data); + HTTPEvent *self = static_cast(data); self->handler(); if (self->deleteWhenTriggered) delete self; @@ -628,8 +646,21 @@ void HTTPRequest::WriteReply(int nStatus, const std::string& strReply) struct evbuffer* evb = evhttp_request_get_output_buffer(req); assert(evb); evbuffer_add(evb, strReply.data(), strReply.size()); - HTTPEvent* ev = new HTTPEvent(eventBase, true, - boost::bind(evhttp_send_reply, req, nStatus, (const char*)NULL, (struct evbuffer *)NULL)); + auto req_copy = req; + HTTPEvent* ev = new HTTPEvent(eventBase, true, [req_copy, nStatus]{ + evhttp_send_reply(req_copy, nStatus, (const char*)NULL, (struct evbuffer *)NULL); + // Re-enable reading from the socket. This is the second part of the libevent + // workaround above. + if (event_get_version_number() >= 0x02010600 && event_get_version_number() < 0x02020001) { + evhttp_connection* conn = evhttp_request_get_connection(req_copy); + if (conn) { + bufferevent* bev = evhttp_connection_get_bufferevent(conn); + if (bev) { + bufferevent_enable(bev, EV_READ | EV_WRITE); + } + } + } + }); ev->trigger(0); replySent = true; req = 0; // transferred back to main thread @@ -644,7 +675,7 @@ CService HTTPRequest::GetPeer() const char* address = ""; uint16_t port = 0; evhttp_connection_get_peer(con, (char**)&address, &port); - peer = CService(address, port); + peer = LookupNumeric(address, port); } return peer; } diff --git a/src/httpserver.h b/src/httpserver.h index 8133c8d94..9bc0c05d6 100644 --- a/src/httpserver.h +++ b/src/httpserver.h @@ -1,5 +1,5 @@ // Copyright (c) 2015 The Bitcoin Core developers -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/src/hush-smart-chain b/src/hush-smart-chain index ae6a56a27..e6300c203 100755 --- a/src/hush-smart-chain +++ b/src/hush-smart-chain @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# Copyright (c) 2016-2022 The Hush developers +# Copyright (c) 2016-2023 The Hush developers # set working directory to the location of this script # readlink -f does not always exist DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" diff --git a/src/hush-smart-chain.bat b/src/hush-smart-chain.bat index 3499da74f..cd20f1a48 100644 --- a/src/hush-smart-chain.bat +++ b/src/hush-smart-chain.bat @@ -1,4 +1,4 @@ -:: Copyright (c) 2016-2022 The Hush developers +:: Copyright (c) 2016-2023 The Hush developers :: Distributed under the GPLv3 software license, see the accompanying :: file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html @call :GET_CURRENT_DIR diff --git a/src/hush-tx.cpp b/src/hush-tx.cpp index 6d3f2f94c..431821f15 100644 --- a/src/hush-tx.cpp +++ b/src/hush-tx.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2009-2014 The Bitcoin Core developers -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** @@ -29,7 +29,7 @@ #include #include "util.h" #include "utilmoneystr.h" -#include "utilstrencodings.h" +#include "util/strencodings.h" #include #include #include diff --git a/src/hush.h b/src/hush.h index 9ebcd2948..a9dbb5ec2 100644 --- a/src/hush.h +++ b/src/hush.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** @@ -504,7 +504,7 @@ void hush_stateupdate(int32_t height,uint8_t notarypubs[][33],uint8_t numnotarie int32_t hush_validate_chain(uint256 srchash,int32_t notarized_height) { - fprintf(stderr,"%s\n", __func__); + //fprintf(stderr,"%s\n", __func__); static int32_t last_rewind; int32_t rewindtarget; CBlockIndex *pindex; struct hush_state *sp; char symbol[HUSH_SMART_CHAIN_MAXLEN],dest[HUSH_SMART_CHAIN_MAXLEN]; if ( (sp= hush_stateptr(symbol,dest)) == 0 ) return(0); diff --git a/src/hush/tlsenums.h b/src/hush/tlsenums.h index 22427d656..67f8026ce 100644 --- a/src/hush/tlsenums.h +++ b/src/hush/tlsenums.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/src/hush/tlsmanager.cpp b/src/hush/tlsmanager.cpp index 8cc726917..e062540e7 100644 --- a/src/hush/tlsmanager.cpp +++ b/src/hush/tlsmanager.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html #include diff --git a/src/hush/tlsmanager.h b/src/hush/tlsmanager.h index ca934a278..5cd06b13c 100644 --- a/src/hush/tlsmanager.h +++ b/src/hush/tlsmanager.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html #include diff --git a/src/hush/utiltls.cpp b/src/hush/utiltls.cpp index f8fcd4636..0a76040b4 100644 --- a/src/hush/utiltls.cpp +++ b/src/hush/utiltls.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2017 The Zen Core developers -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/src/hush/utiltls.h b/src/hush/utiltls.h index c89045f8d..42d1fdb8c 100644 --- a/src/hush/utiltls.h +++ b/src/hush/utiltls.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Copyright (c) 2017 The Zen Core developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/src/hush_bitcoind.h b/src/hush_bitcoind.h index b8b5a463d..77ded63f8 100644 --- a/src/hush_bitcoind.h +++ b/src/hush_bitcoind.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush Developers +// Copyright (c) 2016-2023 The Hush Developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/hush_cJSON.c b/src/hush_cJSON.c index 1b996e881..225fb143d 100644 --- a/src/hush_cJSON.c +++ b/src/hush_cJSON.c @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers /* Copyright (c) 2009 Dave Gamble diff --git a/src/hush_cJSON.h b/src/hush_cJSON.h index ec4b85a91..d0c012361 100644 --- a/src/hush_cJSON.h +++ b/src/hush_cJSON.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /* diff --git a/src/hush_ccdata.h b/src/hush_ccdata.h index 0d6febbc9..7861ab478 100644 --- a/src/hush_ccdata.h +++ b/src/hush_ccdata.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/hush_curve25519.h b/src/hush_curve25519.h index fb8a86e65..a50c8ff28 100644 --- a/src/hush_curve25519.h +++ b/src/hush_curve25519.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/hush_defs.h b/src/hush_defs.h index 36354b909..8ae77797e 100644 --- a/src/hush_defs.h +++ b/src/hush_defs.h @@ -1,4 +1,4 @@ -// Copyright (c) 2019-2022 The Hush developers +// Copyright (c) 2019-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/hush_events.h b/src/hush_events.h index e5c804941..8be81c45a 100644 --- a/src/hush_events.h +++ b/src/hush_events.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/hush_gateway.h b/src/hush_gateway.h index 9c7952045..0002e69a9 100644 --- a/src/hush_gateway.h +++ b/src/hush_gateway.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/hush_globals.h b/src/hush_globals.h index e2b8d8e33..9bfb59302 100644 --- a/src/hush_globals.h +++ b/src/hush_globals.h @@ -1,4 +1,4 @@ -// Copyright 2016-2022 The Hush Developers +// Copyright 2016-2023 The Hush Developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/hush_kv.h b/src/hush_kv.h index 8d067b25a..e5f86cba4 100644 --- a/src/hush_kv.h +++ b/src/hush_kv.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/hush_nSPV.h b/src/hush_nSPV.h index 564f217e1..6d4af2455 100644 --- a/src/hush_nSPV.h +++ b/src/hush_nSPV.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/hush_nSPV_defs.h b/src/hush_nSPV_defs.h index a52e92500..fb64aa789 100644 --- a/src/hush_nSPV_defs.h +++ b/src/hush_nSPV_defs.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers /****************************************************************************** * Copyright © 2014-2019 The SuperNET Developers. * diff --git a/src/hush_nSPV_fullnode.h b/src/hush_nSPV_fullnode.h index 50e650073..48ae589d8 100644 --- a/src/hush_nSPV_fullnode.h +++ b/src/hush_nSPV_fullnode.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/hush_nSPV_superlite.h b/src/hush_nSPV_superlite.h index f9e02bcb8..84b6aa6cd 100644 --- a/src/hush_nSPV_superlite.h +++ b/src/hush_nSPV_superlite.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers /****************************************************************************** * Copyright © 2014-2019 The SuperNET Developers. * diff --git a/src/hush_nSPV_wallet.h b/src/hush_nSPV_wallet.h index 0053fbcde..da8038fb6 100644 --- a/src/hush_nSPV_wallet.h +++ b/src/hush_nSPV_wallet.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/hush_nk.h b/src/hush_nk.h index 3eb3ae98f..6cc1cbfe6 100644 --- a/src/hush_nk.h +++ b/src/hush_nk.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers #ifndef HUSH_NK_H #define HUSH_NK_H diff --git a/src/hush_notary.h b/src/hush_notary.h index 319ed0a05..8228a475b 100644 --- a/src/hush_notary.h +++ b/src/hush_notary.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/hush_pax.h b/src/hush_pax.h index 7cfb08750..9289ce15d 100644 --- a/src/hush_pax.h +++ b/src/hush_pax.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/hush_structs.h b/src/hush_structs.h index 5f1c22e38..c63b78e19 100644 --- a/src/hush_structs.h +++ b/src/hush_structs.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/hush_utils.h b/src/hush_utils.h index ae19fce95..07cac8b08 100644 --- a/src/hush_utils.h +++ b/src/hush_utils.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/i2p.cpp b/src/i2p.cpp new file mode 100644 index 000000000..2a4b29d93 --- /dev/null +++ b/src/i2p.cpp @@ -0,0 +1,441 @@ +// Copyright (c) 2020-2020 The Bitcoin Core developers +// Copyright (c) 2016-2023 The Hush developers +// Distributed under the GPLv3 software license, see the accompanying +// file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +namespace i2p { + +/** + * Swap Standard Base64 <-> I2P Base64. + * Standard Base64 uses `+` and `/` as last two characters of its alphabet. + * I2P Base64 uses `-` and `~` respectively. + * So it is easy to detect in which one is the input and convert to the other. + * @param[in] from Input to convert. + * @return converted `from` + */ +static std::string SwapBase64(const std::string& from) +{ + std::string to; + to.resize(from.size()); + for (size_t i = 0; i < from.size(); ++i) { + switch (from[i]) { + case '-': + to[i] = '+'; + break; + case '~': + to[i] = '/'; + break; + case '+': + to[i] = '-'; + break; + case '/': + to[i] = '~'; + break; + default: + to[i] = from[i]; + break; + } + } + return to; +} + +/** + * Decode an I2P-style Base64 string. + * @param[in] i2p_b64 I2P-style Base64 string. + * @return decoded `i2p_b64` + * @throw std::runtime_error if decoding fails + */ +static Binary DecodeI2PBase64(const std::string& i2p_b64) +{ + const std::string& std_b64 = SwapBase64(i2p_b64); + bool invalid; + Binary decoded = DecodeBase64(std_b64.c_str(), &invalid); + if (invalid) { + throw std::runtime_error(strprintf("Cannot decode Base64: \"%s\"", i2p_b64)); + } + return decoded; +} + +/** + * Derive the .b32.i2p address of an I2P destination (binary). + * @param[in] dest I2P destination. + * @return the address that corresponds to `dest` + * @throw std::runtime_error if conversion fails + */ +static CNetAddr DestBinToAddr(const Binary& dest) +{ + CSHA256 hasher; + hasher.Write(dest.data(), dest.size()); + unsigned char hash[CSHA256::OUTPUT_SIZE]; + hasher.Finalize(hash); + + CNetAddr addr; + const std::string addr_str = EncodeBase32(hash, false) + ".b32.i2p"; + if (!addr.SetSpecial(addr_str)) { + throw std::runtime_error(strprintf("Cannot parse I2P address: \"%s\"", addr_str)); + } + + return addr; +} + +/** + * Derive the .b32.i2p address of an I2P destination (I2P-style Base64). + * @param[in] dest I2P destination. + * @return the address that corresponds to `dest` + * @throw std::runtime_error if conversion fails + */ +static CNetAddr DestB64ToAddr(const std::string& dest) +{ + const Binary& decoded = DecodeI2PBase64(dest); + return DestBinToAddr(decoded); +} + +namespace sam { + +Session::Session(const fs::path& private_key_file, + const CService& control_host) + : m_private_key_file(private_key_file), m_control_host(control_host), + m_control_sock(std::unique_ptr(new Sock(INVALID_SOCKET))) +{ +} + +Session::~Session() +{ +} + +bool Session::Check() +{ + try { + LOCK(cs_i2p); + CreateIfNotCreatedAlready(); + return true; + } catch (const std::runtime_error& e) { + LogPrint("i2p","I2P: Error Checking Session: %s\n", e.what()); + CheckControlSock(); + } + return false; +} + +bool Session::Listen(Connection& conn) +{ + try { + LOCK(cs_i2p); + CreateIfNotCreatedAlready(); + conn.me = m_my_addr; + conn.sock = StreamAccept(); + return true; + } catch (const std::runtime_error& e) { + LogPrint("i2p","I2P: Error listening: %s\n", e.what()); + CheckControlSock(); + } + return false; +} + +bool Session::Accept(Connection& conn) +{ + try { + while (true) { + + // boost::this_thread::interruption_point(); + if (ShutdownRequested()) { + Disconnect(); + return false; + } + + + Sock::Event occurred; + if (!conn.sock->Wait(std::chrono::milliseconds{MAX_WAIT_FOR_IO}, Sock::RECV, &occurred)) { + throw std::runtime_error("wait on socket failed"); + } + + if ((occurred & Sock::RECV) == 0) { + // Timeout, no incoming connections within MAX_WAIT_FOR_IO. + continue; + } + + const std::string& peer_dest = + conn.sock->RecvUntilTerminator('\n', std::chrono::milliseconds{MAX_WAIT_FOR_IO}, MAX_MSG_SIZE); + + if (ShutdownRequested()) { + Disconnect(); + return false; + } + + conn.peer = CService(DestB64ToAddr(peer_dest), Params().GetDefaultPort()); + return true; + } + } catch (const std::runtime_error& e) { + LogPrint("i2p","I2P: Error accepting: %s\n", e.what()); + CheckControlSock(); + } + return false; +} + +bool Session::Connect(const CService& to, Connection& conn, bool& proxy_error) +{ + proxy_error = true; + + std::string session_id; + std::unique_ptr sock; + conn.peer = to; + + try { + { + LOCK(cs_i2p); + CreateIfNotCreatedAlready(); + session_id = m_session_id; + conn.me = m_my_addr; + sock = Hello(); + } + + const Reply& lookup_reply = + SendRequestAndGetReply(*sock, strprintf("NAMING LOOKUP NAME=%s", to.ToStringIP())); + + const std::string& dest = lookup_reply.Get("VALUE"); + + const Reply& connect_reply = SendRequestAndGetReply( + *sock, strprintf("STREAM CONNECT ID=%s DESTINATION=%s SILENT=false", session_id, dest), + false); + + const std::string& result = connect_reply.Get("RESULT"); + + if (result == "OK") { + conn.sock = std::move(sock); + return true; + } + + if (result == "INVALID_ID") { + LOCK(cs_i2p); + Disconnect(); + throw std::runtime_error("Invalid session id"); + } + + if (result == "CANT_REACH_PEER" || result == "TIMEOUT" || "KEY_NOT_FOUND") { + proxy_error = false; + } + + throw std::runtime_error(strprintf("\"%s\"", connect_reply.full)); + } catch (const std::runtime_error& e) { + LogPrint("i2p","I2P: Error connecting to %s: %s\n", to.ToString(), e.what()); + CheckControlSock(); + return false; + } +} + +// Private methods + +std::string Session::Reply::Get(const std::string& key) const +{ + const auto& pos = keys.find(key); + if (pos == keys.end() || !pos->second.has_value()) { + throw std::runtime_error( + strprintf("Missing %s= in the reply to \"%s\": \"%s\"", key, request, full)); + } + return pos->second.value(); +} + +Session::Reply Session::SendRequestAndGetReply(const Sock& sock, + const std::string& request, + bool check_result_ok) const +{ + sock.SendComplete(request + "\n", std::chrono::milliseconds{MAX_WAIT_FOR_IO}); + + Reply reply; + + // Don't log the full "SESSION CREATE ..." because it contains our private key. + reply.request = request.substr(0, 14) == "SESSION CREATE" ? "SESSION CREATE ..." : request; + + // It could take a few minutes for the I2P router to reply as it is querying the I2P network + // (when doing name lookup, for example). + + reply.full = sock.RecvUntilTerminator('\n', std::chrono::minutes{3}, MAX_MSG_SIZE); + + for (const auto& kv : spanparsing::Split(reply.full, ' ')) { + const auto& pos = std::find(kv.begin(), kv.end(), '='); + if (pos != kv.end()) { + reply.keys.emplace(std::string{kv.begin(), pos}, std::string{pos + 1, kv.end()}); + } else { + reply.keys.emplace(std::string{kv.begin(), kv.end()}, boost::none); + } + } + + LogPrint("i2p","I2P: Handshake reply %s\n", reply.full); + + if (check_result_ok && reply.Get("RESULT") != "OK") { + if (!ShutdownRequested()) { + throw std::runtime_error(strprintf("Unexpected reply to \"%s\": \"%s\"", request, reply.full)); + } + } + + return reply; +} + +std::unique_ptr Session::Hello() const +{ + auto sock = CreateSock(m_control_host); + + if (!sock) { + throw std::runtime_error("Cannot create socket"); + } + + if (!ConnectSocketDirectly(m_control_host, *sock, nConnectTimeout)) { + throw std::runtime_error(strprintf("Cannot connect to %s", m_control_host.ToString())); + } + + SendRequestAndGetReply(*sock, "HELLO VERSION MIN=3.1 MAX=3.1"); + + return sock; +} + +void Session::CheckControlSock() +{ + LOCK(cs_i2p); + + std::string errmsg; + if (!m_control_sock->IsConnected(errmsg)) { + LogPrint("i2p","I2P: Control socket error: %s\n", errmsg); + Disconnect(); + } +} + +void Session::DestGenerate(const Sock& sock) +{ + // https://geti2p.net/spec/common-structures#key-certificates + // "7" or "EdDSA_SHA512_Ed25519" - "Recent Router Identities and Destinations". + // Use "7" because i2pd <2.24.0 does not recognize the textual form. + const Reply& reply = SendRequestAndGetReply(sock, "DEST GENERATE SIGNATURE_TYPE=7", false); + + m_private_key = DecodeI2PBase64(reply.Get("PRIV")); +} + +void Session::GenerateAndSavePrivateKey(const Sock& sock) +{ + DestGenerate(sock); + + // umask is set to 077 in init.cpp, which is ok (unless -sysperms is given) + if (!WriteBinaryFile(m_private_key_file, + std::string(m_private_key.begin(), m_private_key.end()))) { + throw std::runtime_error( + strprintf("Cannot save I2P private key to %s", m_private_key_file)); + } +} + +Binary Session::MyDestination() const +{ + // From https://geti2p.net/spec/common-structures#destination: + // "They are 387 bytes plus the certificate length specified at bytes 385-386, which may be + // non-zero" + static constexpr size_t DEST_LEN_BASE = 387; + static constexpr size_t CERT_LEN_POS = 385; + + uint16_t cert_len; + memcpy(&cert_len, &m_private_key.at(CERT_LEN_POS), sizeof(cert_len)); + cert_len = be16toh(cert_len); + + const size_t dest_len = DEST_LEN_BASE + cert_len; + + return Binary{m_private_key.begin(), m_private_key.begin() + dest_len}; +} + +void Session::CreateIfNotCreatedAlready() +{ + LOCK(cs_i2p); + + std::string errmsg; + if (m_control_sock->IsConnected(errmsg)) { + return; + } + + LogPrint("i2p","I2P: Creating SAM session with %s\n", m_control_host.ToString()); + + auto sock = Hello(); + + const std::pair i2pRead = ReadBinaryFile(m_private_key_file); + if (i2pRead.first) { + m_private_key.assign(i2pRead.second.begin(), i2pRead.second.end()); + } else { + GenerateAndSavePrivateKey(*sock); + } + + const std::string& session_id = GetRandHash().GetHex().substr(0, 10); // full is an overkill, too verbose in the logs + const std::string& private_key_b64 = SwapBase64(EncodeBase64(m_private_key)); + + SendRequestAndGetReply(*sock, strprintf("SESSION CREATE STYLE=STREAM ID=%s DESTINATION=%s", + session_id, private_key_b64)); + + m_my_addr = CService(DestBinToAddr(MyDestination()), Params().GetDefaultPort()); + m_session_id = session_id; + m_control_sock = std::move(sock); + + LogPrint("i2p","I2P: SAM session created: session id=%s, my address=%s\n", m_session_id, + m_my_addr.ToString()); +} + +std::unique_ptr Session::StreamAccept() +{ + auto sock = Hello(); + + const Reply& reply = SendRequestAndGetReply( + *sock, strprintf("STREAM ACCEPT ID=%s SILENT=false", m_session_id), false); + + const std::string& result = reply.Get("RESULT"); + + if (result == "OK") { + return sock; + } + + if (result == "INVALID_ID") { + // If our session id is invalid, then force session re-creation on next usage. + Disconnect(); + } + + throw std::runtime_error(strprintf("\"%s\"", reply.full)); +} + +void Session::Disconnect() +{ + LOCK(cs_i2p); + try + { + if (m_control_sock->Get() != INVALID_SOCKET) { + if (m_session_id.empty()) { + LogPrint("i2p","I2P: Destroying incomplete session\n"); + } else { + LogPrint("i2p","I2P: Destroying session %s\n", m_session_id); + } + } + m_control_sock->Reset(); + m_session_id.clear(); + } + catch(std::bad_alloc&) + { + // when the node is shutting down, the call above might use invalid memory resulting in a + // std::bad_alloc exception when instantiating internal objs for handling log category + LogPrintf("(node is probably shutting down) Destroying session=%d\n", m_session_id); + } + + +} +} // namespace sam +} // namespace i2p diff --git a/src/i2p.h b/src/i2p.h new file mode 100644 index 000000000..c67971f21 --- /dev/null +++ b/src/i2p.h @@ -0,0 +1,256 @@ +// Copyright (c) 2020-2020 The Bitcoin Core developers +// Copyright (c) 2016-2023 The Hush developers +// Distributed under the GPLv3 software license, see the accompanying +// file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html + +#ifndef HUSH_I2P_H +#define HUSH_I2P_H + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +namespace i2p { + +/** + * Binary data. + */ +using Binary = std::vector; + +/** + * An established connection with another peer. + */ +struct Connection { + /** Connected socket. */ + std::unique_ptr sock; + + /** Our I2P address. */ + CService me; + + /** The peer's I2P address. */ + CService peer; +}; + +namespace sam { + +/** + * The maximum size of an incoming message from the I2P SAM proxy (in bytes). + * Used to avoid a runaway proxy from sending us an "unlimited" amount of data without a terminator. + * The longest known message is ~1400 bytes, so this is high enough not to be triggered during + * normal operation, yet low enough to avoid a malicious proxy from filling our memory. + */ +static constexpr size_t MAX_MSG_SIZE{65536}; + +/** + * I2P SAM session. + */ +class Session +{ +public: + /** + * Construct a session. This will not initiate any IO, the session will be lazily created + * later when first used. + * @param[in] private_key_file Path to a private key file. If the file does not exist then the + * private key will be generated and saved into the file. + * @param[in] control_host Location of the SAM proxy. + */ + Session(const fs::path& private_key_file, + const CService& control_host); + + /** + * Destroy the session, closing the internally used sockets. The sockets that have been + * returned by `Accept()` or `Connect()` will not be closed, but they will be closed by + * the SAM proxy because the session is destroyed. So they will return an error next time + * we try to read or write to them. + */ + ~Session(); + + /** + * Check the control sock and restart if needed + */ + bool Check(); + + /** + * Start listening for an incoming connection. + * @param[out] conn Upon successful completion the `sock` and `me` members will be set + * to the listening socket and address. + * @return true on success + */ + bool Listen(Connection& conn); + + /** + * Wait for and accept a new incoming connection. + * @param[in,out] conn The `sock` member is used for waiting and accepting. Upon successful + * completion the `peer` member will be set to the address of the incoming peer. + * @return true on success + */ + bool Accept(Connection& conn); + + /** + * Connect to an I2P peer. + * @param[in] to Peer to connect to. + * @param[out] conn Established connection. Only set if `true` is returned. + * @param[out] proxy_error If an error occurs due to proxy or general network failure, then + * this is set to `true`. If an error occurs due to unreachable peer (likely peer is down), then + * it is set to `false`. Only set if `false` is returned. + * @return true on success + */ + bool Connect(const CService& to, Connection& conn, bool& proxy_error); + +protected: + + CCriticalSection cs_i2p; + +private: + /** + * A reply from the SAM proxy. + */ + struct Reply { + /** + * Full, unparsed reply. + */ + std::string full; + + /** + * Request, used for detailed error reporting. + */ + std::string request; + + /** + * A map of keywords from the parsed reply. + * For example, if the reply is "A=X B C=YZ", then the map will be + * keys["A"] == "X" + * keys["B"] == (empty std::optional) + * keys["C"] == "YZ" + */ + std::unordered_map> keys; + + /** + * Get the value of a given key. + * For example if the reply is "A=X B" then: + * Value("A") -> "X" + * Value("B") -> throws + * Value("C") -> throws + * @param[in] key Key whose value to retrieve + * @returns the key's value + * @throws std::runtime_error if the key is not present or if it has no value + */ + std::string Get(const std::string& key) const; + }; + + /** + * Send request and get a reply from the SAM proxy. + * @param[in] sock A socket that is connected to the SAM proxy. + * @param[in] request Raw request to send, a newline terminator is appended to it. + * @param[in] check_result_ok If true then after receiving the reply a check is made + * whether it contains "RESULT=OK" and an exception is thrown if it does not. + * @throws std::runtime_error if an error occurs + */ + Reply SendRequestAndGetReply(const Sock& sock, + const std::string& request, + bool check_result_ok = true) const; + + /** + * Open a new connection to the SAM proxy. + * @return a connected socket + * @throws std::runtime_error if an error occurs + */ + std::unique_ptr Hello() const EXCLUSIVE_LOCKS_REQUIRED(cs_i2p); + + /** + * Check the control socket for errors and possibly disconnect. + */ + void CheckControlSock(); + + /** + * Generate a new destination with the SAM proxy and set `m_private_key` to it. + * @param[in] sock Socket to use for talking to the SAM proxy. + * @throws std::runtime_error if an error occurs + */ + void DestGenerate(const Sock& sock) EXCLUSIVE_LOCKS_REQUIRED(cs_i2p); + + /** + * Generate a new destination with the SAM proxy, set `m_private_key` to it and save + * it on disk to `m_private_key_file`. + * @param[in] sock Socket to use for talking to the SAM proxy. + * @throws std::runtime_error if an error occurs + */ + void GenerateAndSavePrivateKey(const Sock& sock) EXCLUSIVE_LOCKS_REQUIRED(cs_i2p); + + /** + * Derive own destination from `m_private_key`. + * @see https://geti2p.net/spec/common-structures#destination + * @return an I2P destination + */ + Binary MyDestination() const EXCLUSIVE_LOCKS_REQUIRED(cs_i2p); + + /** + * Create the session if not already created. Reads the private key file and connects to the + * SAM proxy. + * @throws std::runtime_error if an error occurs + */ + void CreateIfNotCreatedAlready() EXCLUSIVE_LOCKS_REQUIRED(cs_i2p); + + /** + * Open a new connection to the SAM proxy and issue "STREAM ACCEPT" request using the existing + * session id. + * @return the idle socket that is waiting for a peer to connect to us + * @throws std::runtime_error if an error occurs + */ + std::unique_ptr StreamAccept() EXCLUSIVE_LOCKS_REQUIRED(cs_i2p); + + /** + * Destroy the session, closing the internally used sockets. + */ + void Disconnect() EXCLUSIVE_LOCKS_REQUIRED(cs_i2p); + + /** + * The name of the file where this peer's private key is stored (in binary). + */ + const fs::path m_private_key_file; + + /** + * The host and port of the SAM control service. + */ + const CService m_control_host; + + /** + * The private key of this peer. + * @see The reply to the "DEST GENERATE" command in https://geti2p.net/en/docs/api/samv3 + */ + Binary m_private_key GUARDED_BY(cs_i2p); + + /** + * SAM control socket. + * Used to connect to the I2P SAM service and create a session + * ("SESSION CREATE"). With the established session id we later open + * other connections to the SAM service to accept incoming I2P + * connections and make outgoing ones. + * See https://geti2p.net/en/docs/api/samv3 + */ + std::unique_ptr m_control_sock GUARDED_BY(cs_i2p); + + /** + * Our .b32.i2p address. + * Derived from `m_private_key`. + */ + CService m_my_addr GUARDED_BY(cs_i2p); + + /** + * SAM session id. + */ + std::string m_session_id GUARDED_BY(cs_i2p); +}; + +} // namespace sam +} // namespace i2p + +#endif /* HUSH_I2P_H */ diff --git a/src/importcoin.cpp b/src/importcoin.cpp index 0f14d5654..88e711e92 100644 --- a/src/importcoin.cpp +++ b/src/importcoin.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/importcoin.h b/src/importcoin.h index 01f43bf57..121ddd3cd 100644 --- a/src/importcoin.h +++ b/src/importcoin.h @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html /****************************************************************************** diff --git a/src/init.cpp b/src/init.cpp index 9c9f36329..3e5e85337 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin Core developers -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html // What happened to the SuperNET devs, who were dedicated to privacy??? @@ -87,7 +87,6 @@ using namespace std; #include "hush_defs.h" static const bool DEFAULT_STRATUM_ENABLE = false; -extern void ThreadSendAlert(); extern bool hush_dailysnapshot(int32_t height); extern int32_t HUSH_LOADINGBLOCKS; extern char SMART_CHAIN_SYMBOL[]; @@ -247,14 +246,22 @@ void Shutdown() if (pcoinsTip != NULL) { FlushStateToDisk(); } - delete pcoinsTip; - pcoinsTip = NULL; - delete pcoinscatcher; - pcoinscatcher = NULL; - delete pcoinsdbview; - pcoinsdbview = NULL; - delete pblocktree; - pblocktree = NULL; + if (pcoinsTip != NULL) { + delete pcoinsTip; + pcoinsTip = NULL; + } + if (pcoinscatcher != NULL) { + delete pcoinscatcher; + pcoinscatcher = NULL; + } + if (pcoinsdbview != NULL) { + delete pcoinsdbview; + pcoinsdbview = NULL; + } + if (pblocktree != NULL) { + delete pblocktree; + pblocktree = NULL; + } } #ifdef ENABLE_WALLET if (pwalletMain) @@ -275,7 +282,7 @@ void Shutdown() #endif globalVerifyHandle.reset(); ECC_Stop(); - CNode::NetCleanup(); + // CNode::NetCleanup(); LogPrintf("%s: done\n", __func__); } @@ -326,7 +333,7 @@ bool static InitWarning(const std::string &str) } bool static Bind(const CService &addr, unsigned int flags) { - if (!(flags & BF_EXPLICIT) && IsLimited(addr)) + if (!(flags & BF_EXPLICIT) && !IsReachable(addr)) return false; std::string strError; if (!BindListenPort(addr, strError, (flags & BF_ALLOWLIST) != 0)) { @@ -361,7 +368,6 @@ std::string HelpMessage(HelpMessageMode mode) string strUsage = HelpMessageGroup(_("Options:")); strUsage += HelpMessageOpt("-?", _("This help message")); - strUsage += HelpMessageOpt("-alertnotify=", _("Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)")); strUsage += HelpMessageOpt("-blocknotify=", _("Execute command when the best block changes (%s in cmd is replaced by block hash)")); strUsage += HelpMessageOpt("-checkblocks=", strprintf(_("How many blocks to check at startup (default: %u, 0 = all)"), 288)); strUsage += HelpMessageOpt("-checklevel=", strprintf(_("How thorough the block verification of -checkblocks is (0-4, default: %u)"), 3)); @@ -377,7 +383,9 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += HelpMessageOpt("-exportdir=", _("Specify directory to be used when exporting data")); strUsage += HelpMessageOpt("-dbcache=", strprintf(_("Set database cache size in megabytes (%d to %d, default: %d)"), nMinDbCache, nMaxDbCache, nDefaultDbCache)); strUsage += HelpMessageOpt("-loadblock=", _("Imports blocks from external blk000??.dat file") + " " + _("on startup")); + strUsage += HelpMessageOpt("-maxdebugfilesize=", strprintf(_("Set the max size of the debug.log file (default: %u)"), 15)); strUsage += HelpMessageOpt("-maxorphantx=", strprintf(_("Keep at most unconnectable transactions in memory (default: %u)"), DEFAULT_MAX_ORPHAN_TRANSACTIONS)); + strUsage += HelpMessageOpt("-maxreorg=", _("Specify the maximum length of a blockchain re-organization")); strUsage += HelpMessageOpt("-mempooltxinputlimit=", _("[DEPRECATED/IGNORED] Set the maximum number of transparent inputs in a transaction that the mempool will accept (default: 0 = no limit applied)")); strUsage += HelpMessageOpt("-par=", strprintf(_("Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d)"), -(int)boost::thread::hardware_concurrency(), MAX_SCRIPTCHECK_THREADS, DEFAULT_SCRIPTCHECK_THREADS)); @@ -416,7 +424,14 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += HelpMessageOpt("-maxreceivebuffer=", strprintf(_("Maximum per-connection receive buffer, *1000 bytes (default: %u)"), 5000)); strUsage += HelpMessageOpt("-maxsendbuffer=", strprintf(_("Maximum per-connection send buffer, *1000 bytes (default: %u)"), 1000)); strUsage += HelpMessageOpt("-onion=", strprintf(_("Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s)"), "-proxy")); - strUsage += HelpMessageOpt("-onlynet=", _("Only connect to nodes in network (ipv4, ipv6 or onion)")); + strUsage += HelpMessageOpt("-nspv_msg", strprintf(_("Enable NSPV messages processing (default: true when -ac_private=1, otherwise false)"))); + + strUsage += HelpMessageOpt("-i2psam=", strprintf(_("I2P SAM proxy to reach I2P peers and accept I2P connections (default: none)"))); + strUsage += HelpMessageOpt("-i2pacceptincoming", strprintf(_("If set and -i2psam is also set then incoming I2P connections are accepted via the SAM proxy. If this is not set but -i2psam is set then only outgoing connections will be made to the I2P network. Ignored if -i2psam is not set. Listening for incoming I2P connections is done through the SAM proxy, not by binding to a local address and port (default: 1)"))); + strUsage += HelpMessageOpt("-onlynet=", _("Only connect to nodes in network (ipv4, ipv6, onion or i2p)")); + strUsage += HelpMessageOpt("-disableipv4", _("Disable Ipv4 network connections") + " " + _("(default: 0)")); + strUsage += HelpMessageOpt("-disableipv6", _("Disable Ipv6 network connections") + " " + _("(default: 0)")); + strUsage += HelpMessageOpt("-permitbaremultisig", strprintf(_("Relay non-P2SH multisig (default: %u)"), 1)); strUsage += HelpMessageOpt("-peerbloomfilters", strprintf(_("Support filtering of blocks and transaction with Bloom filters (default: %u)"), 1)); if (showDebug) @@ -499,7 +514,7 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += HelpMessageOpt("-stopafterblockimport", strprintf("Stop running after importing blocks from disk (default: %u)", 0)); strUsage += HelpMessageOpt("-nuparams=hexBranchId:activationHeight", "Use given activation height for specified network upgrade (regtest-only)"); } - string debugCategories = "addrman, alert, bench, coindb, db, deletetx, estimatefee, http, libevent, lock, mempool, net, tls, partitioncheck, pow, proxy, prune, rand, randomx, reindex, rpc, selectcoins, stratum, tor, zrpc, zrpcunsafe (implies zrpc)"; // Don't translate these + string debugCategories = "addrman, bench, coindb, db, deletetx, estimatefee, http, libevent, lock, mempool, net, tls, partitioncheck, pow, proxy, prune, rand, randomx, reindex, rpc, selectcoins, stratum, tor, zrpc, zrpcunsafe (implies zrpc)"; // Don't translate these strUsage += HelpMessageOpt("-debug=", strprintf(_("Output debugging information (default: %u, supplying is optional)"), 0) + ". " + _("If is not supplied or if = 1, output all debugging information.") + " " + _(" can be:") + " " + debugCategories + "."); strUsage += HelpMessageOpt("-experimentalfeatures", _("Enable use of experimental features")); @@ -602,10 +617,12 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += HelpMessageOpt("-ac_private", _("Shielded transactions only (except coinbase + notaries), default is 0")); strUsage += HelpMessageOpt("-ac_pubkey", _("Public key for receiving payments on the network")); strUsage += HelpMessageOpt("-ac_public", _("Transparent transactions only, default 0")); + strUsage += HelpMessageOpt("-ac_randomx_interval", _("Controls how often the RandomX key block will change, default is 1024")); + strUsage += HelpMessageOpt("-ac_randomx_lag", _("Sets the number of RandomX blocks to wait before updating the key block, default is 64")); strUsage += HelpMessageOpt("-ac_reward", _("Block reward in satoshis, default is 0")); strUsage += HelpMessageOpt("-ac_sapling", _("Sapling activation block height")); strUsage += HelpMessageOpt("-ac_script", _("P2SH/multisig address to receive founders rewards")); - strUsage += HelpMessageOpt("-ac_supply", _("Starting supply, default is 0")); + strUsage += HelpMessageOpt("-ac_supply", _("Starting supply, default is 10")); strUsage += HelpMessageOpt("-ac_txpow", _("Enforce transaction-rate limit, default 0")); return strUsage; @@ -1135,9 +1152,16 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) if(fs::exists(asmap_path)) { printf("%s: found asmap file at %s\n", __func__, asmap_path.c_str() ); } else { - // Shit is fucked up, die an honorable death - InitError(strprintf(_("Could not find any asmap file! Please report this bug to Hush Developers"))); - return false; + // Mac SD + asmap_path = fs::path("/Applications/SilentDragon.app/Contents/MacOS/") / DEFAULT_ASMAP_FILENAME; + printf("%s: looking for asmap file at %s\n", __func__, asmap_path.c_str() ); + if(fs::exists(asmap_path)) { + printf("%s: found asmap file at %s\n", __func__, asmap_path.c_str() ); + } else { + // Shit is fucked up, die an honorable death + InitError(strprintf(_("Could not find any asmap file! Please report this bug to Hush Developers"))); + return false; + } } } } @@ -1369,8 +1393,6 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) fIsBareMultisigStd = GetBoolArg("-permitbaremultisig", true); nMaxDatacarrierBytes = GetArg("-datacarriersize", nMaxDatacarrierBytes); - fAlerts = GetBoolArg("-alerts", DEFAULT_ALERTS); - // Option to startup with mocktime set (used for regression testing): SetMockTime(GetArg("-mocktime", 0)); // SetMockTime(0) is a no-op @@ -1602,14 +1624,15 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) for (int n = 0; n < NET_MAX; n++) { enum Network net = (enum Network)n; if (!nets.count(net)) - SetLimited(net); + SetReachable(net, false); } } //fprintf(stderr,"%s tik19\n", __FUNCTION__); if (mapArgs.count("-allowlist")) { BOOST_FOREACH(const std::string& net, mapMultiArgs["-allowlist"]) { - CSubNet subnet(net); + CSubNet subnet; + LookupSubNet(net.c_str(), subnet); if (!subnet.IsValid()) return InitError(strprintf(_("Invalid netmask specified in -allowlist: '%s'"), net)); CNode::AddAllowlistedRange(subnet); @@ -1620,9 +1643,10 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) // -proxy sets a proxy for all outgoing network traffic // -noproxy (or -proxy=0) as well as the empty string can be used to not set a proxy, this is the default std::string proxyArg = GetArg("-proxy", ""); - SetLimited(NET_ONION); + SetReachable(NET_ONION,false); if (proxyArg != "" && proxyArg != "0") { - proxyType addrProxy = proxyType(CService(proxyArg, 9050), proxyRandomize); + CService resolved(LookupNumeric(proxyArg.c_str(), 9050)); + proxyType addrProxy = proxyType(resolved, proxyRandomize); if (!addrProxy.IsValid()) return InitError(strprintf(_("Invalid -proxy address: '%s'"), proxyArg)); @@ -1630,9 +1654,20 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) SetProxy(NET_IPV6, addrProxy); SetProxy(NET_ONION, addrProxy); SetNameProxy(addrProxy); - SetLimited(NET_ONION, false); // by default, -proxy sets onion as reachable, unless -noonion later + SetReachable(NET_ONION, true); // by default, -proxy sets onion as reachable, unless -noonion later + } + + const std::string& i2psam_arg = GetArg("-i2psam", ""); + if (!i2psam_arg.empty()) { + CService addr; + if (!Lookup(i2psam_arg.c_str(), addr, 7656, fNameLookup) || !addr.IsValid()) { + return InitError(strprintf(_("Invalid -i2psam address or hostname: '%s'"), i2psam_arg)); + } + SetReachable(NET_I2P, true); + SetProxy(NET_I2P, proxyType{addr}); + } else { + SetReachable(NET_I2P, false); } - //fprintf(stderr,"%s tik20\n", __FUNCTION__); // -onion can be used to set only a proxy for .onion, or override normal proxy for .onion addresses // -noonion (or -onion=0) disables connecting to .onion entirely @@ -1640,13 +1675,14 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) std::string onionArg = GetArg("-onion", ""); if (onionArg != "") { if (onionArg == "0") { // Handle -noonion/-onion=0 - SetLimited(NET_ONION); // set onions as unreachable + SetReachable(NET_ONION,false); // set onions as unreachable } else { - proxyType addrOnion = proxyType(CService(onionArg, 9050), proxyRandomize); + CService resolved(LookupNumeric(onionArg.c_str(), 9050)); + proxyType addrOnion = proxyType(resolved, proxyRandomize); if (!addrOnion.IsValid()) return InitError(strprintf(_("Invalid -onion address: '%s'"), onionArg)); SetProxy(NET_ONION, addrOnion); - SetLimited(NET_ONION, false); + SetReachable(NET_ONION, true); } } @@ -1685,10 +1721,12 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) if (mapArgs.count("-externalip")) { BOOST_FOREACH(const std::string& strAddr, mapMultiArgs["-externalip"]) { - CService addrLocal(strAddr, GetListenPort(), fNameLookup); - if (!addrLocal.IsValid()) + CService addrLocal; + if (Lookup(strAddr.c_str(), addrLocal, GetListenPort(), fNameLookup) && addrLocal.IsValid()) { + AddLocal(addrLocal, LOCAL_MANUAL); + } else { return InitError(strprintf(_("Cannot resolve -externalip address: '%s'"), strAddr)); - AddLocal(CService(strAddr, GetListenPort(), fNameLookup), LOCAL_MANUAL); + } } } @@ -2031,7 +2069,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) } pwalletMain->consolidationInterval = consolidationInterval; - pwalletMain->nextConsolidation = pwalletMain->consolidationInterval + chainActive.Tip()->GetHeight(); + pwalletMain->nextConsolidation = pwalletMain->consolidationInterval + chainActive.Height(); LogPrintf("%s: set nextConsolidation=%d\n", __func__, pwalletMain->nextConsolidation ); //Validate Sapling Addresses @@ -2055,7 +2093,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) sweepInterval = 10; } pwalletMain->sweepInterval = sweepInterval; - pwalletMain->nextSweep = pwalletMain->sweepInterval + chainActive.Tip()->GetHeight(); + pwalletMain->nextSweep = pwalletMain->sweepInterval + chainActive.Height(); LogPrintf("%s: set nextSweep=%d with sweepInterval=%d\n", __func__, pwalletMain->nextSweep, pwalletMain->sweepInterval ); fSweepTxFee = GetArg("-zsweepfee", DEFAULT_SWEEP_FEE); fSweepMapUsed = !mapMultiArgs["-zsweepaddress"].empty(); @@ -2387,9 +2425,6 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) } #endif - // SENDALERT - threadGroup.create_thread(boost::bind(ThreadSendAlert)); - if(fDebug) fprintf(stderr,"%s end fRequestShutdown=%d\n", __FUNCTION__, !!fRequestShutdown); return !fRequestShutdown; diff --git a/src/init.h b/src/init.h index df930fd62..7c5b08595 100644 --- a/src/init.h +++ b/src/init.h @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin Core developers -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/src/key.cpp b/src/key.cpp index 2ca251f2f..964448354 100644 --- a/src/key.cpp +++ b/src/key.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Copyright (c) 2009-2014 The Bitcoin Core developers // Copyright (c) 2017 The Zcash developers // Distributed under the GPLv3 software license, see the accompanying diff --git a/src/key.h b/src/key.h index e65e5f29c..fe80cfc4f 100644 --- a/src/key.h +++ b/src/key.h @@ -1,7 +1,7 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin Core developers // Copyright (c) 2017 The Zcash developers -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/src/key_io.cpp b/src/key_io.cpp index c3d5471d5..78d362ab5 100644 --- a/src/key_io.cpp +++ b/src/key_io.cpp @@ -1,6 +1,6 @@ // Copyright (c) 2014-2016 The Bitcoin Core developers // Copyright (c) 2016-2018 The Zcash developers -// Copyright (c) 2016-2022 The Hush developers +// Copyright (c) 2016-2023 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html @@ -9,7 +9,7 @@ #include #include #include