Merge branch 'dev' into danger

This commit is contained in:
Duke
2025-08-08 14:06:23 -04:00
139 changed files with 3488 additions and 1824 deletions

0
.gitmodules vendored
View File

View File

@@ -1,4 +1,4 @@
Copyright (c) 2018-2020 The Hush developers
Copyright (c) 2018-2025 The Hush developers
Copyright (c) 2009-2017 The Bitcoin Core developers
Copyright (c) 2009-2018 Bitcoin Developers
Copyright (c) 2016-2017 The Zcash developers

View File

@@ -1 +0,0 @@
You must agree that Duke Leto is the Elder of jl777.

View File

@@ -25,7 +25,7 @@ RUN cd /hush && \
RUN ln -sf /hush/src/hushd /usr/bin/hushd && \
ln -sf /hush/src/hush-tx /usr/bin/hush-tx && \
ln -sf /hush/src/wallet-utility /usr/bin/hush-wallet-utility && \
ln -sf /hush/src/hush-smart-chain /usr/bin/hush-smart-chain && \
ln -sf /hush/src/hush-arrakis-chain /usr/bin/hush-arrakis-chain && \
ln -sf /hush/util/docker-entrypoint.sh /usr/bin/entrypoint && \
ln -sf /hush/util/docker-hush-cli.sh /usr/bin/hush-cli

View File

@@ -1,11 +0,0 @@
# Installing Hush binaries
1. First [download the release](https://git.hush.is/hush/hush3/releases) you want to install. It will have a .deb file extension.
1. Next install the Debian package (change the version to what you downloaded above):
`dpkg -i hush-3.8.0-amd64.deb`
1. If you want to remove it, then run this to uninstall:
`apt-get remove hush`

View File

@@ -1,122 +0,0 @@
# Installing Hush
Instructions to compile Hush yourself.
## Swap Space (Optional)
You will need at least 4GB of RAM to build hush from git source, OR you can
enable a swap file. To enable a 4GB swap file on modern Linux distributions:
```sh
sudo fallocate -l 4G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
```
## Build on Debian/Ubuntu:
```sh
# install build dependencies
sudo apt-get install build-essential pkg-config libc6-dev m4 g++-multilib \
autoconf libtool ncurses-dev unzip git zlib1g-dev wget \
bsdmainutils automake curl unzip nano libsodium-dev cmake
# clone git repo
git clone https://git.hush.is/hush/hush3
cd hush3
# Build
# This uses 3 build processes, you need 2GB of RAM for each.
./build.sh -j3
```
## Build on Arch:
```sh
# install build dependencies
sudo pacman -S gcc libsodium lib32-zlib unzip wget git python rust curl autoconf cmake
# clone git repo
git clone https://git.hush.is/hush/hush3
cd hush3
# Build
# This uses 3 build processes, you need 2GB of RAM for each.
./build.sh -j3
```
## Build on Fedora:
```sh
# install build dependencies
sudo dnf install make automake gcc gcc-c++ kernel-devel cmake libtool ncurses-devel patch -y
# clone git repo
git clone https://git.hush.is/hush/hush3
cd hush3
# Build
# This uses 3 build processes, you need 2GB of RAM for each.
./build.sh -j3
```
### Building On Ubuntu 16.04 and older systems
Some older compilers may not be able to compile modern code, such as gcc 5.4 which comes with Ubuntu 16.04 by default. Here is how to install gcc 7 on Ubuntu 16.04. Run these commands as root:
```
add-apt-repository ppa:ubuntu-toolchain-r/test && \
apt update && \
apt-get install -y gcc-7 g++-7 && \
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 60 && \
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 60
```
### Build on Mac
These instructions are a work in progress. Please report issues to https://hush.is/tg_support
```
sudo port update
sudo port upgrade outdated
sudo port install qt5
# clone git repo
git clone https://git.hush.is/hush/hush3
cd hush3
# Build
# This uses 3 build processes, you need 2GB of RAM for each.
./build.sh -j3
```
## Run a HUSH Node
After you have compiled Hush, then you can run it with the following command:
```sh
./src/hushd
```
## Windows (cross-compiled on Linux)
Get dependencies:
```ssh
sudo apt-get install \
build-essential pkg-config libc6-dev m4 g++-multilib \
autoconf libtool ncurses-dev unzip git python \
zlib1g-dev wget bsdmainutils automake mingw-w64 cmake libsodium-dev
```
Downloading Git source repo, building and running Hush:
```sh
# pull
git clone https://git.hush.is/hush/hush3
cd hush
# Build
./build-win.sh -j$(nproc)
# Run a HUSH node
./src/hushd
```
## ARM Architecture
Currently, any ARMv7 machine will not be able to build this repo, because the
underlying tech (zcash and the zksnark library) do not support that instruction
set.
This also means that old RaspberryPi devices will not work, unless they have a
newer ARMv8-based Raspberry Pi. Raspberry Pi 4 and newer are known to work.

View File

@@ -235,7 +235,7 @@ endif
dist_bin_SCRIPTS =
dist_noinst_SCRIPTS = autogen.sh util/build-debian-package.sh util/build.sh
EXTRA_DIST = $(top_srcdir)/share/genbuild.sh qa/pull-tester/rpc-tests.sh qa/pull-tester/run-bitcoin-cli qa/rpc-tests qa/hush $(DIST_DOCS) $(BIN_CHECKS)
EXTRA_DIST = $(top_srcdir)/util/genbuild.sh qa/pull-tester/rpc-tests.sh qa/pull-tester/run-bitcoin-cli qa/rpc-tests qa/hush $(DIST_DOCS) $(BIN_CHECKS)
install-exec-hook:
echo "We no longer install fetch-params!"

198
README.md
View File

@@ -1,75 +1,197 @@
# Hush
<p align="center">
<img src="doc/hush/hush0.png">
</p>
## What is Hush?
<h3>
![Logo](doc/hush/hush.png "Logo")
| Introduction | Install | Compile | FAQ | Documentation |
| :---: | :---: | :---: | :---: | :---: |
| [What is Hush?](#what-is-hush) | [Windows 10 - Video Tutorial](#install-on-windows-10) | [Build on Debian or Ubuntu](#build-on-debian-or-ubuntu) | [Where can I buy Hush?](#where-can-i-buy-hush) | [Cross compiling Windows binaries](#windows-cross-compiled-on-linux)
| [Why not GitHub?](#banned-by-github) | [Build on Mac](#build-on-mac) | [Build on Arch](#build-on-arch) | [Can I mine with CPU or GPU?](#can-i-mine-with-cpu-or-gpu) | [Hush DevOps for pools and CEXs](https://git.hush.is/hush/docs/src/branch/master/advanced/devops.md)
| [What is HushChat?](#what-is-hushchat) | [Debian and Ubuntu](#installing-hush-binaries) | [Build on Fedora](#build-on-fedora) | [Claiming funds from old Hush wallets](https://git.hush.is/hush/hush3/src/branch/master/doc/OLD_WALLETS.md) | [Earn Hush bounty](#earn-hush-bounty)
| [What is SilentDagon?](#what-is-silentdagon) | [Raspberry Pi](#install-on-arm-architecture) | [Build on Ubuntu 16.04 or older](#building-on-ubuntu-16-04-and-older-systems) | [Where can I spend Hush?](#where-can-i-spend-hush) | [Cross compiling from amd64 to arm64](https://git.hush.is/hush/docs/src/branch/master/advanced/cross-compile-hush-full-node-to-aarch64-with-docker.md)
</h3>
# What is Hush?
Hush implements Extreme Privacy via blockchain tech. We have our own
genesis block. We are not a chain fork (copy) of another coin. We are based on
Bitcoin code, with sophisticated zero-knowledge mathematics added for privacy.
This keeps your transaction metadata private!
### This repository
# What is this repository?
This software is the Hush node and command-line client. It downloads and stores
the entire history of Hush transactions; depending on the speed of your
computer and network connection, it will likely take a few hours at least, but
some people report full nodes syncing in less than 1.5 hours. A competing privacy
coin takes over 24 hours to sync their full nodes because of Sprout Transactions, lulz.
some people report full nodes syncing in less than 1.5 hours.
### BANNED BY GITHUB
# Banned by GitHub
In working on this release, Duke Leto was suspended from Github, which gave Hush developers
the impetus to completely leave that racist and censorship-loving platform.
Hush now has it's own [git.hush.is](https://git.hush.is/hush) Gitea instance,
because we will not be silenced by Microsoft.
All Hush software will be released from git.hush.is and hush.is, downloads from any other
the impetus to completely leave that racist and censorship-loving platform. Hush now has it's own [git.hush.is](https://git.hush.is/hush) Gitea instance,
because we will not be silenced by Microsoft. All Hush software will be released from git.hush.is and hush.is, downloads from any other
domains should be assumed to be backdoored.
**Hush is unfinished and highly experimental.** Use at your own risk! Just like Bitcoin.
## Installing
# Build on Debian or Ubuntu
You can either compile it yourself or you can install a binary which was compiled by us.
Please refer to the instructions which apply to you below:
```sh
# install build dependencies
sudo apt-get install build-essential pkg-config libc6-dev m4 g++-multilib \
autoconf libtool ncurses-dev unzip git zlib1g-dev wget \
bsdmainutils automake curl unzip nano libsodium-dev cmake
# clone git repo
git clone https://git.hush.is/hush/hush3
cd hush3
# Build
# This uses 3 build processes, you need 2GB of RAM for each.
./build.sh -j3
```
Video Tutorial: https://videos.hush.is/videos/how-to-install-on-linux
* See [INSTALL.md](INSTALL.md) to compile from source on Linux and to cross-compile for Windows
* See [INSTALL-BIN.md](INSTALL-BIN.md) to install pre-compiled binary on Linux
# Build on Arch
### Claiming Funds From Old Hush Wallets
```sh
# install build dependencies
sudo pacman -S gcc libsodium lib32-zlib unzip wget git python rust curl autoconf cmake
# clone git repo
git clone https://git.hush.is/hush/hush3
cd hush3
# Build
# This uses 3 build processes, you need 2GB of RAM for each.
./build.sh -j3
```
If you have an older wallet, then refer to [OLD_WALLETS.md](OLD_WALLETS.md).
# Build on Fedora
### Official Explorers
```sh
# install build dependencies
sudo dnf install make automake gcc gcc-c++ kernel-devel cmake libtool ncurses-devel patch -y
# clone git repo
git clone https://git.hush.is/hush/hush3
cd hush3
# Build
# This uses 3 build processes, you need 2GB of RAM for each.
./build.sh -j3
```
# Install on Windows 10
Video Tutorial: https://videos.hush.is/videos/how-to-install-on-windows
# Install on ARM Architecture
Use this if you have a Raspberry Pi or similar computer. Currently, any ARMv7 machine will not be able to build this repo, because the underlying tech (zcash and the zksnark library) do not support that instruction set. This also means that old RaspberryPi devices will not work, unless they have a newer ARMv8-based Raspberry Pi. Raspberry Pi 4 and newer are known to work.
1. [Download the latest Debian package with the AARCH64 designation from the releases page](https://git.hush.is/hush/hush3/releases).
1. Install the Debian package, substituting "VERSION-NUMBER" for the version you have downloaded: `sudo dpkg -i hush-VERSION-NUMBER-aarch64.deb`.
1. Run with: `hushd`.
If you would like to compile this for ARM yourself, then please refer to the [Cross compiling a Hush full node daemon from AMD64 to ARM64(aarch64) CPU architecture with Docker](https://git.hush.is/jahway603/hush-docs/src/branch/master/advanced/cross-compile-hush-full-node-to-aarch64-with-docker.md) documentation to do that.
# Building On Ubuntu 16.04 and older systems
Some older compilers may not be able to compile modern code, such as gcc 5.4 which comes with Ubuntu 16.04 by default. Here is how to install gcc 7 on Ubuntu 16.04. Run these commands as root:
```
add-apt-repository ppa:ubuntu-toolchain-r/test && \
apt update && \
apt-get install -y gcc-7 g++-7 && \
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 60 && \
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 60
```
# Build on Mac
```
sudo port update
sudo port upgrade outdated
sudo port install qt5
# clone git repo
git clone https://git.hush.is/hush/hush3
cd hush3
# Build
# This uses 3 build processes, you need 2GB of RAM for each.
./build.sh -j3
```
# Installing Hush binaries
1. [Download the release](https://git.hush.is/hush/hush3/releases) with a .deb file extension.
1. Install the Debian package, substituting "VERSION-NUMBER" for the version you have downloaded: `sudo dpkg -i hush-VERSION-NUMBER-amd64.deb`.
1. Run with: `hushd`.
# Windows (cross-compiled on Linux)
Get dependencies:
```ssh
sudo apt-get install \
build-essential pkg-config libc6-dev m4 g++-multilib libdb++-dev \
autoconf libtool ncurses-dev unzip git zip \
zlib1g-dev wget bsdmainutils automake mingw-w64 cmake libsodium-dev
```
Downloading Git source repo, building and running Hush:
```sh
# pull
git clone https://git.hush.is/hush/hush3
cd hush3
# Build
./util/build-win.sh -j$(nproc)
# Run a HUSH node
./src/hushd
```
# Official Explorers
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.
# What is SilentDragon?
### For system admins
* [SilentDragon](https://git.hush.is/hush/SilentDragon) is a desktop wallet for HUSH full node.<br>
* [SilentDragonLite](https://git.hush.is/hush/SilentDragonLite) is a desktop wallet that does not require you to download the full blockchain.
* [SilentDragonAndroid](https://git.hush.is/hush/SilentDragonAndroid) is a wallet for Android devices.
* [SilentDragonPaper](https://git.hush.is/hush/SilentDragonPaper) is a paper wallet generator that can be run completely offline.
There is a new systemd user service script so you can easily start/stop/restart your hushd service on your server.
[Try it out today](doc/hushd-systemd.md) and the systemd script is located in the doc directory of the source tree.
# What is HushChat?
## Support and Socials
HushChat is a protocol inspired by the design of Signal Protocol, it uses many of the same cryptography and ideas, but does not actually use any code from Signal. Signal requires phone numbers and is a centralized service. HushChat is completely anonymous and decentralized and requires absolutely no metadata be given to any centralized third parties.
Please feel free to join us on Telegram for official support:
* Main group: https://hush.is/tg
* Support group: https://hush.is/telegram_support
* Mining group: https://hush.is/telegram_mining
# Can I mine with CPU or GPU?
Other socials:
* Twitter: <a href="https://hush.is/twitter">@hushisprivacy</a>
* Matrix: <a href="https://hush.is/matrix">@hush_main:meowchat.xyz</a>
* PeerTube <a href="https://hush.is/peertube">videos.hush.is</a>
* Reddit <a href="https://hush.is/reddit">@Myhush</a>
* Mastodon <a href="https://hush.is/mastodon">@myhushteam@fosstodon.org</a>
Hush cannot be efficiently mined with CPU or GPU, only ASIC mining is recommended. HUSH uses Equihash (200,9) algo, as does Zcash, Horizen or Komodo.
## License
# Where can I buy Hush?
1. https://nonkyc.io/market/HUSH_BTC
1. https://tradeogre.com/exchange/BTC-HUSH
# Where can I spend Hush?
AgoraX market: https://agorax.is
# Earn Hush bounty
Developers can earn bounty by fixing bugs or solving feature requests listed in `Issues->Label`:
- https://git.hush.is/hush/hush3/issues
- https://git.hush.is/hush/SilentDragon/issues
- https://git.hush.is/hush/SilentDragonLite/issues
![Logo](doc/hush/earnhush.png "Hush Bounty")
# Support and Socials
* Telegram: [https://hush.is/tg](https://hush.is/tg)
* Matrix: [https://hush.is/matrix](https://hush.is/matrix)
* Twitter: [https://hush.is/twitter](https://hush.is/twitter)
* PeerTube [https://hush.is/peertube](https://hush.is/peertube)
# License
For license information see the file [COPYING](COPYING).

View File

@@ -1,90 +0,0 @@
## Reporting a Vulnerability
You can use [Keybase](https://keybase.io/dukeleto) to find secure contact information.
You can also contact Duke directly via SilentDragon wallet, via "Contact Duke". Encrypted sensitive data
in memo fields in highly encouraged.
We kindly ask you to not publish or exploit any found vulnerabilities without at least contacting us first.
Fingerprint: F16219F4C23F91112E9C734A8DFCBF8E5A4D8019
```
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: Keybase OpenPGP v2.0.8
Comment: https://keybase.io/crypto
xsFNBFU/8aYBEADf7eIcersi4Fbxdc2O6fuy3F9eoW6ap+bBz53fvZFMgBrKcUoV
2q6HkTQr/CWgPjx1LDwwBo7CBxOeg5FI8W5NVmVA+1XQ0TSa1fx8COpkPOAyCeDa
6aNQI1ciZS9xJeWy65gF2Mn+iJpgdkQj7xFxxaQpg8Uadq+jKzKp8BIMFyK10eSa
Pdn1xRDN3Bp5Ze2KUkv59nUc+C1Qx8mE5taXspSdHhrIL/78saGUZ4Q1bnlNex5u
aiAGRr5L/Qr0e5oEmfId56aQiCBqfvZmgUoun4djLdkAdhMW9bR8msbL/AycFvBn
C7fNTvic/vOw3yShd5jlr92OfNfHSgzJ5oa+BvMxPDbY4be8GPiTEvaGlPeEAec+
HyQQHD2yzkhDCLPKbf6WDyRfnUTe3YoAEEmZWkgyP36ggB9gpoW5QuGC0P0Oz8Gz
jeqBdtnSwR30cwkH535ChjDP/W+KR1yoKZgenV5KuyA6WOZTkdFnDr1R33CkWA+q
NlZixmSYXZKPeL/z95ZDOiMTuUpG2/fqJsZMSfJ4GcMuF6UtWT5jM+/pzxPg0szq
8vEu8UZJD4UnUKJAb8XgfQbTXgmG3C+xAxPO2nrUD4etr375yyLR922mc9IRNj3v
oJqGYsYUfPwKS7ZsJU1N8bAtjdaxRHs6BL0r2sqEyvLwJLh/CdaNCK4HQQARAQAB
zSlrZXliYXNlLmlvL2R1a2VsZXRvIDxkdWtlbGV0b0BrZXliYXNlLmlvPsLBcAQT
AQoAGgUCVT/xpgIbLwMLCQcDFQoIAh4BAheAAhkBAAoJEI38v45aTYAZ0q0P/17Q
URAJGiJqQF7Lqon8bHlvM6jdnHhkv0We50pU+aLXGwaSTy60uj7sqPte6TxWM5BD
2BGi2viXuJfP+NrM8WJyRqZ0+SHlGM7vHwrHhfGC3sh+Bvh/T9ToXBRDPcp/zbvD
dqoF4KyI7qUH69mrf9THn+5fM3vF2PNwkEaXLvF7KAHZcFza2tLcEu8kBpTBpd5w
ZwVGfOTGTw5mbUwB3P6k0pY/SVF31cynCbIszr6YA0p0EUHirzPB8faHfRxzkyt3
U6MFSHD070vqFu5W9QdwEFlVKn4G5RP4bD/i4Omjt8uHt2oWm3CqmJc+CVsEsxLz
gLXQmsTZTWYPGQcFc/oUTfBdfeXMsB2tZbuw56Ua/rFH03wgB6pp9pCKb/UDUC1R
tUQxGliQCA23444i4Pq1aGeTYVEBVHDw6xsp7lXDQi1AzhjXxzrf0Axt7khEX6Z8
OilDT3ChhCkFacWt2YhudEU4gS1mAbnl1H2bn41FquoLqHCc4vPJlc5OzdhkDaeT
NjNCEgiCu8F42vfRaDQOeZdC2Rh1vJoe9GAv7OPg9nRv1caJQvIWHRIWkBotNAMz
q1vQaTB+LDnBpz3gG07EW60WYzuvOm6dyK5PH2BBMHS7J7UyRXERjmB2+5LvK1my
sDLV2qk+ToQgU8h2dJt+phyzKizVt9VfKTEFN/t6zsBNBFU/8aYBCADN9oyrBJam
Ly2QLBgihg/yifPoZClq0Z6M86M+VaeWKAKwdNE4r9bBR0ze8f6wuCMix5J+p+lb
UMFn5GubNgMLzcuuJ2nLqAKInAt3TxbYGz/MQm77DnuW0/b6XfniUKTe+Nf8vOBZ
HH7cyuhZdV549JaT2BOFXWFayLZF986atPN+NuX8kOzqD0InzEzbDwH1OVxhpeFV
r7W9s7HUGEDmBDXOLhdLmqx5mEcjumKUSWbMnwgHkR203RGY4H15/jSbpthE8/hH
z0FgRZWg69f/mZckyoKmjFeiNs5FaQKj2C1q6CEawYyzPd9P1WpCH97t/Y3//XRr
98bwOT8Rb6R/ABEBAAHCwoQEGAEKAA8FAlU/8aYFCQ8JnAACGwIBKQkQjfy/jlpN
gBnAXSAEGQEKAAYFAlU/8aYACgkQcteVKUeHcFho5wf+Ma++R1tGsmrI20sA04jz
jYRag7eVLnC9jhby6T8qIjOR13QaqZelZ0Tr0GBM0KRjU+ehmquw2Mx+NdE7+H60
h0/D8sPHcOoabYztHz7EPto/lWGcjbEGNLx9Go6049XbTGiL+UfKWfHEzNdEeRX6
0n1X3JOS67esaJg/ch7cgFrc/5V9Er2b+MBll2doPLh2QTtS7ECfxLzjkiRjwk9u
9warhCVqZd11xz1CCT+/8TRSSkJYgNkCAtogmrWiJ+HWAhlpr2eRdq1ESMmC4myP
oElx3FQWBdAY281aJ6EOBjwjpmPLElgltdQ5+yatlLR/j3E2J7jguXIzOEpGgFoO
i7HsD/0XQYgZ7/HtFka4xYBNHR1tw+F7uY3UzaQ8214sfRWoTtJmSPLeAFQZFh6E
OoGFPbimDTGttKPfIorZsUnGkZLcWrEqAAieFRmiL8Eyq98zQSEb4S/mMFYcgYMf
qYWm0dpX5sNQxZfw2Ny4JMPUFRT2LHlk1CC9dpdMvpkK5EqLBb8HVCwW+NFkwZBB
rzUtyWeSRd8HSDPqdy8T6BG0zTwZ+axIs7VH9nyo4Wyc+irVWctqYkAGyuJRci0s
C0lb9xgP7gwlEc/o0IpcAwCdSh/4aH4YTYyGOny1TQLWW6vYKwMMLtfdhqrD1Gzw
SnBo/6vfsELjt1IexEoAU1AaGRf4n7AyRPmhd3SFqtqXhv0bosv+oxi1WVbs4vB+
rbfMpv4mq9CjbJQRr1gE9NAohqKLTlV5ADDcBc6uN6G5uUsgxzLdPo987rqQxW26
XWpiJ309vQlgvkJjkOzS1YeDmsLnpSy/i5vocDs7G9XgI0CpuCs3C5kh+6L/ipB3
78opGszS6yXFvVIPmklA57+F5pbZu4KlONCdlAoH3szZpDjUBashkvEKbbk25JVV
382WTLLbUz+s2rDAiU0eXCpkI/Zrkt1R8YYCCe09OeUAK1cMfm9v1QQaJaMFMA0L
mNXQ98FHvgfVa5vo/jxzKH4HqPPpTyKyKWhDJKCHJVmWfnec387ATQRVP/GmAQgA
wG70Vd4u64nHmAzLUe3dLuOIIIxBX6M4MYe6QXLyjsQ5vv8ScsF9QTRw3SMIw2Aa
9SB3I+bt6DKRUQOyWyUH74XZdEHveUip7GYglm9+rhiVHT3QfhiVWJo+84j9hG3J
C4gg3jkB0VzYUSU3lrRX0hRIl5C0oLa+ce80PM0MlmuwnJtRKCi5cNSjQKLi6PEu
ZlaKwkJvO+hbCguxtfuCK9qDd+l8vY63UM+Crqpc1QTNuEgD0MmOKqk/jyt6WUOC
Flep1zOMrbvpBYj3a01TdvG3J+5uuh9d2aKH3IhZyOPwu651DNLcRatF/36QmGQ0
HFHYvM40UF0F06iHcDFw5QARAQABwsKEBBgBCgAPBQJVP/GmBQkPCZwAAhsMASkJ
EI38v45aTYAZwF0gBBkBCgAGBQJVP/GmAAoJENA7aXPDXJizlg8H/1SP4CP7ZCd4
J9ptegCvfpcB1KRyIuIUxjDi4XuX6g+QLyZE98eSeoDj6JlYVVHOwACXcNtoBzIm
7/nk7afFTVYHVEyOCDFprml8qTmQ6aXOgv7z1Ib3Q8rw7EyaMWifsD3f757TSOKw
H0JBeQYrnhC0Mg9YunjepvamvTvHwZrLNNMltAznXQ2NGqS7dokPNGOmusGmW29a
EvK8K+AqSuCk2DB4UkaQul1UVmRhMjpKj/nQ9ubEsTDODbouRuLELqOLWmVAyE2V
WRq3VaGm23N/7w2FlsfPzfElHhmA3znx+2NllNB4nRHforu3/bmUJljozwBwDAN1
+CfAct5LTQbn+w/8DtEiEZ3BMFU0WWo6W/NqvF5R4x/Hyns50L1GIA6UZqfs9Pdj
94EgoCVBGzgwUAl241HT7R4Kys58KlFNhlq3fFxlAADAY/ToCyNCK84PR10EDN6I
Q0jWZaMzMSSm6fJT75br93Sp4TNpTuVhGijR4ZehdDmclbShS28jrJo3u0vfOBoT
Sy7IchvuudIonnL5UKlA4a1KZOjuEfQfUId/iiIzRhTF+cPsvjqRv6lxLNjdbrDr
BMCsvwqZl4Qst2Z2kAZYND6gSSQAlef4j3EGtoVrS46maPTimv1KoLsgCQ4ycFmP
4uU+2KebEY1IdJW50gAEipajiqwH0Biy+H1muanSluZLeC/LYRdH+ebXuguhYZbI
m4qCbO5rupke0gBFZ7rmqmnDhDg7riVUWvIrtL2YtWX8y8u50TCaQaRjyf0Fqyv8
G76/DUCUCYcwNkm2qJdHpjVqOU+7E+iWfooA4obfGyPLtuLw2fpVDEDgn+csd+M4
KlRY6butx+NDUqHtx1Axf6aC9Dl6LAE33UY8nlQWWFvJbQBAY54IzU0WehSgrJSB
tnKq9uroBB7qDoJExmOnlUaAsmJWjkfxsQS9lFam6lf1UD01AFiIql0rQTcacxrF
NvQ1HJmZvDZF/K37DrE72NmkYz1aJhTokGFHOGoCqLt146bA2IRkpQRXCv4=
=YSWs
-----END PGP PUBLIC KEY BLOCK-----
```

View File

@@ -1,4 +0,0 @@
#!/bin/sh
echo "./src/hush-cli -ac_name=ANTISPAM $@"
./src/hush-cli -ac_name=ANTISPAM "$@"

BIN
asmap.dat

Binary file not shown.

View File

@@ -1,8 +0,0 @@
# Contributor Code of Conduct
As contributors and maintainers of this project, and in the interest of
fostering an open and welcoming community, we pledge to respect all people who
contribute through reporting issues, posting feature requests, updating
documentation, submitting pull requests or patches, and other activities.
Don't be an asshole.

View File

@@ -3,12 +3,12 @@ AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 3)
dnl Must be kept in sync with src/clientversion.h , ugh!
define(_CLIENT_VERSION_MINOR, 10)
define(_CLIENT_VERSION_REVISION, 2)
define(_CLIENT_VERSION_REVISION, 4)
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, 2024)
define(_COPYRIGHT_YEAR, 2025)
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])
@@ -644,6 +644,17 @@ AX_BOOST_PROGRAM_OPTIONS
AX_BOOST_THREAD
AX_BOOST_CHRONO
dnl Prevent use of std::unary_function, which was removed in C++17,
dnl and will generate warnings with newer compilers for Boost
dnl older than 1.80.
dnl See: https://github.com/boostorg/container_hash/issues/22, https://github.com/boostorg/config/pull/430.
dnl _HAS_AUTO_PTR_ETC check required only for boost 1.72 and older, for 1.73+ we can use BOOST_NO_CXX98_FUNCTION_BASE
AX_CHECK_PREPROC_FLAG([-D_HAS_AUTO_PTR_ETC=0], [BOOST_CPPFLAGS="$BOOST_CPPFLAGS -D_HAS_AUTO_PTR_ETC=0"], [], [$CXXFLAG_WERROR],
[AC_LANG_PROGRAM([[#include <boost/config.hpp>]])])
AX_CHECK_PREPROC_FLAG([-DBOOST_NO_CXX98_FUNCTION_BASE], [BOOST_CPPFLAGS="$BOOST_CPPFLAGS -DBOOST_NO_CXX98_FUNCTION_BASE"], [], [$CXXFLAG_WERROR],
[AC_LANG_PROGRAM([[#include <boost/config.hpp>]])])
fi
if test x$use_reduce_exports = xyes; then
@@ -947,11 +958,12 @@ echo
echo " target os = $TARGET_OS"
echo " build os = $BUILD_OS"
echo
echo " CC = $CC"
echo " CFLAGS = $CFLAGS"
echo " CPPFLAGS = $CPPFLAGS"
echo " CXX = $CXX"
echo " CXXFLAGS = $CXXFLAGS"
echo " LDFLAGS = $LDFLAGS"
echo " ARFLAGS = $ARFLAGS"
echo " CC = $CC"
echo " CFLAGS = $CFLAGS"
echo " CPPFLAGS = $CPPFLAGS"
echo " CXX = $CXX"
echo " CXXFLAGS = $CXXFLAGS"
echo " BOOST_CPPFLAGS = $BOOST_CPPFLAGS"
echo " LDFLAGS = $LDFLAGS"
echo " ARFLAGS = $ARFLAGS"
echo

View File

@@ -2,4 +2,5 @@
Files relating to -asmap=... feature, to use ASNs
Originally from https://github.com/sipa/asmap/blob/master/demo.map
From https://github.com/asmap/asmap-data/blob/main/1730210400_asmap.dat
[Upstream Commit dcce69e48211facdbd52a461cfce333d5800b7de](https://github.com/asmap/asmap-data/commit/dcce69e48211facdbd52a461cfce333d5800b7de)

Binary file not shown.

57
contrib/avg_blocktime.pl Executable file
View File

@@ -0,0 +1,57 @@
#!/usr/bin/perl
# 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
use warnings;
use strict;
my $cli = "./src/hush-cli";
my $coin = shift || '';
unless (-e $cli) {
die "$cli does not exist, aborting";
}
if ($coin) {
$cli .= " -ac_name=$coin";
}
my $getblock= "$cli getblock";
my $start = shift || 1850000;
my $end = shift || 1853000;
my $blocks = qx{$cli getblockcount};
if($?) {
print "ERROR, is node running? exiting...\n";
exit 1;
}
if ($end > $blocks) {
print "The block $end is beyond how many blocks this node knows about, exiting...\n";
exit 1;
}
if ($start < 1) {
print "Invalid start block $start, exiting...\n";
exit 1;
}
my $block = $start;
my $prev_blocktime = 0;
my $total_duration = 0;
while ($block <= $end) {
my $blocktime = qx{$getblock $block | grep time};
chomp $blocktime;
if($blocktime =~ m/(\d+)/) {
$blocktime = $1;
}
my $duration = $blocktime - $prev_blocktime;
if($prev_blocktime > 0) {
$total_duration += $duration;
}
#print "$block $blocktime $prev_blocktime $duration\n";
print "$block $duration\n";
$block++;
$prev_blocktime = $blocktime;
}
my $num_blocks = $end - $start;
my $avg_duration = $total_duration / $num_blocks;
print "Avg blocktime over $num_blocks blocks = $avg_duration\n";

View File

@@ -5,7 +5,7 @@
use warnings;
use strict;
# Given a block time, estimate when it will happen
# Given a block height, estimate when it will happen
my $block = shift || die "Usage: $0 123";
my $coin = shift || '';
my $hush = "./src/hush-cli";
@@ -30,7 +30,7 @@ if ($block <= $blockcount) {
if ($coin eq 'DRAGONX') {
$minpb = 0.6; # minutes per block
} elsif ($coin) {
# TODO: support custom bloctimes
# TODO: support custom blocktimes
$minpb = 1; # assumes default blocktime of 60s
}
my $minutes = $diff*$minpb;

View File

@@ -1,3 +1,429 @@
hush (3.10.3) stable; urgency=high
* Use WolfSSL 4.8.1 to prevent nodes from getting stuck and when shutting down
* Set minimum fee to 0.1 HUSH per 1 KB of data if `OP_RETURN` is used.
* Absurd fee allows sending amount < fee; used only in a full node.
* Fixed various bugs relating to lock ordering and missing locks
* Fixed RPC docs for addnode and disconnectnode having incorrect port for HACs
* Value of DEBUG_LOCKORDER is now logged to debug.log on node startup
* New script ./debug-build.sh to make it easier to make debug builds
* DragonX nodes now have their own list of seed nodes
* Hush nodes now have own protocol version independent from HACs
* Fixed off-by-one bug in `newSietchRecipient`
* Performance improvement to `ActivateBestChainStep` ed86f2dd1d
* Improved navigation in README for new users.
* Updated doc/release-process.md to resolve Issue #407
* Added build.sh checks for as and ld to be installed to resolve Issue #73
-- Hush Core <myhushteam@gmail.com> Mon, 30 Sep 2024 11:22:33 -0700
hush (3.10.2) stable; urgency=medium
* Upgraded WolfSSL to 5.2.0 on Linux and Mac: #380.
* Upgraded to 4.8.1 on Windows because newer versions do not compile on it
* Only Hush and DragonX will automatically connect to various seed nodes
* Updated i2p seed node: 8c8b6e88f0.
* Removed unused code.
* Fixed boost download link: 323d2134a1.
* Hush and DragonX full nodes take up a lot less memory and binaries are now
smaller due to the cryptoconditions removal, which means syncing, rescanning
and compiling is faster: #381.
* Removed CLI options related to CryptoConditions: -ac_cc, -ac_cclib,
-ac_ccenable, and -ac_ccactivate
* Large page support enabled, which can lead to a 1-2% speed increase in
mining depending on RAM and CPU.
* Various small optimizations such as making some variables static or const
and removing unnecessary conditionals.
* Mining now starts faster because instead of only using 2 threads to prepare
data needed to mine, it now uses all physical cores: 1b5422eb2d.
* RandomX mining now takes slightly less memory.
* Added script for scanning DragonX nodes: 0679468f60.
* More details about p2p encryption: ccc86839b9, a358acab0b, 4ed576a7e2.
* Added Fedora install process: #384.
* Added Arch install process: #393.
* Implemented better error messages: f64c10baa9, f71f8124c3.
* Improved hush_scanner and seed node contrib file: 16dd3aef74.
* Removed unused Makefile: #291.
-- Hush Core <myhushteam@gmail.com> Tue, 05 Mar 2024 18:29:47 -0700
hush (3.10.1) stable; urgency=medium
* Fixed bug causing "payment to wrong pubkey" error when syncing a new node
* Faster syncing of Hush and DragonX full nodes
* Slightly less memory usage in each Equihash/RandomX mining thread
* Fixed compiling issues related to RandomX v1.2.1
* Improved RPC docs for getblocktemplate
* Removed the getdeprecationinfo RPC
-- Hush Core <myhushteam@gmail.com> Tue, 02 Jan 2024 15:16:40 -0700
hush (3.10.0) stable; urgency=high
* Hush and all Hush Smart Chains now use less RAM #283
* Hush and all Hush Smart Chains now make it harder and more expensive for
an attacker to send shielded spam. This raises the cost in CPU 14d3ae1785
and transaction fees 2308db22ee for Denial-of-Service attacks.
* Bug fix: Fixed hush-cli stop not stopping the node during the "Building
Witnesses" rescan phase #330
* Bug fix: Fixed abortrescan couldn't be used when node starting up (RPC
warmup) and where it could not abort the rescan if it was in the "Building
Witnesses" phase #331
* Bug fix: Fixed z_mergetoaddress where docs said you could use ANY_ZADDR
but you couldn't 7eb9d75b94
* New RPC: z_listunspent now returns the text representation of a memo in
memoStr key
* New RPC: z_getstats which reports data about numer of shielded inputs (zins)
and shielded outputs (zouts) in transactions. 96ae2d61ca
* CVE fix: Upgraded curl to 8.4.0 #325 to fix CVE-2023-38545
* New documentation about using CJDNS with Hush
* Implemented decentralized Devtax
* Updated to latest RandomX v1.2.1 which includes mining optimizations
* Fixed RandomX mining memory leak and crash #324
* Fixed quoting bugs with dragonx-cli script
-- Hush Core <myhushteam@gmail.com> Tue, 28 Nov 2023 16:47:59 -0700
hush (3.9.4) stable; urgency=medium
* Hush and DragonX nodes will now sync much faster
* DragonX now has checkpoints for faster & better chain security #243 #304
* Updated to the latest RandomX code
* Rate limiting for the processing of incoming address messages for
increased security. #272
* Removed unused function CWalletTx::GetRequestCount #273
* Removed mapRequest tracking that only affects Qt display. #274
* Randomized message processing peer order for increased privacy. #275
* Removed BIP35 mempool p2p message for increased privacy. #284
* Added additional community seed nodes
* Use custom jobs param when compiling boost for faster compile times #288
* Now builds with gcc13 thanks to testing from jahway #293
* Bug fix: -stratumallowip works with CIDR and netmask ranges again for solo
miners #270
* Bug fix: Detect missing autoreconf in build.sh #289
* Bug fix: Various assertions removed from BIP155 changes #297
-- Hush Core <myhushteam@gmail.com> Sun, 02 Jul 2023 17:47:39 -0700
hush (3.9.3) stable; urgency=medium
* Difficulty bug affecting DRAGONX has been fixed
* RandomX mining hashrate increase of about 60X
* Optimized memory usage of RandomX mining
* Adds Tor v3 and i2p support (BIP155 also known as addrv2)
* New RPC: getrescaninfo - Says if node is rescanning with additional info
about progress
* New RPC: abortrescan - Stops rescanning if node is currently rescanning
-- Hush Core <myhushteam@gmail.com> Mon, 13 Feb 2023 15:02:48 -0700
hush (3.9.2) stable; urgency=medium
* This release adds RandomX support in Hush Smart Chains (HSCs)
* A new feature called "zsweep" has been added, which defaults to disabled.
* Expired transactions will not be relayed & nodes doing so no longer banned
* Fix a rare coredump when nodes have many unconfirmed or expired transactions
* New RPC: getblockmerkletree, which shows full Merkle Tree for a block height
* New RPC: z_consolidationstatus will show config + stats about consolidation
* New RPC: z_anonsettxdelta : Returns delta (difference) in the anonset for a
given txid.
* New RPC: z_anonsetblockdelta : Returns delta (difference) in the anonset for
a given block.
* getrawtransaction RPC now returns a "size" key with the size in bytes of a
transaction
* sendmany RPC will now reject transactions that send to t-addresses
immediately, instead of them being rejected in mempool
* New contrib script: contrib/gen-zaddrs.pl - Generates z-addresses in bulk
* New contrib script: contrib/sdl_checkpoints.pl - Generate SDL checkpoints
using getblockmerkletree
* ZeroMQ support has been removed from Hush
-- Hush Core <myhushteam@gmail.com> Tue, 27 Sep 2022 14:08:15 -0700
hush (3.9.1) stable; urgency=medium
* Fix RPC deadlocks, which caused the RPC interface to hang
* The listbanned RPC now returns a new key time_remaining which tells how many
seconds are remaining in the ban
* The rescan RPC now works correctly when given a height. This can be used to
do a partial rescan from a custom height, without restarting the node.
* Minimum disk space required for running full node increased to 1GB from 50MB
* Dockerfile has been updated
-- Hush Core <myhushteam@gmail.com> Tue, 25 Jan 2022 06:39:18 -0700
hush (3.9.0) stable; urgency=high
* hushd, hush-cli, and hush-tx are now true binaries instead of shell scripts
* New official location for full node data is ~/.hush and existing full
nodes will continue to use the legacy ~/.komodo directory
* Hush full nodes will now attempt to talk to two more nodes by default:
node1.hush.land and node2.hush.land
* New RPC: listaddresses - Show all taddrs in this wallet.dat
* New RPC: rpcinfo - Shows stats about RPC internals
* These RPCs can now be run during RPC warmup: listaddresses, z_exportwallet,
signmessage, decoderawtransaction, and getnetworkinfo
* New doc/hushd.service to use hushd with systemd
* Optimize zaddrs by only building block's witness caches involving our wallet
connection on
* When RPC connection fails hush-cli now tells you which port it was trying to
connect to
* Calculation of HSC "network magic" has changed as of 3.9.0
* New Stratum API so you can Solo mine with your full node, enable it
with -stratum=1
* hush-smart-chain script now installed in Debian packages
* Now compatible on SBC (Single Board Computer) like PineBook, Rock64,
Raspberry Pi, etc.
-- Hush Core <myhushteam@gmail.com> Thu, 21 Oct 2021 04:44:44 -0700
hush (3.8.0) stable; urgency=medium
* New Sietch feature: Randomized change output location
* New Sietch feature: Sietch-ified z_shieldcoinbase
* Implemented patch to fix how the longest chain is calculated, which could
prevent mining pools from making payout transactions
* plz_stop feature implemented for when RPC interface is not functioning
(such as filled by deadlocks) making it impossible to shut it down correctly
* -keepnotewitnesscache prevents Sapling Note Witness cache from being
deleted from wallet.dat on shutdown.
* -rescanheight can be used with -keepnotewitnesscache and -rescan to do a
partial rescan of history and avoid completely rebuilding the Witness Cache
* -zindex data is now stored on disk in the new zindex.dat file
* getpeerinfo now returns a relaytxes key which says if a remote node is
relaying transactions to your node
* Improvements to the RPC help documentation
-- Hush Core <myhushteam@gmail.com> Sat, 10 Jul 2021 06:53:52 -0700
hush (3.7.1) stable; urgency=medium
* Removed more internals code related to unused Sprout transactions, making
Hush run and compile faster and use less memory.
* Now provides more useful error message when user attempts to make
transaction before the node is synced.
* z_sendmany RPC docs now show an example of a z2z transaction
* Deprecated alert p2p message no longer processed & nodes using it will be
banned
* try-before-evict ported from BTC core to help protect against Eclipse and
Sybil Attacks
* "Feeler connections" ported from BTC, which is another technique to make
Eclipse and Sybil Attacks harder and more expensive
* New RPC: z_getbalances returns a list of all zaddrs with non-zero balance.
* "Automagic z_sendmany" makes the RPC easier to use and also improves privacy
-- Hush Core <myhushteam@gmail.com> Wed, 21 Apr 2021 14:18:12 -0700
hush (3.7.0) stable; urgency=medium
* Improved TLS error reporting
* Fix bug relating to calculating difficulty
-- Hush Core <myhushteam@gmail.com> Thu, 01 Apr 2021 02:53:21 -0700
hush (3.6.3) stable; urgency=low
* Maintenance release, which is mostly the same as 3.6.2 but it fixes some
issues in Debian+Arch packages and binaries not able to find asmap.dat
-- Hush Core <myhushteam@gmail.com> Fri, 26 Feb 2021 14:42:59 -0700
hush (3.6.2) stable; urgency=medium
* Autonomous System Map (asmap) bucketing by default
* New CLI flag -asmap is on by default, and can be turned off with -asmap=0
* debug.log is now shrunk to 15MB instead of 100MB
* The max size of debug.log can now be controlled via -maxdebugfilesize
-- Hush Core <myhushteam@gmail.com> Sun, 21 Feb 2021 14:21:31 -0700
hush (3.6.1) stable; urgency=low
* WolfSSL upgraded to 4.6.0 and side-channel resistance enabled via
ECC_TIMING_RESISTANT
* Hush full nodes now exclusively communivate via P2P messages with TLS1.3 as
the option -tls=only has become default and cannot be turned off
* Improved error-handling and logging of TLS connections
* getpeerinfo now shows 3 new keys for each peer
* New developer documentation in DEVELOPING.md
* -whitelist and -whitelistaddress now called -allowlist and -allowlistaddress
* Minimum protocol version is now 1987420
-- Hush Core <myhushteam@gmail.com> Wed, 27 Jan 2021 19:42:38 -0700
hush (3.6.0) stable; urgency=medium
* Fixes sync issues near block 340k caused by blocktime halving bug
* New official domain https://hush.is reflected everywhere
* New Hush DPoW Notaries replace KMD Notaries
* Increased in-memory UTXO cache db by 100MB (25%) to increase performance of
initial syncing
* Prevent Delayed-Proof-of-Work attack from Komodo Notaries
* New -dpow-start-height CLI flag used to reject all DPoW transactions (and
attacks) up to a certain height, as general defense against any DPoW attacks
* More secure + private TLS 1.3 implementation
* Switched to WolfSSL 4.5.0 instead of OpenSSL
* Nodes randomly choose between GCM-SHA384 and CHACHA20-POLY1305-SHA256 when
making connections to other nodes.
* Faster release binaries with -03
* Optimized and hardened memory pool code
* getblocktemplate RPC now provides better error reporting about whether there
are no peers or if it's not in sync
* Removed more Sprout code, which is tightly mixed into deep internals,
resulting in increased compile speed and reduced memory overhead
* New P2P protocol version. Peers only talk to 3.5.x nodes and newer
-- Hush Core <myhushteam@gmail.com> Fri, 18 Dec 2020 02:07:35 -0700
hush (3.5.2) stable; urgency=low
* Re-released hushd under the GNU Public License Version 3 (GPLv3)
* The z_listreceivedaddress RPC now returns a memoStr key for the utf8 string
representation of a shielded memo, if it exists
-- Hush Core <myhushteam@gmail.com> Thu, 22 Oct 2020 16:16:19 -0700
hush (3.5.1) stable; urgency=low
* TLS 1.3 support ported from ZEN with custom Hush tweaks
* All nodes will try using encrypted TLS connections with peers by default
* getinfo now returns a tls_connections key in JSON data
* -tls=only can be used to only use encrypted connections
* ASN map filtering of peers, ported from KMD + BTC Core
-- Hush Core <myhushteam@gmail.com> Tue, 06 Oct 2020 07:43:47 -0700
hush (3.5.0) stable; urgency=medium
* Finalize changes to support new Blocktime of 75 seconds
* Updated the Hush Halving schedule, i.e. Emission Curve, for the next ~120
years (the next 30 halvings)
* The Hush Block Reward will go to zero at Block 50740000 in the year 2140
* Greatly improved Sietch implementation with "amnesia zdust" addresses
* Sietch zdust outputs now always contain "random/encrypted" data
* -wallet CLI option supports wallets outside the datadir and relative paths
* -txsend CLI option ported from Zcash upstream to help with i2p integration
* Improved aarch64 support for Raspberry Pi 4
* Removed the proton optional dependency
* GetAdjustedTime() replaced with GetTime()
* Correctly keep track of ChainShieldedSpends for z_getchaintxstats
* timeoffset key in getpeerinfo and getnetworkifo deprecated and now always 0
* More remnants of dead Sprout/JoinSplit code removed
* Added a z_listreceivedaddress RPC which internals never had RPC access
* Fixes and improvements to deletetx=1, still considered experimental
* Checkpoints updated up to Block 300K
-- Hush Core <myhushteam@gmail.com> Wed, 23 Sep 2020 22:03:17 -0700
hush (3.4.0) stable; urgency=high
* New Season 4 KMD Notary pubkeys have been updated (as of Block 245555)
* ENFORCED PRIVACY (aka z2z) merged & set to take effect at Block 340000
* All remaining internals code relating to Sprout has been deleted
* The new Subatomic Dapp has been ported from KMD, which supports z2z swaps
* Implemented own mirror of Boost in our build system
* Merged various fixes relating to CryptoConditions from KMD upstream
* Optimizations and bug fixes to Sapling Consolidation
* Fixes CVE-2018-20586 from KMD (which ported it from BTC)
* Added z_getnotescount RPC
* Updated ccache dependency to 3.7.9
* Ported the -txexpirynotify CLI option from ZEC upstream
* Added rescan RPC for wallets to initiate a rescan without importing a key
and without restarting
-- Hush Core <myhushteam@gmail.com> Thu, 18 Jun 2020 09:35:31 -0700
hush (3.3.2) stable; urgency=medium
* ARMv8 support added
* Sapling Zaddr Consolidation, which reduces the size of wallets and
increases performance for service providers
* New CLI options added to hushd - refer to release notes for specifics
* New RPCs: z_getinfo, z_listsentbyaddress, z_listreceivedbyaddress,
getalldata
* New -opretmintxfee ported from KMD upstream
* ThreadNotifyWallets refactor ported from ZEC upstream
* Deletion of libsnark internal library
* Shielded index (zindex) statistics of coinbase and organic
transactions/payments corrected
* Updated dependencies: curl, boost, native_ccache, openssl, and proton
* Removed more Sprout-only RPC's (zcbenchmark, zcrawjoinsplit) and code
* Various improvements to RPC documentation
-- Hush Core <myhushteam@gmail.com> Wed, 08 Apr 2020 12:21:44 -0700
hush (3.3.1) stable; urgency=low
* Maintenance release fixes a non-consensus bug in sendmany which prevented
it from working.
-- Hush Core <myhushteam@gmail.com> Sat, 18 Jan 2020 09:16:21 -0700
hush (3.3.0) stable; urgency=high
* New "Sietch" functionality protects against new metadata attacks
* New ability to launch Hush Smart Chains with a single command
* Fixes CVE-2019-18936 in UniValue dependency: bitcoin/bitcoin#17742
* New experimental Shielded Index (-zindex) which keeps track of many stats
seen via the new getchaintxstats RPC including shielded payments,
anonymity set size and many other things.
* New experimental z_listnullifiers RPC which returns Sapling nullifiers.
* Updates + fixes to all CryptoConditions smart contracts from KMD 0.5.0
* Updates NSPV/Superlite code from KMD 0.5.0
* Update 3rd party KMD Notary node pubkeys moving Hush from a run-time
fork of KMD to a source code fork
* Enable creation of z-only (like Pirate) Hush Smart Chains via -ac_private=1
* Removed more Sprout-specific code, making hushd faster & easier to maintain
* Allow hush-cli stop to be run during RPC warmup
* Update to libsodium 1.0.18
* Removes VerusHash from the source code
* Removed large amounts of Proof-of-Stake-related code not used in Hush
* Ported AFL fuzzing features to our build system from Zcash
* Changed max debug.log size from 10MB to 100MB
* Added checkpoints for every 1000th Hush block
* New contrib/checkpoints.pl script to automatically generate checkpoints
* Deleted QT wallet code inherited from Bitcoin, which was old and broken
* z_exportwallet can now optionally not rescan
* New SHA256 SSE4 routines ported from KMD (which was ported from BTC),
enabled with --enable-experimental-asm=yes
* debug.log no longer containts a log2_stake column
* New --hardfork-height CLI option for devs+notaries for testing
-- Hush Core <myhushteam@gmail.com> Fri, 03 Jan 2020 10:13:17 -0700
hush (3.2.3) stable; urgency=low
* Update build dependencies to use own forks of libgmp, libsnark, libsodium
* New RPC keys are now returned in getblockchaininfo : longestchain and
notarized which are now used by the SDL backend
-- Hush Core <myhushteam@gmail.com> Sat, 14 Dec 2019 04:59:59 -0700
hush (3.2.2) stable; urgency=medium
* Fix CVE-2017-18350 from ZEC and windows portability fix from KMD upstream
* Removed some Sprout code
* Fixed some rare edge case bugs in Sapling param finding code
* New detection of "corrupt" Sapling params (invalid sizes) to helps give
users the correct error in a GUI wallet (corrupt versus no params)
* Fix Sapling params to support Mac DMGs being installed to /Applications
-- Hush Core <myhushteam@gmail.com> Tue, 26 Nov 2019 12:17:17 -0700
hush (3.2.1) stable; urgency=low
* Fixes issues discovered in Hush 3.2.0
* New DEVELOPING.md document for advice working on Hush codebase
* Updated to latest upstream SuperLite/nSPV features
* Merged in latest cryptocondition/Antara module updates from KMD upstream
* Fixed a bug that corrupts the block index on second startup
* Improved code to locate installed Sapling params, since Debian packages
install them into /usr/share/hush
* Updated DNSSeeds
* Fix fees associated with transactions in the mempool with fSkipExpiry=0
-- Hush Core <myhushteam@gmail.com> Tue, 29 Oct 2019 22:34:35 -0700
hush (3.2.0) stable; urgency=medium
* 3.2.0.1 release.

View File

@@ -1 +1 @@
9
13

View File

@@ -13,4 +13,6 @@ Vcs-Browser: https://git.hush.is/hush/hush3
Package: hush
Architecture: amd64 arm64
Depends: ${shlibs:Depends}
Description: Hush cryptocoin full node. Speak And Transact Freely. Hush inherits from Bitcoin Protocol and Zcash Protocol and is focused on private communications.
Description: Cryptocoin full node for Hush
Speak And Transact Freely with Hush, which inherits from Bitcoin Protocol and
Zcash Protocol and is focused on private communications.

View File

@@ -1,5 +1,5 @@
Files: *
Copyright: 2016-2020, The Hush developers
Copyright: 2016-2024, The Hush developers
2009-2016, Bitcoin Core developers
License: GPLv3
Comment: https://hush.is

View File

@@ -1 +1 @@
DEBIAN/examples/zcash.conf
DEBIAN/examples/HUSH3.conf

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright (c) 2016-2024 The Hush developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -12,9 +12,6 @@
155.138.228.68
107.174.70.251
# hush_scanner uses nc which cannot deal with these
# 56wqzfj6mhxgsv3h3nh3pdocguogxfxud55libqjhjsdh5alfsko2iqd.onion
# hushv3h6mbxd2pptj42reko3jcexcgnz5zvp3mqcu6myto3jhhn4yzyd.onion
# hushv3xvheqh42ms3ld2nh555muscietkib7gycb7s4psbrjsysfywqd.onion
# iljqq7nnmw2ij2ezl334cerwwmgzmmbmoc3n4saditd2xhi3xohq.b32.i2p
# [2a0c:b641:6f1:34::2]
# [2a0c:b641:6f1:c::2]
@@ -28,8 +25,3 @@ node5.hush.is
node6.hush.is
node7.hush.is
node8.hush.is
node1.hush.land
node2.hush.land
node3.hush.land
node4.hush.land
node5.hush.land

View File

@@ -8,7 +8,11 @@
use warnings;
use strict;
my $hush = "./src/hush-cli";
# call this script like this to generate checkpoints for a HAC such as DragonX:
# CLI=./src/dragonx-cli ./contrib/sdl_checkpoints.pl ...
my $hush = $ENV{CLI} || "./src/hush-cli";
my $gethash = "$hush getblockhash";
my $gettree = "$hush getblockmerkletree";
my $start = shift || 300000;

View File

@@ -1,17 +1,14 @@
# node1.hush.land
91.208.127.81
# node1.hush.is
103.69.128.148
# node2.hush.land
87.251.76.166
# node2.hush.is
194.29.100.179
# node3.hush.land
45.82.68.233
# node3.hush.is
45.132.75.69
# node4.hush.land
87.251.76.33
# node5.hush.land
178.250.189.141
# node4.hush.is
170.205.39.39
# lite.hushpool.is
149.28.102.219
@@ -22,14 +19,20 @@
# wtfistheinternet.hush.is
107.174.70.251
# arrakis.hush.is
178.250.189.141
# torv3
56wqzfj6mhxgsv3h3nh3pdocguogxfxud55libqjhjsdh5alfsko2iqd.onion
hushv3h6mbxd2pptj42reko3jcexcgnz5zvp3mqcu6myto3jhhn4yzyd.onion
hushv3xvheqh42ms3ld2nh555muscietkib7gycb7s4psbrjsysfywqd.onion
b2dln7mw7ydnuopls444tuixujhcw5kn5o22cna6gqfmw2fl6drb5nad.onion
dslbaa5gut5kapqtd44pbg65tpl5ydsamfy62hjbldhfsvk64qs57pyd.onion
vsqdumnh5khjbrzlxoeucbkiuaictdzyc3ezjpxpp2ph3gfwo2ptjmyd.onion
# ipv6
2a0c:b641:6f1:34::2
2a0c:b641:6f1:c::2
2a0c:b641:6f1:18e::2
2406:ef80:3:1269::1
2406:ef80:2:3b59::1
2406:ef80:1:146e::1
2406:ef80:4:2132::1
# i2p
7oumuppuzgbzlkahavx7qrtjnvbhkixjqdmeg7f6fhndgfhz7mlq.b32.i2p

24
debug-build.sh Executable file
View File

@@ -0,0 +1,24 @@
#!/usr/bin/env bash
# Copyright (c) 2016-2024 The 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
echo "Compiling a debug build with --enable-debug..."
# run correct build script for detected OS
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
# TODO: we only have debug builds on linux for now
CONFIGURE_FLAGS=--enable-debug ./util/debug-build.sh --disable-tests $@
elif [[ "$OSTYPE" == "darwin"* ]]; then
# code from ./util/build.sh needs to be ported to support --disable-tests
#./util/build-mac.sh --disable-tests $@
CONFIGURE_FLAGS=--enable-debug ./util/build-mac.sh $@
elif [[ "$OSTYPE" == "msys"* ]]; then
CONFIGURE_FLAGS=--enable-debug ./util/build-win.sh --disable-tests $@
elif [[ "$OSTYPE" == "freebsd"* ]]; then
CONFIGURE_FLAGS=--enable-debug ./util/build.sh --disable-tests $@
else
echo "Unable to detect your OS. What are you using?"
fi

View File

@@ -7,7 +7,7 @@ $(package)_sha256_hash=59c9b274bc451cf91a9ba1dd2c7fdcaf5d60b1b3aa83f2c9fa143417c
$(package)_download_path=https://git.hush.is/attachments
$(package)_file_name=7b13759e-8623-4e48-ae08-f78502f4b6a5
$(package)_download_file=7b13759e-8623-4e48-ae08-f78502f4b6a5
$(package)_patches=fix-Solaris.patch
$(package)_patches=fix-Solaris.patch ignore_wnonnull_gcc_11.patch range_enums_clang_16.patch
define $(package)_set_vars
$(package)_config_opts_release=variant=release
@@ -32,7 +32,9 @@ endef
define $(package)_preprocess_cmds
echo "using $(boost_toolset_$(host_os)) : : $($(package)_cxx) : <cxxflags>\"$($(package)_cxxflags) $($(package)_cppflags)\" <linkflags>\"$($(package)_ldflags)\" <archiver>\"$(boost_archiver_$(host_os))\" <striper>\"$(host_STRIP)\" <ranlib>\"$(host_RANLIB)\" <rc>\"$(host_WINDRES)\" : ;" > user-config.jam&& \
patch -p1 < $($(package)_patch_dir)/fix-Solaris.patch
patch -p1 < $($(package)_patch_dir)/fix-Solaris.patch &&\
patch -p2 < $($(package)_patch_dir)/ignore_wnonnull_gcc_11.patch &&\
patch -p2 < $($(package)_patch_dir)/range_enums_clang_16.patch
endef
define $(package)_config_cmds

View File

@@ -13,7 +13,7 @@ define $(package)_preprocess_cmds
endef
define $(package)_set_vars
$(package)_config_opts=--disable-shared --disable-openssl --disable-libevent-regress
$(package)_config_opts=--disable-shared --disable-openssl --disable-libevent-regress --disable-samples
$(package)_config_opts_release=--disable-debug-mode
$(package)_config_opts_linux=--with-pic
endef

View File

@@ -8,22 +8,25 @@ $(package)_sha256_hash=67df06ed50f288bd7b1ec6907973684fb7cf1196f2cb368b59d423e42
$(package)_git_commit=42ba95387cdfd67399f7aac52fddb8d6e1258ee6
$(package)_dependencies=
$(package)_config_opts=--enable-cxx --disable-shared
else ifeq ($(build_os),darwin)
else
#else ifeq ($(build_os),darwin)
$(package)_version=6.1.1
$(package)_download_path=https://git.hush.is/attachments
$(package)_file_name=d613c855-cd92-4efb-b893-658496852019
$(package)_download_file=d613c855-cd92-4efb-b893-658496852019
$(package)_sha256_hash=a8109865f2893f1373b0a8ed5ff7429de8db696fc451b1036bd7bdf95bbeffd6
$(package)_config_opts=--enable-cxx --disable-shared
else
$(package)_version=6.1.1
$(package)_download_path=https://ftp.gnu.org/gnu/gmp
$(package)_file_name=gmp-$($(package)_version).tar.bz2
$(package)_sha256_hash=a8109865f2893f1373b0a8ed5ff7429de8db696fc451b1036bd7bdf95bbeffd6
$(package)_dependencies=
$(package)_config_opts=--enable-cxx --disable-shared
endif
#else
#$(package)_version=6.1.1
#$(package)_download_path=https://ftp.gnu.org/gnu/gmp
#$(package)_file_name=gmp-$($(package)_version).tar.bz2
#$(package)_sha256_hash=a8109865f2893f1373b0a8ed5ff7429de8db696fc451b1036bd7bdf95bbeffd6
#$(package)_dependencies=
#$(package)_config_opts=--enable-cxx --disable-shared
#endif
define $(package)_config_cmds
$($(package)_autoconf) --host=$(host) --build=$(build)
endef

View File

@@ -1,13 +1,19 @@
package=wolfssl
ifeq ($(host_os),mingw32)
# this is the highest version known to compile on windows
$(package)_version=4.8.1
$(package)_file_name=wolfssl-$($(package)_version).tar.gz
$(package)_sha256_hash=50db45f348f47e00c93dd244c24108220120cb3cc9d01434789229c32937c444
else
$(package)_version=5.2.0
# BEWARE: Updating this version could cause weird bugs where nodes
# hang after a few days or do not respond to the "stop" RPC . 5.2.0
# definitely has problems, versions between 4.8.1 and 5.2.0 have not
# been tested yet. Make sure to do extensive testing when changing this
# package version
$(package)_version=4.8.1
$(package)_file_name=wolfssl-$($(package)_version).tar.gz
$(package)_sha256_hash=409b4646c5f54f642de0e9f3544c3b83de7238134f5b1ff93fb44527bf119d05
$(package)_sha256_hash=50db45f348f47e00c93dd244c24108220120cb3cc9d01434789229c32937c444
endif
$(package)_download_path=https://github.com/wolfSSL/wolfssl/archive

View File

@@ -0,0 +1,68 @@
diff --git a/include/boost/concept/detail/general.hpp b/include/boost/concept/detail/general.hpp
index eeb08750..8d7d6f69 100644
--- a/include/boost/concept/detail/general.hpp
+++ b/include/boost/concept/detail/general.hpp
@@ -28,7 +28,14 @@ namespace detail
template <class Model>
struct requirement
{
+# if defined(BOOST_GCC) && (BOOST_GCC >= 110000)
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wnonnull"
+# endif
static void failed() { ((Model*)0)->~Model(); }
+# if defined(BOOST_GCC) && (BOOST_GCC >= 110000)
+# pragma GCC diagnostic pop
+# endif
};
struct failed {};
@@ -36,7 +43,14 @@ struct failed {};
template <class Model>
struct requirement<failed ************ Model::************>
{
+# if defined(BOOST_GCC) && (BOOST_GCC >= 110000)
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wnonnull"
+# endif
static void failed() { ((Model*)0)->~Model(); }
+# if defined(BOOST_GCC) && (BOOST_GCC >= 110000)
+# pragma GCC diagnostic pop
+# endif
};
# ifdef BOOST_OLD_CONCEPT_SUPPORT
@@ -44,7 +58,14 @@ struct requirement<failed ************ Model::************>
template <class Model>
struct constraint
{
+# if defined(BOOST_GCC) && (BOOST_GCC >= 110000)
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wnonnull"
+# endif
static void failed() { ((Model*)0)->constraints(); }
+# if defined(BOOST_GCC) && (BOOST_GCC >= 110000)
+# pragma GCC diagnostic pop
+# endif
};
template <class Model>
diff --git a/include/boost/concept/usage.hpp b/include/boost/concept/usage.hpp
index 373de63a..fe88b5f5 100644
--- a/include/boost/concept/usage.hpp
+++ b/include/boost/concept/usage.hpp
@@ -13,7 +13,14 @@ namespace boost { namespace concepts {
template <class Model>
struct usage_requirements
{
+# if defined(BOOST_GCC) && (BOOST_GCC >= 110000)
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wnonnull"
+# endif
~usage_requirements() { ((Model*)0)->~Model(); }
+# if defined(BOOST_GCC) && (BOOST_GCC >= 110000)
+# pragma GCC diagnostic pop
+# endif
};
# if BOOST_WORKAROUND(__GNUC__, <= 3)

View File

@@ -0,0 +1,75 @@
diff --git a/include/boost/numeric/conversion/detail/int_float_mixture.hpp b/include/boost/numeric/conversion/detail/int_float_mixture.hpp
index 464e527..7690d07 100644
--- a/include/boost/numeric/conversion/detail/int_float_mixture.hpp
+++ b/include/boost/numeric/conversion/detail/int_float_mixture.hpp
@@ -16,15 +16,15 @@
#include "boost/numeric/conversion/int_float_mixture_enum.hpp"
#include "boost/numeric/conversion/detail/meta.hpp"
-#include "boost/mpl/integral_c.hpp"
+#include "boost/type_traits/integral_constant.hpp"
namespace boost { namespace numeric { namespace convdetail
{
// Integral Constants for 'IntFloatMixture'
- typedef mpl::integral_c<int_float_mixture_enum, integral_to_integral> int2int_c ;
- typedef mpl::integral_c<int_float_mixture_enum, integral_to_float> int2float_c ;
- typedef mpl::integral_c<int_float_mixture_enum, float_to_integral> float2int_c ;
- typedef mpl::integral_c<int_float_mixture_enum, float_to_float> float2float_c ;
+ typedef boost::integral_constant<int_float_mixture_enum, integral_to_integral> int2int_c ;
+ typedef boost::integral_constant<int_float_mixture_enum, integral_to_float> int2float_c ;
+ typedef boost::integral_constant<int_float_mixture_enum, float_to_integral> float2int_c ;
+ typedef boost::integral_constant<int_float_mixture_enum, float_to_float> float2float_c ;
// Metafunction:
//
diff --git a/include/boost/numeric/conversion/detail/sign_mixture.hpp b/include/boost/numeric/conversion/detail/sign_mixture.hpp
index c7f9e42..fde1584 100644
--- a/include/boost/numeric/conversion/detail/sign_mixture.hpp
+++ b/include/boost/numeric/conversion/detail/sign_mixture.hpp
@@ -16,15 +16,15 @@
#include "boost/numeric/conversion/sign_mixture_enum.hpp"
#include "boost/numeric/conversion/detail/meta.hpp"
-#include "boost/mpl/integral_c.hpp"
+#include "boost/type_traits/integral_constant.hpp"
namespace boost { namespace numeric { namespace convdetail
{
// Integral Constants for 'SignMixture'
- typedef mpl::integral_c<sign_mixture_enum, unsigned_to_unsigned> unsig2unsig_c ;
- typedef mpl::integral_c<sign_mixture_enum, signed_to_signed> sig2sig_c ;
- typedef mpl::integral_c<sign_mixture_enum, signed_to_unsigned> sig2unsig_c ;
- typedef mpl::integral_c<sign_mixture_enum, unsigned_to_signed> unsig2sig_c ;
+ typedef boost::integral_constant<sign_mixture_enum, unsigned_to_unsigned> unsig2unsig_c ;
+ typedef boost::integral_constant<sign_mixture_enum, signed_to_signed> sig2sig_c ;
+ typedef boost::integral_constant<sign_mixture_enum, signed_to_unsigned> sig2unsig_c ;
+ typedef boost::integral_constant<sign_mixture_enum, unsigned_to_signed> unsig2sig_c ;
// Metafunction:
//
diff --git a/include/boost/numeric/conversion/detail/udt_builtin_mixture.hpp b/include/boost/numeric/conversion/detail/udt_builtin_mixture.hpp
index 36dbc49..a39d29f 100644
--- a/include/boost/numeric/conversion/detail/udt_builtin_mixture.hpp
+++ b/include/boost/numeric/conversion/detail/udt_builtin_mixture.hpp
@@ -15,15 +15,15 @@
#include "boost/numeric/conversion/udt_builtin_mixture_enum.hpp"
#include "boost/numeric/conversion/detail/meta.hpp"
-#include "boost/mpl/integral_c.hpp"
+#include "boost/type_traits/integral_constant.hpp"
namespace boost { namespace numeric { namespace convdetail
{
// Integral Constants for 'UdtMixture'
- typedef mpl::integral_c<udt_builtin_mixture_enum, builtin_to_builtin> builtin2builtin_c ;
- typedef mpl::integral_c<udt_builtin_mixture_enum, builtin_to_udt> builtin2udt_c ;
- typedef mpl::integral_c<udt_builtin_mixture_enum, udt_to_builtin> udt2builtin_c ;
- typedef mpl::integral_c<udt_builtin_mixture_enum, udt_to_udt> udt2udt_c ;
+ typedef boost::integral_constant<udt_builtin_mixture_enum, builtin_to_builtin> builtin2builtin_c ;
+ typedef boost::integral_constant<udt_builtin_mixture_enum, builtin_to_udt> builtin2udt_c ;
+ typedef boost::integral_constant<udt_builtin_mixture_enum, udt_to_builtin> udt2builtin_c ;
+ typedef boost::integral_constant<udt_builtin_mixture_enum, udt_to_udt> udt2udt_c ;
// Metafunction:
//

View File

@@ -89,6 +89,41 @@ After successfully compiling Hush, you can generate a debian package of these bi
This command will not work on Mac OS X. Currently you cannot generate a Debian package
from operating systems other than Linux. Oh well.
## Adding new CLI options that change consensus rules
If you are adding a new CLI option that changes consensus rules such as
`-ac_foo` then make sure to also modify the the `extraptr` variable in
`src/hush_utils.h` with the value of the `ASSETCHAINS_FOO` variable. Our
convention is that if a CLI option affects consensus, it MUST begin with `-ac_`
and if it does not affect consensus (such as -datadir) then it MUST NOT begin
with `-ac_`. Originally the `ac` meant "asset chain" but now it means "affects
consensus" or "arrakis chain", take your pick.
The reason for this is the `extraptr` variable is used to deterministically
generate the "chain magic" `ASSETCHAINS_MAGIC` as well as the default p2p and
rpc ports for a HAC. This means that if two HACs have *exactly* the same
consensus options except for `-ac_foo` (even if they have the same `-ac_name`)
then they will still get different chain magic values and p2p and rpc ports.
This is a way of preventing HACs with different consensus rules from trying to
talk with each other when they should not. For instance, if you make a HAC with
`-ac_name=MYCOIN` on one machine with one set of consensus rules and then
another HAC with the same name on a different machine but with different
consensus rules, the chain magic being different (as well as the default p2p
port) are ways to prevent them from communicating. This is good because these
two HACs will eventually chain fork due to their different consensus rules and
ban each other, wasting time, bandwidth and sanity.
An example of doing this can be seen in the commit
https://git.hush.is/hush/hush3/commit/d39503c13b7419620d138050899705ced557eef9
which added the `-ac_burn` consensus changing option.
The chain magic value is the CRC32 checksum of every non-default consensus
option the HAC uses.
Also make sure to actually validate the new consensus option! That is probably
going to happen in `src/main.cpp` . If you don't, a malicious node can just
modify `src/miner.cpp` to do whatever they want.
## Updates to this document
If you think something else should be in this guide, please send your suggestions!

View File

@@ -1,4 +0,0 @@
BIPs that are implemented by Hush (up-to-date up to **v1.1.0**):
* Numerous historic BIPs were present in **v1.0.0** at launch; see [the protocol spec](https://github.com/zcash/zips/blob/master/protocol/protocol.pdf) for details.
* [`BIP 111`](https://github.com/bitcoin/bips/blob/master/bip-0111.mediawiki): `NODE_BLOOM` service bit added, but only enforced for peer versions `>=170004` as of **v1.1.0** ([PR #2814](https://github.com/zcash/zcash/pull/2814)).

View File

@@ -106,10 +106,7 @@ details.
## CJDNS-related information in Hush
There are several ways to see your CJDNS address in Hush:
- in the "Local addresses" output of CLI `-netinfo`
- in the "localaddresses" output of RPC `getnetworkinfo`
To see which CJDNS peers your node is connected to, use `hush-cli -netinfo 4`
or the `getpeerinfo` RPC (i.e. `hush-cli getpeerinfo`).
You can use the `getnodeaddresses` RPC to fetch a number of CJDNS peers known to your node; run `hush-cli help getnodeaddresses` for details.
To see which CJDNS peers your node is connected to, use `hush-cli getpeerinfo`
RPC.

View File

@@ -18,8 +18,8 @@ git checkout dev
Then install needed dependencies. This is different on each OS as well as
older or newer systems. See https://git.hush.is/hush/hush3/src/branch/dev/INSTALL.md for
details on installing dependencies. If you are using a recent-ish Linux distro, this
is probably what you need:
details on installing dependencies. If you are using a recent-ish Ubuntu or Debian Linux
distro, this is probably what you need:
```
# install build dependencies

52
doc/help.md Normal file
View File

@@ -0,0 +1,52 @@
# How To Fix Various Problems
This document will document how to recover and fix various issues that users may run into.
## Database corruption
The problem: You see an error like
```
EXCEPTION: 15dbwrapper_error
Database corrupted
```
This means your blockchain data on disk is corrupted. This is not the same as wallet corruption.
The fix to this is to do a fresh sync using the same wallet.dat file. You need to find
where this data lives on your computer and then move some files around, then restart the wallet.
### On Linux
If you are on Linux, your wallet lives at `~/.hush/HUSH3/wallet.dat` or if you have a really old
legacy wallet it could be at `~/.komodo/HUSH3/wallet.dat` . We will assume the first location.
What we will do is backup your entire `HUSH3` directory, including the blockchain data and wallet,
then copy the wallet from there into a new directory. This is a non-destructive process that creates
a new backup of your wallet.
```
# Make sure your node is not running before doing any of this!
# Doing this while your node is running could corrupt your wallet.dat
cd ~/.hush
mv HUSH3 HUSH3-backup # backup all data
mkdir HUSH3 # make a new dir
cp HUSH3-backup/wallet.dat HUSH3/wallet.dat # copy old wallet to new dir
```
At this point if you are GUI user using SilentDragon, you can restart the GUI wallet
and it should perform a fresh sync with your wallet. This will likely take at least
a few hours or much longer depending on your internet connection.
### On Windows
Basically you want to find where your Hush wallet is, move the directory that contains
that wallet.dat file to a new name, then create that same directory and then copy wallet.dat into it.
Different versions of Windows store things in different locations.
For example your wallet might be in `C:\Users\Admin\AppData\Roaming\Hush\HUSH3\wallet.dat` .
That means you need to
* Rename the directory `C:\Users\Admin\AppData\Roaming\Hush\HUSH3` to something like `C:\Users\Admin\AppData\Roaming\Hush\HUSH3-backup`
* Create a new directory called `C:\Users\Admin\AppData\Roaming\Hush\HUSH3`
* Copy the file `C:\Users\Admin\AppData\Roaming\Hush\HUSH3-backup\wallet.dat` to `C:\Users\Admin\AppData\Roaming\Hush\HUSH3`
* Now start the SilentDragon GUI wallet

View File

@@ -1,10 +1,10 @@
# Hush Smart Chains
# Hush Arrakis Chains
An overview of HSCs can be found here:
https://git.hush.is/hush/hush-smart-chains
Hush Smart Chains allow you to create a privacy coin with no custom C++ code, just running one command!
Hush Arrakis Chains allow you to create a privacy coin with no custom C++ code, just running one command!
The new coin that is created can use either Equihash PoW (ASIC or GPU) or RandomX PoW (CPU).
## HSC Creator
@@ -13,7 +13,7 @@ https://git.hush.is/hush/hsc-creator with its site https://hush.is/hsc-creator
## HSC HOWTO
https://git.hush.is/onryo/hush-smart-chain-how-to
https://git.hush.is/onryo/hush-arrakis-chain-how-to
## HSC CLI

BIN
doc/hush/earnhush.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

BIN
doc/hush/hush0.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@@ -100,15 +100,11 @@ address.
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`)
- in the i2p/i2pd web console under "SAM Sessions"
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`
To see which I2P peers your node is connected to, use `hush-cli getpeerinfo`
RPC.
## Compatibility

View File

@@ -1,9 +1,9 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH HUSH-CLI "1" "February 2024" "hush-cli v3.10.2" "User Commands"
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.13.
.TH HUSH-CLI "1" "July 2025" "hush-cli v3.10.4" "User Commands"
.SH NAME
hush-cli \- manual page for hush-cli v3.10.2
hush-cli \- manual page for hush-cli v3.10.4
.SH DESCRIPTION
Hush RPC client version v3.10.2\-138cd7ab6
Hush RPC client version v3.10.4\-7e63e2f01\-dirty
.PP
In order to ensure you are adequately protecting your privacy when using Hush,
please see <https://hush.is/security/>.
@@ -75,7 +75,7 @@ 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 <https://hush.is/security/>.
Copyright (C) 2016-2024 Duke Leto and The Hush Developers
Copyright (C) 2016-2025 Duke Leto and The Hush Developers
Copyright (C) 2016-2020 jl777 and SuperNET developers

View File

@@ -1,9 +1,9 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH HUSH-TX "1" "February 2024" "hush-tx v3.10.2" "User Commands"
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.13.
.TH HUSH-TX "1" "July 2025" "hush-tx v3.10.4" "User Commands"
.SH NAME
hush-tx \- manual page for hush-tx v3.10.2
hush-tx \- manual page for hush-tx v3.10.4
.SH DESCRIPTION
hush\-tx utility version v3.10.2\-138cd7ab6
hush\-tx utility version v3.10.4\-7e63e2f01\-dirty
.SS "Usage:"
.TP
hush\-tx [options] <hex\-tx> [commands]
@@ -89,7 +89,7 @@ Set register NAME to given JSON\-STRING
In order to ensure you are adequately protecting your privacy when using Hush,
please see <https://hush.is/security/>.
Copyright (C) 2016-2024 Duke Leto and The Hush Developers
Copyright (C) 2016-2025 Duke Leto and The Hush Developers
Copyright (C) 2016-2020 jl777 and SuperNET developers

View File

@@ -1,9 +1,9 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH HUSHD "1" "February 2024" "hushd v3.10.2" "User Commands"
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.13.
.TH HUSHD "1" "July 2025" "hushd v3.10.4" "User Commands"
.SH NAME
hushd \- manual page for hushd v3.10.2
hushd \- manual page for hushd v3.10.4
.SH DESCRIPTION
Hush Daemon version v3.10.2\-138cd7ab6
Hush Daemon version v3.10.4\-7e63e2f01\-dirty
.PP
In order to ensure you are adequately protecting your privacy when using Hush,
please see <https://hush.is/security/>.
@@ -78,7 +78,7 @@ applied)
.HP
\fB\-par=\fR<n>
.IP
Set the number of script verification threads (\fB\-12\fR to 16, 0 = auto, <0 =
Set the number of script verification threads (\fB\-8\fR to 16, 0 = auto, <0 =
leave that many cores free, default: 0)
.HP
\fB\-pid=\fR<file>
@@ -245,6 +245,11 @@ Disable Ipv4 network connections (default: 0)
.IP
Disable Ipv6 network connections (default: 0)
.HP
\fB\-clearnet\fR
.IP
Enable clearnet connections. Setting to 0 will disable clearnet and use
sane defaults for Tor/i2p (default: 1)
.HP
\fB\-permitbaremultisig\fR
.IP
Relay non\-P2SH multisig (default: 1)
@@ -395,11 +400,6 @@ Keep the last <n> transactions (default: 200)
.IP
Keep transactions for at least <n> blocks (default: 10000)
.HP
\fB\-opretmintxfee=\fR<amt>
.IP
Minimum fee (in HUSH/kB) to allow for OP_RETURN transactions (default:
400000)
.HP
\fB\-paytxfee=\fR<amt>
.IP
Fee (in HUSH/kB) to add to transactions you send (default: 0.00)
@@ -674,6 +674,14 @@ Block time in seconds, default is 60
.IP
BEAM integration
.HP
\fB\-ac_burn\fR
.IP
Allow sending funds to the transparent burn address when \fB\-ac_private\fR=\fI\,1\/\fR
.HP
\fB\-ac_minopreturnfee\fR
.IP
OP_RETURN minimum fee per tx, regardless of tx size, default is 1 coin
.HP
\fB\-ac_coda\fR
.IP
CODA integration
@@ -751,7 +759,7 @@ Enforce transaction\-rate limit, default 0
In order to ensure you are adequately protecting your privacy when using Hush,
please see <https://hush.is/security/>.
Copyright (C) 2016-2024 Duke Leto and The Hush Developers
Copyright (C) 2016-2025 Duke Leto and The Hush Developers
Copyright (C) 2016-2020 jl777 and SuperNET developers

View File

@@ -1,9 +1,9 @@
# RandomX
Hush Smart Chains support using RandomX as a Proof-Of-Work algorithm as of release 3.9.2 .
Hush Arrakis Chains support using RandomX as a Proof-Of-Work algorithm as of release 3.9.2 .
This means you can now launch a privacy coin with Hush tech that can be mined with a CPU
instead of requiring an ASIC or GPU. RandomX is the same algorithm that Monero (XMR) and
various other cryptocoins use. As far as we know, Hush Smart Chains are the first coins
various other cryptocoins use. As far as we know, Hush Arrakis Chains are the first coins
based on Zcash Protocol that can use the RandomX PoW algorithm. Many thanks to all the
people who helped make this possible.
@@ -13,12 +13,12 @@ The following command can be used to launch an HSC on a single computer. Each op
HSC CLI arguments that start with `-ac_` means they *Affect Consensus*.
```
./src/hush-smart-chain -ac_halving=100 -ac_algo=randomx -ac_name=RANDOMX -ac_private=1 -ac_blocktime=15 -ac_reward=500000000 -ac_supply=55555 -gen=1 -genproclimit=1 -testnode=1
./src/hush-arrakis-chain -ac_halving=100 -ac_algo=randomx -ac_name=RANDOMX -ac_private=1 -ac_blocktime=15 -ac_reward=500000000 -ac_supply=55555 -gen=1 -genproclimit=1 -testnode=1
```
* `hush-smart-chain` is the script used to launch or connect to HSCs
* `hush-arrakis-chain` is the script used to launch or connect to HSCs
* It lives in the `./src` directory, next to `hushd` and `hush-cli`
* It is called `hush-smart-chain.bat` on Windows
* It is called `hush-arrakis-chain.bat` on Windows
* `-ac_halving=100` means "the block reward halves every 100 blocks"
* `-ac_algo=randomx` means "use RandomX for Proof-Of-Work
* The default is Equihash (200,9)
@@ -41,12 +41,12 @@ HSC CLI arguments that start with `-ac_` means they *Affect Consensus*.
* One node would use
```
# first node
./src/hush-smart-chain -ac_halving=100 -ac_algo=randomx -ac_name=RANDOMX -ac_private=1 -ac_blocktime=15 -ac_reward=500000000 -ac_supply=55555
./src/hush-arrakis-chain -ac_halving=100 -ac_algo=randomx -ac_name=RANDOMX -ac_private=1 -ac_blocktime=15 -ac_reward=500000000 -ac_supply=55555
```
* And the second node would use:
```
# mining node. NOTE: This node will mine the genesis block and pre-mine, if any
./src/hush-smart-chain -ac_halving=100 -ac_algo=randomx -ac_name=RANDOMX -ac_private=1 -ac_blocktime=15 -ac_reward=500000000 -ac_supply=55555 -gen=1 -genproclimit=1
./src/hush-arrakis-chain -ac_halving=100 -ac_algo=randomx -ac_name=RANDOMX -ac_private=1 -ac_blocktime=15 -ac_reward=500000000 -ac_supply=55555 -gen=1 -genproclimit=1
```
# Advanced Options
@@ -67,7 +67,7 @@ HUSH RandomX currently has two advanced options that some may want to use:
This section is not required reading if you just want to use it as a PoW algorithm for an HSC. Here we will explain how the internals of RandomX works inside of the Hush codebase.
We use the official RandomX implementation from https://github.com/tevador/RandomX with custom configuration options. If some type of hardware is created to mine the XMR RandomX algorithm, it will not be compatible with the Hush RandomX algorithm. This is by design. All Hush Smart Chains use the same RandomX config options, so if a hardware device is created to mine one HSC that uses RandomX, it can be used to mine any HSC using RandomX. Every HSC with unique consensus parameters will start off with it's own unique key block with at least 9 bytes of entropy.
We use the official RandomX implementation from https://github.com/tevador/RandomX with custom configuration options. If some type of hardware is created to mine the XMR RandomX algorithm, it will not be compatible with the Hush RandomX algorithm. This is by design. All Hush Arrakis Chains use the same RandomX config options, so if a hardware device is created to mine one HSC that uses RandomX, it can be used to mine any HSC using RandomX. Every HSC with unique consensus parameters will start off with it's own unique key block with at least 9 bytes of entropy.
The source code of RandomX is embedded in the Hush source code at `./src/RandomX` and the configuration options used are at `./src/RandomX/src/configuration.h` .

View File

@@ -58,7 +58,7 @@ Look for Git issues that should be fixed in the next release. Especially low-ris
Install deps on Linux:
apt-get install help2man debchange
apt-get install help2man devscripts
## Release process
- If new seeds are being added or seeds are changing:
@@ -111,20 +111,24 @@ Install deps on Linux:
- 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
- Create an x86 Debian package for the release:
- Edit contrib/debian/changelog to add information about the new release
- 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
- Update the rpc.hush.is repo for new release by [following these instructions](https://git.hush.is/hush/rpc.hush.is/src/branch/master/README.md)
- Update https://faq.hush.is/rpc/ for new release after updating the rpc.hush.is repo
## 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.
Use `./util/build-debian-package.sh aarch64` to build a Debian package for aarch64 .
- Use `./util/build-mac.sh` to compile on Apple/Mac systems
- Use `./util/build-win.sh` to build on Windows
- Use [these cross compile instructions](https://git.hush.is/jahway603/hush-docs/src/branch/master/advanced/cross-compile-hush-full-node-to-aarch64-with-docker.md) to build the release for ARMv8 (aarch64) systems, as the current build system does not permit us to natively build this on the SBC device
- Then use `./util/build-debian-package.sh aarch64` to build a Debian package for ARMv8 (aarch64)
## Optional things

View File

@@ -8,7 +8,59 @@ and now are officially part of our Git repo.
Hush releases are on our own Gitea at <a href="https://git.hush.is/">git.hush.is</a>
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.
evil organizations. They also use all your "private" repos to train their AI.
# Hush 3.10.4 "Hazy Hākuturi"
This is an OPTIONAL but RECOMMENDED upgrade. Some seed nodes have changed so if you are having
problems finding nodes, you want to upgrade.
* `z_sendmany` changes:
* Now supports UTF8 strings as memos instead of requiring hex
* Give a memo as "utf8:this is my memo" and it will automatically be hex encoded
* New optional 5th argument to `z_sendmany` allows specifying an `OP_RETURN` for the transaction
* `OP_RETURN` can also be specified as a UTF8 string with 'utf8:' prefix or hex encoded
* Updated seed node list
* New CLI option -clearnet=0 which disables clearnet networking, i.e. only Tor or i2p are allowed
* Note that at least one of a Tor or i2p daemon are needed for -clearnet=0, both are not needed but supported
* -clearnet=0 is equivalent to the following CLI params:
```
-disableipv4=1
-disableipv6=1
-dns=0
-dnsseed=0
-bind=127.0.0.1
-onlynet="onion"
-onlynet="i2p"
-onion="127.0.0.1:9050
-i2psam="127.0.0.1:7656"
```
* Using -mineraddress with -clearnet=0 is disallowed since it would reduce privacy
* Add CLI options `-disableipv4` and `-disableipv6` which can be used to disable IPv4 or IPv6
* New HAC CLI consensus option `-ac_minopreturnfee`
* `OP_RETURN` minimum fee per tx, regardless of tx size, default is 1 coin, specified in puposhis
* Updated ASmap, which maps IP addresses to Autonomous System (AS) numbers
* Added ASmap health check, which logs stats about the ASmap once per 24 hours
* Improved cjdns/i2p/tor docs
* Updated protocol version
* Fixed warnings caused by newer compilers
# Hush 3.10.3 "Persistent Pezoporus"
* Use WolfSSL 4.8.1 which prevents nodes from getting stuck in general and when shutting down
* Set minimum fee to 0.1 HUSH per 1 KB of data if `OP_RETURN` is used.
* A feature in absurd fee that allows sending amount < fee, can be used only in a full node by advanced users.
* Fixed various bugs relating to lock ordering and missing locks
* Fixed RPC docs for addnode and disconnectnode having the incorrect port for HACs
* Value of DEBUG_LOCKORDER is now logged to debug.log on node startup
* New script ./debug-build.sh to make it easier to make debug builds
* DragonX nodes now have their own list of seed nodes
* Hush nodes now have their own protocol version which is independent from HACs
* Fixed off-by-one bug in `newSietchRecipient`
* Performance improvement to `ActivateBestChainStep` https://git.hush.is/hush/hush3/commit/ed86f2dd1da370fe2dbf7db475afc41b218cbc5f
* Improved navigation in README for new users.
* Updated doc/release-process.md to resolve Issue #407
* Added build.sh checks for as and ld to be installed to resolve Issue #73
# Hush 3.10.2 "Fiendish Fenrir"

View File

@@ -16,7 +16,6 @@ configure Tor.
## How to see information about your Tor configuration via Hush
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`)
@@ -27,9 +26,6 @@ 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

View File

@@ -1,43 +0,0 @@
#!/usr/usr/bin/env bash
# Copyright (c) 2016-2024 The 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
# coin between 2 assetchains on the same -ac_cc id
set -e
source=DERPZ
target=DERPZ000
address="Rxxx"
amount=1
# Alias for running cli on source chain
cli_source="hush-cli -ac_name=$source"
# Raw tx that we will work with
txraw=`$cli_source createrawtransaction "[]" "{\"$address\":$amount}"`
# Convert to an export tx
exportData=`$cli_source migrate_converttoexport $txraw $target $amount`
exportRaw=`echo $exportData | jq -r .exportTx`
exportPayouts=`echo $exportData | jq -r .payouts`
# Fund
exportFundedData=`$cli_source fundrawtransaction $exportRaw`
exportFundedTx=`echo $exportFundedData | jq -r .hex`
# Sign
exportSignedData=`$cli_source signrawtransaction $exportFundedTx`
exportSignedTx=`echo $exportSignedData | jq -r .hex`
# Send
echo "Sending export tx"
$cli_source sendrawtransaction $exportSignedTx
read -p "Wait for a notarization to HUSH, and then two more notarizations from the target chain, and then press enter to continue"
# Create import
importTx=`$cli_source migrate_createimporttransaction $exportSignedTx $payouts`
importTx=`hush-cli migrate_completeimporttransaction $importTx`
# Send import
hush-cli -ac_name=$target sendrawtransaction $importTx

View File

@@ -1,3 +1,4 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2024 The Hush developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,3 +1,4 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2024 The Hush developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,3 +1,4 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2024 The Hush developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,3 +1,4 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2024 The Hush developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,3 +1,4 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2024 The Hush developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,3 +1,4 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2024 The Hush developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,3 +1,4 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2024 The Hush developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,3 +1,4 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2024 The Hush developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@@ -1,3 +1,4 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2024 The Hush developers
# Copyright (c) 2015 The Bitcoin Core developers
# Distributed under the GPLv3 software license, see the accompanying

View File

@@ -162,10 +162,10 @@ class ComparisonTestFramework(BitcoinTestFramework):
def add_options(self, parser):
parser.add_option("--testbinary", dest="testbinary",
default=os.getenv("BITCOIND", "hush-smart-chain"),
default=os.getenv("BITCOIND", "hush-arrakis-chain"),
help="bitcoind binary to test")
parser.add_option("--refbinary", dest="refbinary",
default=os.getenv("BITCOIND", "hush-smart-chain"),
default=os.getenv("BITCOIND", "hush-arrakis-chain"),
help="bitcoind binary to use for reference nodes (if any)")
def setup_chain(self):

View File

@@ -251,7 +251,7 @@ LIBHUSH_H = \
obj/build.h: FORCE
@$(MKDIR_P) $(builddir)/obj
@$(top_srcdir)/share/genbuild.sh $(abs_top_builddir)/src/obj/build.h \
@$(top_srcdir)/util/genbuild.sh $(abs_top_builddir)/src/obj/build.h \
$(abs_top_srcdir)
libbitcoin_util_a-clientversion.$(OBJEXT): obj/build.h

View File

@@ -87,7 +87,7 @@ static int AppInitRPC(int argc, char* argv[])
ParseParameters(argc, argv);
std:string name;
// default HSC is HUSH3 itself, which to the internals, is also an HSC
// default HAC is HUSH3 itself, which to the internals, is also a HAC
name = GetArg("-ac_name","HUSH3");
if ( !name.empty() )

View File

@@ -74,30 +74,17 @@ void WaitForShutdown(boost::thread_group* threadGroup)
while (!fShutdown)
{
//fprintf(stderr,"call passport iteration\n");
if ( SMART_CHAIN_SYMBOL[0] == 0 )
{
if ( HUSH_NSPV_FULLNODE )
hush_passport_iteration();
for (i=0; i<10; i++)
{
fShutdown = ShutdownRequested();
if ( fShutdown != 0 )
break;
MilliSleep(1000);
}
} else {
//hush_longestchain();
if ( ASSETCHAINS_CBOPRET != 0 )
hush_cbopretupdate(0);
for (i=0; i<=ASSETCHAINS_BLOCKTIME/5; i++)
{
fShutdown = ShutdownRequested();
if ( fShutdown != 0 )
break;
MilliSleep(1000);
}
}
//hush_longestchain();
if ( ASSETCHAINS_CBOPRET != 0 )
hush_cbopretupdate(0);
for (i=0; i<=ASSETCHAINS_BLOCKTIME/5; i++)
{
fShutdown = ShutdownRequested();
if ( fShutdown != 0 )
break;
MilliSleep(1000);
}
fShutdown = ShutdownRequested();
}
//fprintf(stderr,"%s: fShutdown=%d\n", __FUNCTION__, fShutdown);

View File

@@ -47,49 +47,6 @@
#define SATOSHIDEN ((uint64_t)100000000L)
#define dstr(x) ((double)(x) / SATOSHIDEN)
#define CCDISABLEALL memset(ASSETCHAINS_CCDISABLES,1,sizeof(ASSETCHAINS_CCDISABLES))
#define CCENABLE(x) ASSETCHAINS_CCDISABLES[((uint8_t)x)] = 0
/* moved to hush_cJSON.h
#ifndef _BITS256
#define _BITS256
union _bits256 { uint8_t bytes[32]; uint16_t ushorts[16]; uint32_t uints[8]; uint64_t ulongs[4]; uint64_t txid; };
typedef union _bits256 bits256;
#endif
*/
/// \endcond
/// identifiers of additional data blobs in token opreturn script:
/// @see EncodeTokenCreateOpRet(uint8_t funcid, std::vector<uint8_t> origpubkey, std::string name, std::string description, std::vector<std::pair<uint8_t, vscript_t>> oprets)
/// @see GetOpretBlob
enum opretid : uint8_t {
// cc contracts data:
OPRETID_NONFUNGIBLEDATA = 0x11, //!< NFT data id
OPRETID_ASSETSDATA = 0x12, //!< assets contract data id
OPRETID_GATEWAYSDATA = 0x13, //!< gateways contract data id
OPRETID_CHANNELSDATA = 0x14, //!< channels contract data id
OPRETID_HEIRDATA = 0x15, //!< heir contract data id
OPRETID_ROGUEGAMEDATA = 0x16, //!< rogue contract data id
OPRETID_PEGSDATA = 0x17, //!< pegs contract data id
/*! \cond INTERNAL */
// non cc contract data:
OPRETID_FIRSTNONCCDATA = 0x80,
/*! \endcond */
OPRETID_BURNDATA = 0x80, //!< burned token data id
OPRETID_IMPORTDATA = 0x81 //!< imported token data id
};
/// finds opret blob data by opretid in the vector of oprets
/// @param oprets vector of oprets
/// @param id opret id to search
/// @param vopret found opret blob as byte array
/// @returns true if found
/// @see opretid
inline bool GetOpretBlob(const std::vector<std::pair<uint8_t, std::vector<uint8_t>>> &oprets, uint8_t id, std::vector<uint8_t> &vopret) {
vopret.clear();
for(auto p : oprets) if (p.first == id) { vopret = p.second; return true; }
return false;
}
/// \cond INTERNAL
struct CC_utxo
@@ -100,16 +57,6 @@ struct CC_utxo
};
/// \endcond
/// \cond INTERNAL
struct CC_meta
{
std::vector<unsigned char> version;
uint8_t evalCode;
bool is1of2;
uint8_t numDestinations;
// followed by address destinations
};
/// \endcond
/// CC contract (Antara module) info structure that contains data used for signing and validation of cc contract transactions
struct CCcontract_info
@@ -184,16 +131,6 @@ struct CCcontract_info
/// @returns pointer to the passed CCcontract_info structure, it must not be freed
struct CCcontract_info *CCinit(struct CCcontract_info *cp,uint8_t evalcode);
/// \cond INTERNAL
struct oracleprice_info
{
CPubKey pk;
std::vector <uint8_t> data;
int32_t height;
};
/// \endcond
typedef std::vector<uint8_t> vscript_t;
extern struct NSPV_CCmtxinfo NSPV_U; //!< global variable with info about mtx object and used utxo
@@ -258,7 +195,6 @@ bool myIsutxo_spentinmempool(uint256 &spenttxid,int32_t &spentvini,uint256 txid,
bool myAddtomempool(CTransaction &tx, CValidationState *pstate = NULL, bool fSkipExpiry = false);
bool mytxid_inmempool(uint256 txid);
int32_t myIsutxo_spent(uint256 &spenttxid,uint256 txid,int32_t vout);
int32_t myGet_mempool_txs(std::vector<CTransaction> &txs,uint8_t evalcode,uint8_t funcid);
/// \endcond
/// \cond INTERNAL
@@ -393,52 +329,6 @@ bool getCCopret(const CScript &scriptPubKey, CScript &opret);
/// @private
bool makeCCopret(CScript &opret, std::vector<std::vector<unsigned char>> &vData);
/// CCaddr2set sets private key for additional eval code global address.
/// This allows to spend from two cc global addresses in one transaction (the first one is set in cp object by @see CCinit function).
/// @param cp contract info structure (@see CCcontract_info) where the private key is set
/// @param evalcode eval code of the other contract
/// @param pk global public key of the other contract
/// @param priv private key for the global public key of the other contract
/// @param coinaddr cc address obtained for this global pubkey and eval code with _GetCCaddress
/// @see CCinit
/// @see CCcontract_info
/// @see _GetCCaddress
void CCaddr2set(struct CCcontract_info *cp,uint8_t evalcode,CPubKey pk,uint8_t *priv,char *coinaddr);
/// CCaddr2set sets private key for yet another eval code global address.
/// This allows to spend from three cc global addresses in one transaction (the first one is set in cp object by CCinit function, the second is set by CCaddr2set function).
/// @param cp contract info structure where the private key is set
/// @param evalcode eval code of the other contract
/// @param pk global public key of the other contract
/// @param priv private key for the global public key of the other contract
/// @param coinaddr the cc address obtained for this global pubkey and eval code with _GetCCaddress
/// @see CCinit
/// @see CCcontract_info
/// @see CCaddr2set
/// @see _GetCCaddress
void CCaddr3set(struct CCcontract_info *cp,uint8_t evalcode,CPubKey pk,uint8_t *priv,char *coinaddr);
/// CCaddr1of2set sets pubkeys, private key and cc addr for spending from 1of2 cryptocondition vout
/// @param cp contract info structure where the private key is set
/// @param pk1 one of the two public keys of the 1of2 cc
/// @param pk2 second of the two public keys of the 1of2 cc
/// @param priv private key for one of the two pubkeys
/// @param coinaddr the cc address obtained for this 1of2 cc with GetCCaddress1of2
/// @see CCinit
/// @see CCcontract_info
/// @see GetCCaddress1of2
void CCaddr1of2set(struct CCcontract_info *cp, CPubKey pk1, CPubKey pk2,uint8_t *priv,char *coinaddr);
/// CCaddrTokens1of2set sets pubkeys, private key and cc addr for spending from 1of2 token cryptocondition vout
/// @param cp contract info structure where the private key is set
/// @param pk1 one of the two public keys of the 1of2 cc
/// @param pk2 second of the two public keys of the 1of2 cc
/// @param priv private key for one of the two pubkeys
/// @param coinaddr the cc address obtained for this 1of2 token cc with GetTokensCCaddress1of2
/// @see GetTokensCCaddress
/// @see CCcontract_info
void CCaddrTokens1of2set(struct CCcontract_info *cp, CPubKey pk1, CPubKey pk2, uint8_t *priv, char *coinaddr);
/// IsCCInput checks if scriptSig object contains a cryptocondition
/// @param scriptSig scriptSig object with a cryptocondition
/// @returns true if the scriptSig object contains a cryptocondition
@@ -476,8 +366,6 @@ CPubKey pubkey2pk(std::vector<uint8_t> vpubkey);
/// @param tokenid id of token (id of token creation tx)
int64_t CCfullsupply(uint256 tokenid);
/// @private
bool ConstrainVout(CTxOut vout,int32_t CCflag,char *cmpaddr,int64_t nValue);
/// Returns bitcoin address for the scriptPubKey parameter
/// @param[out] destaddr the returned address of the scriptPubKey, the buffer should have size of at least 64 chars
@@ -485,24 +373,10 @@ bool ConstrainVout(CTxOut vout,int32_t CCflag,char *cmpaddr,int64_t nValue);
/// @returns true if success
bool Getscriptaddress(char *destaddr,const CScript &scriptPubKey);
/// Returns custom bitcoin address for the scriptPubKey parameter
/// @param[out] destaddr the returned address of the scriptPubKey, the buffer should have size of at least 64 chars
/// @param scriptPubKey scriptPubKey object
/// @param taddr custom address prefix
/// @param prefix custom pubkey prefix
/// @param prefix2 custom script prefix
/// @returns true if success
bool GetCustomscriptaddress(char *destaddr,const CScript &scriptPubKey,uint8_t taddr,uint8_t prefix,uint8_t prefix2);
/// Returns my pubkey, that is set by -pubkey hushd parameter
/// @returns public key as byte array
std::vector<uint8_t> Mypubkey();
/// Returns my private key, that is private key for the my pubkey
/// @returns private key as byte array
/// @see Mypubkey
bool Myprivkey(uint8_t myprivkey[]);
/// @private
uint256 BitcoinGetProofMerkleRoot(const std::vector<uint8_t> &proofData, std::vector<uint256> &txids);
@@ -638,9 +512,6 @@ bits256 bits256_doublesha256(char *deprecated,uint8_t *data,int32_t datalen);
// UniValue ValueFromAmount(const CAmount& amount); // defined in server.h
/*! \endcond */
/*! \cond INTERNAL */
int64_t TotalPubkeyNormalInputs(const CTransaction &tx, const CPubKey &pubkey);
int64_t TotalPubkeyCCInputs(const CTransaction &tx, const CPubKey &pubkey);
inline std::string STR_TOLOWER(const std::string &str) { std::string out; for (std::string::const_iterator i = str.begin(); i != str.end(); i++) out += std::tolower(*i); return out; }
/*! \endcond */
@@ -651,60 +522,4 @@ inline std::string STR_TOLOWER(const std::string &str) { std::string out; for (s
void AddSigData2UniValue(UniValue &result, int32_t vini, UniValue& ccjson, std::string sscriptpubkey, int64_t amount);
#ifndef LOGSTREAM_DEFINED
#define LOGSTREAM_DEFINED
// bitcoin LogPrintStr with category "-debug" cmdarg support for C++ ostringstream:
// log levels:
#define CCLOG_ERROR (-1) //!< error level
#define CCLOG_INFO 0 //!< info level
#define CCLOG_DEBUG1 1 //!< debug level 1
#define CCLOG_DEBUG2 2 //!< debug level 2
#define CCLOG_DEBUG3 3 //!< debug level 3
#define CCLOG_MAXLEVEL 3
/// @private
extern void CCLogPrintStr(const char *category, int level, const std::string &str);
/// @private
template <class T>
void CCLogPrintStream(const char *category, int level, const char *functionName, T print_to_stream)
{
}
/// Macro for logging messages using bitcoin LogAcceptCategory and LogPrintStr functions.
/// Supports error, info and three levels of debug messages.
/// Logging category is set by -debug=category hushd param.
/// To set debug level pass -debug=category-1, -debug=category-2 or -debug=category-3 param. If some level is enabled lower level messages also will be printed.
/// To print info-level messages pass just -debug=category parameter, with no level.
/// Error-level messages will always be printed, even if -debug parameter is not set
/// @param category category of message, for example Antara module name
/// @param level debug-level, use defines CCLOG_ERROR, CCLOG_INFO, CCLOG_DEBUGN
/// @param logoperator to form the log message (the 'stream' name is mandatory)
/// usage: LOGSTREAM("category", debug-level, stream << "some log data" << data2 << data3 << ... << std::endl);
/// example: LOGSTREAM("heir", CCLOG_INFO, stream << "heir public key is " << HexStr(heirPk) << std::endl);
#define LOGSTREAM(category, level, logoperator) CCLogPrintStream( category, level, NULL, [=](std::ostringstream &stream) {logoperator;} )
/// LOGSTREAMFN is a version of LOGSTREAM macro which adds calling function name with the standard define \_\_func\_\_ at the beginning of the printed string.
/// LOGSTREAMFN parameters are the same as in LOGSTREAM
/// @see LOGSTREAM
#define LOGSTREAMFN(category, level, logoperator) CCLogPrintStream( category, level, __func__, [=](std::ostringstream &stream) {logoperator;} )
/// @private
template <class T>
UniValue report_ccerror(const char *category, int level, T print_to_stream)
{
UniValue err(UniValue::VOBJ);
std::ostringstream stream;
print_to_stream(stream);
err.push_back(Pair("result", "error"));
err.push_back(Pair("error", stream.str()));
stream << std::endl;
CCLogPrintStr(category, level, stream.str());
return err;
}
/// @private
#define CCERR_RESULT(category,level,logoperator) return report_ccerror(category, level, [=](std::ostringstream &stream) {logoperator;})
#endif // #ifndef LOGSTREAM_DEFINED
#endif

View File

@@ -102,7 +102,3 @@ CPubKey pubkey2pk(std::vector<uint8_t> vpubkey)
pk.Set(vpubkey.begin(), vpubkey.end());
return(pk);
}
void CCLogPrintStr(const char *category, int level, const std::string &str)
{
}

View File

@@ -100,38 +100,6 @@ uint32_t GetLatestTimestamp(int32_t height)
return(hush_heightstamp(height));
} // :P
void CCaddr2set(struct CCcontract_info *cp,uint8_t evalcode,CPubKey pk,uint8_t *priv,char *coinaddr)
{
cp->unspendableEvalcode2 = evalcode;
cp->unspendablepk2 = pk;
memcpy(cp->unspendablepriv2,priv,32);
strcpy(cp->unspendableaddr2,coinaddr);
}
void CCaddr3set(struct CCcontract_info *cp,uint8_t evalcode,CPubKey pk,uint8_t *priv,char *coinaddr)
{
cp->unspendableEvalcode3 = evalcode;
cp->unspendablepk3 = pk;
memcpy(cp->unspendablepriv3,priv,32);
strcpy(cp->unspendableaddr3,coinaddr);
}
void CCaddr1of2set(struct CCcontract_info *cp, CPubKey pk1, CPubKey pk2, uint8_t *priv, char *coinaddr)
{
cp->coins1of2pk[0] = pk1;
cp->coins1of2pk[1] = pk2;
memcpy(cp->coins1of2priv,priv,32);
strcpy(cp->coins1of2addr,coinaddr);
}
void CCaddrTokens1of2set(struct CCcontract_info *cp, CPubKey pk1, CPubKey pk2, uint8_t *priv, char *tokenaddr)
{
cp->tokens1of2pk[0] = pk1;
cp->tokens1of2pk[1] = pk2;
memcpy(cp->tokens1of2priv,priv,32);
strcpy(cp->tokens1of2addr, tokenaddr);
}
bool Getscriptaddress(char *destaddr,const CScript &scriptPubKey)
{
CTxDestination address; txnouttype whichType;
@@ -148,18 +116,6 @@ bool Getscriptaddress(char *destaddr,const CScript &scriptPubKey)
return(false);
}
bool GetCustomscriptaddress(char *destaddr,const CScript &scriptPubKey,uint8_t taddr,uint8_t prefix, uint8_t prefix2)
{
CTxDestination address; txnouttype whichType;
if ( ExtractDestination(scriptPubKey,address) != 0 )
{
strcpy(destaddr,(char *)CCustomBitcoinAddress(address,taddr,prefix,prefix2).ToString().c_str());
return(true);
}
//fprintf(stderr,"ExtractDestination failed\n");
return(false);
}
bool pubkey2addr(char *destaddr,uint8_t *pubkey33)
{
std::vector<uint8_t>pk; int32_t i;
@@ -168,27 +124,6 @@ bool pubkey2addr(char *destaddr,uint8_t *pubkey33)
return(Getscriptaddress(destaddr,CScript() << pk << OP_CHECKSIG));
}
bool ConstrainVout(CTxOut vout, int32_t CCflag, char *cmpaddr, int64_t nValue)
{
char destaddr[64];
if ( vout.scriptPubKey.IsPayToCryptoCondition() != CCflag )
{
fprintf(stderr,"constrain vout error isCC %d vs %d CCflag\n", vout.scriptPubKey.IsPayToCryptoCondition(), CCflag);
return(false);
}
else if ( cmpaddr != 0 && (Getscriptaddress(destaddr, vout.scriptPubKey) == 0 || strcmp(destaddr, cmpaddr) != 0) )
{
fprintf(stderr,"constrain vout error: check addr %s vs script addr %s\n", cmpaddr!=0?cmpaddr:"", destaddr!=0?destaddr:"");
return(false);
}
else if ( nValue != 0 && nValue != vout.nValue ) //(nValue == 0 && vout.nValue < 10000) || (
{
fprintf(stderr,"constrain vout error nValue %.8f vs %.8f\n",(double)nValue/COIN,(double)vout.nValue/COIN);
return(false);
}
else return(true);
}
bool priv2addr(char *coinaddr,uint8_t *buf33,uint8_t priv32[32])
{
CKey priv; CPubKey pk; int32_t i; uint8_t *src;
@@ -219,60 +154,6 @@ extern char NSPV_wifstr[],NSPV_pubkeystr[];
extern uint32_t NSPV_logintime;
#define NSPV_AUTOLOGOUT 777
bool Myprivkey(uint8_t myprivkey[])
{
char coinaddr[64],checkaddr[64]; std::string strAddress; char *dest; int32_t i,n; CBitcoinAddress address; CKeyID keyID; CKey vchSecret; uint8_t buf33[33];
if ( HUSH_NSPV_SUPERLITE )
{
if ( NSPV_logintime == 0 || time(NULL) > NSPV_logintime+NSPV_AUTOLOGOUT )
{
fprintf(stderr,"need to be logged in to get myprivkey\n");
return false;
}
vchSecret = DecodeSecret(NSPV_wifstr);
memcpy(myprivkey,vchSecret.begin(),32);
//for (i=0; i<32; i++)
// fprintf(stderr,"%02x",myprivkey[i]);
//fprintf(stderr," myprivkey %s\n",NSPV_wifstr);
memset((uint8_t *)vchSecret.begin(),0,32);
return true;
}
if ( Getscriptaddress(coinaddr,CScript() << Mypubkey() << OP_CHECKSIG) != 0 )
{
n = (int32_t)strlen(coinaddr);
strAddress.resize(n+1);
dest = (char *)strAddress.data();
for (i=0; i<n; i++)
dest[i] = coinaddr[i];
dest[i] = 0;
if ( address.SetString(strAddress) != 0 && address.GetKeyID(keyID) != 0 )
{
#ifdef ENABLE_WALLET
if ( pwalletMain->GetKey(keyID,vchSecret) != 0 )
{
memcpy(myprivkey,vchSecret.begin(),32);
memset((uint8_t *)vchSecret.begin(),0,32);
if ( 0 )
{
for (i=0; i<32; i++)
fprintf(stderr,"0x%02x, ",myprivkey[i]);
fprintf(stderr," found privkey for %s!\n",dest);
}
if ( priv2addr(checkaddr,buf33,myprivkey) != 0 )
{
if ( buf2pk(buf33) == Mypubkey() && strcmp(checkaddr,coinaddr) == 0 )
return(true);
else printf("mismatched privkey -> addr %s vs %s\n",checkaddr,coinaddr);
}
return(false);
}
#endif
}
}
fprintf(stderr,"privkey for the -pubkey= address is not in the wallet, importprivkey!\n");
return(false);
}
CPubKey GetUnspendable(struct CCcontract_info *cp,uint8_t *unspendablepriv)
{
if ( unspendablepriv != 0 )
@@ -282,57 +163,9 @@ CPubKey GetUnspendable(struct CCcontract_info *cp,uint8_t *unspendablepriv)
int32_t NSPV_coinaddr_inmempool(char const *logcategory,char *coinaddr,uint8_t CCflag);
int32_t myIs_coinaddr_inmempoolvout(char const *logcategory,char *coinaddr)
{
int32_t i,n; char destaddr[64];
if ( HUSH_NSPV_SUPERLITE )
return(NSPV_coinaddr_inmempool(logcategory,coinaddr,1));
BOOST_FOREACH(const CTxMemPoolEntry &e,mempool.mapTx)
{
const CTransaction &tx = e.GetTx();
if ( (n= tx.vout.size()) > 0 )
{
const uint256 &txid = tx.GetHash();
for (i=0; i<n; i++)
{
Getscriptaddress(destaddr,tx.vout[i].scriptPubKey);
if ( strcmp(destaddr,coinaddr) == 0 )
{
LogPrint(logcategory,"found (%s) vout in mempool\n",coinaddr);
return(1);
}
}
}
}
return(0);
}
extern struct NSPV_mempoolresp NSPV_mempoolresult;
extern bool NSPV_evalcode_inmempool(uint8_t evalcode,uint8_t funcid);
int32_t myGet_mempool_txs(std::vector<CTransaction> &txs,uint8_t evalcode,uint8_t funcid)
{
int i=0;
if ( HUSH_NSPV_SUPERLITE )
{
CTransaction tx; uint256 hashBlock;
NSPV_evalcode_inmempool(evalcode,funcid);
for (int i=0;i<NSPV_mempoolresult.numtxids;i++)
{
if (myGetTransaction(NSPV_mempoolresult.txids[i],tx,hashBlock)!=0) txs.push_back(tx);
}
return (NSPV_mempoolresult.numtxids);
}
BOOST_FOREACH(const CTxMemPoolEntry &e,mempool.mapTx)
{
txs.push_back(e.GetTx());
i++;
}
return(i);
}
/* Get the block merkle root for a proof
* IN: proofData
* OUT: merkle root
@@ -420,40 +253,4 @@ bool hush_txnotarizedconfirmed(uint256 txid)
return (false);
}
// returns total of normal inputs signed with this pubkey
int64_t TotalPubkeyNormalInputs(const CTransaction &tx, const CPubKey &pubkey)
{
int64_t total = 0;
for (auto vin : tx.vin) {
CTransaction vintx;
uint256 hashBlock;
if (!IsCCInput(vin.scriptSig) && myGetTransaction(vin.prevout.hash, vintx, hashBlock)) {
typedef std::vector<unsigned char> valtype;
std::vector<valtype> vSolutions;
txnouttype whichType;
if (Solver(vintx.vout[vin.prevout.n].scriptPubKey, whichType, vSolutions)) {
switch (whichType) {
case TX_PUBKEY:
if (pubkey == CPubKey(vSolutions[0])) // is my input?
total += vintx.vout[vin.prevout.n].nValue;
break;
case TX_PUBKEYHASH:
if (pubkey.GetID() == CKeyID(uint160(vSolutions[0]))) // is my input?
total += vintx.vout[vin.prevout.n].nValue;
break;
}
}
}
}
return total;
}
// returns total of CC inputs signed with this pubkey
int64_t TotalPubkeyCCInputs(const CTransaction &tx, const CPubKey &pubkey)
{
int64_t total = 0;
return total;
}
extern std::string MYCCLIBNAME;

View File

@@ -4,7 +4,7 @@ CC_DARWIN = g++-8
CC_WIN = x86_64-w64-mingw32-gcc-posix
CC_AARCH64 = aarch64-linux-gnu-g++
CFLAGS_DARWIN = -DBUILD_CUSTOMCC -std=c++11 -arch x86_64 -I../secp256k1/include -I../../depends/$(shell echo `../..//depends/config.guess`/include) -I../univalue/include -I../leveldb/include -I.. -I. -fPIC -Wl,-undefined -Wl,dynamic_lookup -Wno-write-strings -shared -dynamiclib
CFLAGS = -Wno-write-strings -DBUILD_CUSTOMCC -std=c++11 -I../secp256k1/include -I../../depends/$(shell echo `../..//depends/config.guess`/include) -I../univalue/include -I../leveldb/include -I.. -I. -fPIC -shared
CFLAGS = -D_HAS_AUTO_PTR_ETC=0 -DBOOST_NO_CXX98_FUNCTION_BASE -Wno-write-strings -DBUILD_CUSTOMCC -std=c++11 -I../secp256k1/include -I../../depends/$(shell echo `../..//depends/config.guess`/include) -I../univalue/include -I../leveldb/include -I.. -I. -fPIC -shared
CFLAGS_WIN = -Wno-write-strings -DBUILD_CUSTOMCC -std=c++11 -I../secp256k1/include -I../../depends/x86_64-w64-mingw32/include -I../univalue/include -I../leveldb/include -I.. -I. -fPIC -shared
DEBUGFLAGS = -O0 -D _DEBUG
RELEASEFLAGS = -O2 -D NDEBUG -combine -fwhole-program

View File

@@ -1,88 +1,15 @@
// Copyright (c) 2016-2024 The Hush developers
// Distributed under the GPLv3 software license, see the accompanying
// file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
/*
simple stub custom cc
Just update the functions in this file, then from ~/hush3/src/cc
../hush-cli -ac_name=CUSTOM stop
./makecustom
../hush-smart-chain -ac_name=CUSTOM -ac_cclib=custom -ac_cc=2 ...
The above will rebuild hushd and get it running again
*/
CScript custom_opret(uint8_t funcid,CPubKey pk)
{
CScript opret; uint8_t evalcode = EVAL_CUSTOM;
opret << OP_RETURN << E_MARSHAL(ss << evalcode << funcid << pk);
return(opret);
}
uint8_t custom_opretdecode(CPubKey &pk,CScript scriptPubKey)
{
std::vector<uint8_t> vopret; uint8_t e,f;
GetOpReturnData(scriptPubKey,vopret);
if ( vopret.size() > 2 && E_UNMARSHAL(vopret,ss >> e; ss >> f; ss >> pk) != 0 && e == EVAL_CUSTOM )
{
return(f);
}
return(0);
}
UniValue custom_rawtxresult(UniValue &result,std::string rawtx,int32_t broadcastflag)
{
CTransaction tx;
if ( rawtx.size() > 0 )
{
result.push_back(Pair("hex",rawtx));
if ( DecodeHexTx(tx,rawtx) != 0 )
{
if ( broadcastflag != 0 && myAddtomempool(tx) != 0 )
RelayTransaction(tx);
result.push_back(Pair("txid",tx.GetHash().ToString()));
result.push_back(Pair("result","success"));
} else result.push_back(Pair("error","decode hex"));
} else result.push_back(Pair("error","couldnt finalize CCtx"));
return(result);
}
UniValue custom_func0(uint64_t txfee,struct CCcontract_info *cp,cJSON *params)
{
UniValue result(UniValue::VOBJ);
result.push_back(Pair("result","success"));
result.push_back(Pair("message","just an example of an information returning rpc"));
return(result);
}
// send yourself 1 coin to your CC address using normal utxo from your -pubkey
UniValue custom_func1(uint64_t txfee,struct CCcontract_info *cp,cJSON *params)
{
CMutableTransaction mtx = CreateNewContextualCMutableTransaction(Params().GetConsensus(), hush_nextheight()); std::string rawtx;
UniValue result(UniValue::VOBJ); CPubKey mypk; int64_t amount = COIN; int32_t broadcastflag=0;
if ( txfee == 0 )
txfee = CUSTOM_TXFEE;
mypk = pubkey2pk(Mypubkey());
if ( AddNormalinputs2(mtx,COIN+txfee,64) >= COIN+txfee ) // add utxo to mtx
{
// make op_return payload as normal.
CScript opret = custom_opret('1',mypk);
std::vector<std::vector<unsigned char>> vData = std::vector<std::vector<unsigned char>>();
if ( makeCCopret(opret, vData) )
{
// make vout0 with op_return included as payload.
mtx.vout.push_back(MakeCC1vout(cp->evalcode,amount,mypk,&vData));
fprintf(stderr, "vout size2.%li\n", mtx.vout.size());
rawtx = FinalizeCCTx(0,cp,mtx,mypk,txfee,CScript());
return(custom_rawtxresult(result,rawtx,broadcastflag));
}
}
UniValue result(UniValue::VOBJ);
return(result);
}
bool custom_validate(struct CCcontract_info *cp,int32_t height,Eval *eval,const CTransaction tx)
{
return false;
}

View File

@@ -1,20 +1,6 @@
// Copyright (c) 2016-2024 The Hush developers
// Distributed under the GPLv3 software license, see the accompanying
// file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
/*
to create a custom libcc.so:
1. change "func0" and "func1" to method names that fit your custom cc. Of course, you can create more functions by adding another entry to RPC_FUNCS. there is not any practical limit to the number of methods.
2. For each method make sure there is a UniValue function declaration and CUSTOM_DISPATCH has an if statement checking for it that calls the custom_func
3. write the actual custom_func0, custom_func1 and custom_validate in customcc.cpp
4. ./makecustom, which builds cclib.cpp with -DBUILD_CUSTOMCC and puts the libcc.so in ~/hush3/src and rebuilds hushd
5. launch your chain with -ac_cclib=customcc -ac_cc=2
*/
std::string MYCCLIBNAME = (char *)"customcc";
@@ -27,22 +13,3 @@ std::string MYCCLIBNAME = (char *)"customcc";
{ (char *)MYCCNAME, (char *)"func0", (char *)"<parameter help>", 1, 1, '0', EVAL_CUSTOM }, \
{ (char *)MYCCNAME, (char *)"func1", (char *)"<no args>", 0, 0, '1', EVAL_CUSTOM },
bool custom_validate(struct CCcontract_info *cp,int32_t height,Eval *eval,const CTransaction tx);
UniValue custom_func0(uint64_t txfee,struct CCcontract_info *cp,cJSON *params);
UniValue custom_func1(uint64_t txfee,struct CCcontract_info *cp,cJSON *params);
#define CUSTOM_DISPATCH \
if ( cp->evalcode == EVAL_CUSTOM ) \
{ \
if ( strcmp(method,"func0") == 0 ) \
return(custom_func0(txfee,cp,params)); \
else if ( strcmp(method,"func1") == 0 ) \
return(custom_func1(txfee,cp,params)); \
else \
{ \
result.push_back(Pair("result","error")); \
result.push_back(Pair("error","invalid customcc method")); \
result.push_back(Pair("method",method)); \
return(result); \
} \
}

View File

@@ -339,7 +339,7 @@ cJSON *get_hushcli(char *refcoin,char **retstrp,char *acname,char *method,char *
if ( acname[0] != 0 ) {
if ( refcoin[0] != 0 && strcmp(refcoin,"HUSH3") != 0 && strcmp(refcoin,acname) != 0 )
printf("unexpected: refcoin.(%s) acname.(%s)\n",refcoin,acname);
sprintf(cmdstr,"hush-smart-chain -ac_name=%s %s %s %s %s %s %s %s %s > %s\n",acname,method,arg0,arg1,arg2,arg3,arg4,arg5,arg6,fname);
sprintf(cmdstr,"hush-arrakis-chain -ac_name=%s %s %s %s %s %s %s %s %s > %s\n",acname,method,arg0,arg1,arg2,arg3,arg4,arg5,arg6,fname);
}
else if ( strcmp(refcoin,"HUSH3") == 0 )
sprintf(cmdstr,"hush-cli %s %s %s %s %s %s %s %s > %s\n",method,arg0,arg1,arg2,arg3,arg4,arg5,arg6,fname);

View File

@@ -23,7 +23,7 @@
#include "cJSON.c"
/*
NOTE: HUSH nor any Hush Smart Chain has any sprout outputs. This code is kept for historical and educational purposes.
NOTE: HUSH nor any Hush Arrakis Chain has any sprout outputs. This code is kept for historical and educational purposes.
z_migrate: the purpose of z_migrate is to make converting of all sprout outputs into sapling. the usage would be for the user to specify a sapling address and call z_migrate zsaddr, until it returns that there is nothing left to be done.

File diff suppressed because it is too large Load Diff

View File

@@ -11,19 +11,22 @@
// Each line contains a BIP155 serialized address.
//
static const uint8_t chainparams_seed_main[] = {
0x01,0x04,0x5b,0xd0,0x7f,0x51,0x00,0x00, // 91.208.127.81
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,0xb2,0xfa,0xbd,0x8d,0x00,0x00, // 178.250.189.141
0x01,0x04,0x67,0x45,0x80,0x94,0x00,0x00, // 103.69.128.148
0x01,0x04,0xc2,0x1d,0x64,0xb3,0x00,0x00, // 194.29.100.179
0x01,0x04,0x2d,0x84,0x4b,0x45,0x00,0x00, // 45.132.75.69
0x01,0x04,0xaa,0xcd,0x27,0x27,0x00,0x00, // 170.205.39.39
0x01,0x04,0x95,0x1c,0x66,0xdb,0x00,0x00, // 149.28.102.219
0x01,0x04,0x9b,0x8a,0xe4,0x44,0x00,0x00, // 155.138.228.68
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
0x01,0x04,0xb2,0xfa,0xbd,0x8d,0x00,0x00, // 178.250.189.141
0x04,0x20,0x0e,0x86,0xb6,0xfd,0x96,0xfe,0x06,0xda,0x39,0xeb,0x97,0x39,0xc9,0xd1,0x17,0xa2,0x4e,0x2b,0x75,0x4d,0xeb,0xb5,0xa1,0x34,0x1e,0x34,0x0a,0xcb,0x68,0xab,0xf0,0xe2,0x00,0x00, // b2dln7mw7ydnuopls444tuixujhcw5kn5o22cna6gqfmw2fl6drb5nad.onion
0x04,0x20,0x1c,0x96,0x10,0x03,0xa6,0xa4,0xfa,0xa0,0x3e,0x13,0x1f,0x38,0xf0,0x9b,0xdd,0x9b,0xd7,0xdc,0x0e,0x40,0x61,0x71,0xed,0x1d,0x21,0x58,0xce,0x59,0x55,0x5e,0xe4,0x25,0x00,0x00, // dslbaa5gut5kapqtd44pbg65tpl5ydsamfy62hjbldhfsvk64qs57pyd.onion
0x04,0x20,0xac,0xa0,0x3a,0x31,0xa7,0xea,0x8e,0x90,0xc7,0x2b,0xbb,0x89,0x41,0x05,0x48,0xa0,0x10,0x29,0x8f,0x38,0x16,0xc9,0x94,0xbe,0xef,0x7e,0x9e,0x7d,0x98,0xb6,0x76,0x9f,0x00,0x00, // vsqdumnh5khjbrzlxoeucbkiuaictdzyc3ezjpxpp2ph3gfwo2ptjmyd.onion
0x02,0x10,0x2a,0x0c,0xb6,0x41,0x06,0xf1,0x01,0x8e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00, // 2a0c:b641:6f1:18e::2
0x02,0x10,0x24,0x06,0xef,0x80,0x00,0x03,0x12,0x69,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00, // 2406:ef80:3:1269::1
0x02,0x10,0x24,0x06,0xef,0x80,0x00,0x02,0x3b,0x59,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00, // 2406:ef80:2:3b59::1
0x02,0x10,0x24,0x06,0xef,0x80,0x00,0x01,0x14,0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00, // 2406:ef80:1:146e::1
0x02,0x10,0x24,0x06,0xef,0x80,0x00,0x04,0x21,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00, // 2406:ef80:4:2132::1
0x05,0x20,0xfb,0xa8,0xca,0x3d,0xf4,0xc9,0x83,0x95,0xa8,0x07,0x05,0x6f,0xf8,0x46,0x69,0x6d,0x42,0x75,0x22,0xe9,0x80,0xd8,0x43,0x7c,0xbe,0x29,0xda,0x33,0x14,0xf9,0xfb,0x17,0x00,0x00, // 7oumuppuzgbzlkahavx7qrtjnvbhkixjqdmeg7f6fhndgfhz7mlq.b32.i2p
};

View File

@@ -1,6 +1,6 @@
// Copyright (c) 2009-2014 The Bitcoin Core developers
// Copyright (c) 2016-2017 The Zcash developers
// Copyright (c) 2016-2024 The Hush developers
// Copyright (c) 2016-2025 The 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 10
#define CLIENT_VERSION_REVISION 2
#define CLIENT_VERSION_REVISION 4
#define CLIENT_VERSION_BUILD 50
//! Set to true for release, false for prerelease or test build

View File

@@ -557,17 +557,10 @@ CAmount CCoinsViewCache::GetValueIn(int32_t nHeight,int64_t *interestp,const CTr
CAmount value,nResult = 0;
if ( interestp != 0 )
*interestp = 0;
//if ( tx.IsCoinImport() )
// return GetCoinImportValue(tx);
if ( tx.IsCoinBase() != 0 )
return 0;
for (unsigned int i = 0; i < tx.vin.size(); i++)
{
//if (tx.IsPegsImport() && i==0)
//{
// nResult = GetCoinImportValue(tx);
// continue;
//}
value = GetOutputFor(tx.vin[i]).nValue;
nResult += value;
}
@@ -599,7 +592,7 @@ bool CCoinsViewCache::HaveInputs(const CTransaction& tx) const
{
if (!tx.IsMint()) {
for (unsigned int i = 0; i < tx.vin.size(); i++) {
if (tx.IsPegsImport() && i==0) continue;
//if (tx.IsPegsImport() && i==0) continue;
const COutPoint &prevout = tx.vin[i].prevout;
const CCoins* coins = AccessCoins(prevout.hash);
if (!coins || !coins->IsAvailable(prevout.n)) {
@@ -621,7 +614,7 @@ double CCoinsViewCache::GetPriority(const CTransaction &tx, int nHeight) const
// use the maximum priority for all (partially or fully) shielded transactions.
// (Note that coinbase transactions cannot contain Sapling shielded Spends or Outputs.)
if (tx.vShieldedSpend.size() > 0 || tx.vShieldedOutput.size() > 0 || tx.IsCoinImport() || tx.IsPegsImport()) {
if (tx.vShieldedSpend.size() > 0 || tx.vShieldedOutput.size() > 0 ) {
return MAX_PRIORITY;
}

View File

@@ -1,4 +1,3 @@
// Copyright (c) 2016-2024 The Hush developers
// Copyright (c) 2014 The Bitcoin Core developers
// Copyright (c) 2016-2024 The Hush developers
// Released under the GPLv3

View File

@@ -13,4 +13,4 @@ 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 $@
./hush-arrakis-chain -ac_name=DRAGONX -ac_algo=randomx -ac_halving=3500000 -ac_reward=300000000 -ac_blocktime=36 -ac_private=1 -addnode=$SEEDNODE $@

View File

@@ -10,6 +10,8 @@
#include "tlsmanager.h"
#include "utiltls.h"
extern bool ShutdownRequested();
using namespace std;
// store our preferred cipherlist so we can use it for debug/etc later on
std::string TLS_CIPHERLIST;
@@ -85,6 +87,10 @@ int TLSManager::waitFor(SSLConnectionRoutine eRoutine, SOCKET hSocket, WOLFSSL*
while (true)
{
if(ShutdownRequested()) {
LogPrintf("%s: shutdown requested, exiting\n", __func__);
return retOp;
}
// clear the current thread's error queue
wolfSSL_ERR_clear_error();

View File

@@ -24,6 +24,19 @@
#include "cc/CCinclude.h"
#include "sietch.h"
// This is the address for pubkey = 0x000000000000000000000000000000000 (33 bytes)
// Funds sent to a burn address can never be spent because the pubkey is invalid
// because it is not a point on the elliptic curve we use (secp256k1, like all other
// Bitcoin-derived codebases). secp256k1 is defined by the equation y^2 = x^3 + 7 .
// Using pubkey=0 also implies privkey=0 and the (pubkey,privkey) pair are the same
// as the (x,y) pair in the equation. If you plug in (0,0) to the equation you get
// 0^2 = 0^3 + 7 or 0=7 which is false. This means that (0,0) is not a valid point
// on the secp256k1 curve. Therefore there is no valid signature to spend the funds
// sent to the burn address, because a valid signature must use a valid point on the
// elliptic curve being used. For these reasons, we can prove that the burn address
// receives funds which can never be spent.
#define BURN_ADDRESS "RD6GgnrMpPaTSMn8vai6yiGA7mN4QGPVMY"
int32_t hush_notaries(uint8_t pubkeys[64][33],int32_t height,uint32_t timestamp);
int32_t hush_findnotary(int32_t *numnotariesp,uint8_t *pubkey33,int32_t height,uint32_t timestamp);
int32_t hush_voutupdate(bool fJustCheck,int32_t *isratificationp,int32_t notaryid,uint8_t *scriptbuf,int32_t scriptlen,int32_t height,uint256 txhash,int32_t i,int32_t j,uint64_t *voutmaskp,int32_t *specialtxp,int32_t *notarizedheightp,uint64_t value,int32_t notarized,uint64_t signedmask,uint32_t timestamp);
@@ -948,7 +961,7 @@ CAmount GetBlockSubsidy(int nHeight, const Consensus::Params& consensusParams);
// This function defines the Hush Founders Reward (AKA Dev Tax)
// 10% of all block rewards go towards Hush core team
// If you do not like this, you are encouraged to fork the chain
// or start your own Hush Smart Chain: https://git.hush.is/hush/hush-smart-chains
// or start your own Hush Arrakis Chain: https://git.hush.is/hush/hush-arrakis-chains
// HUSH supply curve cannot be exactly represented via CLI args, so we do it ourselves.
// You specify the BR, and the FR % gets added so 10% of 12.5 is 1.25
// but to tell the AC params, I need to say "11% of 11.25" is 1.25
@@ -1798,15 +1811,15 @@ int64_t hush_newcoins(int64_t *zfundsp,int32_t nHeight,CBlock *pblock)
{
for (j=0; j<m-1; j++)
{
// This is an example address used in docs
if ( ExtractDestination(tx.vout[j].scriptPubKey,address) != 0 && strcmp("RD6GgnrMpPaTSMn8vai6yiGA7mN4QGPVMY",CBitcoinAddress(address).ToString().c_str()) != 0 )
// This address is a burn address which is used in some RPC documentation
if ( ExtractDestination(tx.vout[j].scriptPubKey,address) != 0 && strcmp(BURN_ADDRESS,CBitcoinAddress(address).ToString().c_str()) != 0 )
voutsum += tx.vout[j].nValue;
else printf("skip %.8f -> %s\n",dstr(tx.vout[j].nValue),CBitcoinAddress(address).ToString().c_str());
}
script = (uint8_t *)&tx.vout[j].scriptPubKey[0];
if ( script == 0 || script[0] != 0x6a )
{
if ( ExtractDestination(tx.vout[j].scriptPubKey,address) != 0 && strcmp("RD6GgnrMpPaTSMn8vai6yiGA7mN4QGPVMY",CBitcoinAddress(address).ToString().c_str()) != 0 )
if ( ExtractDestination(tx.vout[j].scriptPubKey,address) != 0 && strcmp(BURN_ADDRESS,CBitcoinAddress(address).ToString().c_str()) != 0 )
voutsum += tx.vout[j].nValue;
}
}

View File

@@ -63,7 +63,7 @@ const uint32_t nHushHardforkHeight4 = 1605555;
const uint32_t nHushHardforkTimestamp = 1580303652; // Jan 29nd 1pm GMT
const uint32_t nHushHardforkTimestamp2 = 1594425600; // Jul 11th 12a GMT
// Used by HSCs
// Used by HACs
static const uint32_t HUSH_SEASON_TIMESTAMPS[NUM_HUSH_SEASONS] = {1525132800, 1563148800, nHushHardforkTimestamp, nHushHardforkTimestamp2, nHushHardforkTimestamp2*5, nHushHardforkTimestamp2*6, nHushHardforkTimestamp2*7};
// Used by HUSH3+TUSH

View File

@@ -50,6 +50,8 @@ int32_t HUSH_INSYNC,HUSH_LASTMINED,prevHUSH_LASTMINED,HUSH_CCACTIVATE;
std::string NOTARY_PUBKEY,ASSETCHAINS_NOTARIES,ASSETCHAINS_OVERRIDE_PUBKEY,DONATION_PUBKEY,ASSETCHAINS_SCRIPTPUB,NOTARY_ADDRESS,ASSETCHAINS_SELFIMPORT,ASSETCHAINS_CCLIB;
uint8_t NOTARY_PUBKEY33[33],ASSETCHAINS_OVERRIDE_PUBKEY33[33],ASSETCHAINS_OVERRIDE_PUBKEYHASH[20],ASSETCHAINS_PUBLIC,ASSETCHAINS_PRIVATE,ASSETCHAINS_TXPOW,ASSETCHAINS_MARMARA;
int8_t ASSETCHAINS_ADAPTIVEPOW;
uint8_t ASSETCHAINS_BURN = 0;
uint32_t ASSETCHAINS_MINOPRETURNFEE = 0;
std::vector<uint8_t> Mineropret;
std::vector<std::string> vAllowListAddress;
char NOTARYADDRS[64][64];

View File

@@ -233,64 +233,6 @@ public:
DefaultCCChecker() { }
virtual bool checkCC(uint256 txid, const std::vector<CTxOut> &vouts, int32_t nvout, uint8_t evalcode, std::string funcids, uint256 filtertxid)
{
CScript opret, dummy;
std::vector< vscript_t > vParams;
vscript_t vopret;
if (nvout < vouts.size())
{
// first check if it is cc vout
if (vouts[nvout].scriptPubKey.IsPayToCryptoCondition(&dummy, vParams))
{
// try to find cc opret
if (vParams.size() > 0)
{
COptCCParams p(vParams[0]); // parse vout data
if (p.vData.size() > 0)
{
vopret = p.vData[0]; // get opret data
}
}
// if no cc opret check last vout opret
if (vopret.size() == 0)
{
GetOpReturnData(vouts.back().scriptPubKey, vopret);
}
if (vopret.size() > 2)
{
uint8_t opretEvalcode, opretFuncid;
uint256 opretTxid;
bool isEof = true;
bool isCreateTx = false;
// parse opret first 3 fields:
bool parseOk = E_UNMARSHAL(vopret,
ss >> opretEvalcode;
ss >> opretFuncid;
if (funcids.size() > 0 && opretFuncid == funcids[0]) // this means that we check txid only for second+ funcid in array (considering that the first funcid is the creation txid itself like tokens)
{
isCreateTx = true;
}
else
{
ss >> opretTxid;
isCreateTx = false;
}
isEof = ss.eof(); );
opretTxid = revuint256(opretTxid);
std::cerr << __func__ << " " << "opretEvalcode=" << opretEvalcode << " opretFuncid=" << (char)opretFuncid << " isCreateTx=" << isCreateTx << " opretTxid=" << opretTxid.GetHex() << std::endl;
if( parseOk /*parseOk=true if eof reached*/|| !isEof /*more data means okay*/)
{
if (evalcode == opretEvalcode && std::find(funcids.begin(), funcids.end(), (char)opretFuncid) != funcids.end() &&
(isCreateTx && filtertxid == txid || !isCreateTx && filtertxid == opretTxid))
{
return true;
}
}
}
}
}
return false;
}
};
@@ -352,69 +294,9 @@ int32_t NSPV_mempoolfuncs(bits256 *satoshisp,int32_t *vindexp,std::vector<uint25
int32_t num = 0,vini = 0,vouti = 0; uint8_t evalcode=0,func=0; std::vector<uint8_t> vopret; char destaddr[64];
*vindexp = -1;
memset(satoshisp,0,sizeof(*satoshisp));
/*
if ( funcid == NSPV_CC_TXIDS)
{
std::vector<std::pair<CAddressIndexKey, CAmount> > tmp_txids; uint256 tmp_txid,hashBlock;
int32_t n=0,skipcount=vout>>16; uint8_t eval=(vout>>8)&0xFF, func=vout&0xFF;
CTransaction tx;
SetCCtxids(tmp_txids,coinaddr,isCC);
if ( skipcount < 0 ) skipcount = 0;
if ( skipcount >= tmp_txids.size() )
skipcount = tmp_txids.size()-1;
if ( tmp_txids.size()-skipcount > 0 )
{
for (std::vector<std::pair<CAddressIndexKey, CAmount> >::const_iterator it=tmp_txids.begin(); it!=tmp_txids.end(); it++)
{
if (txid!=zeroid || func!=0)
{
myGetTransaction(it->first.txhash,tx,hashBlock);
std::vector<std::pair<uint8_t, vscript_t>> oprets; uint256 tokenid,txid;
std::vector<uint8_t> vopret,vOpretExtra; uint8_t *script,e,f,tokenevalcode;
std::vector<CPubKey> pubkeys;
if (DecodeTokenOpRet(tx.vout[tx.vout.size()-1].scriptPubKey,tokenevalcode,tokenid,pubkeys,oprets)!=0 && GetOpretBlob(oprets, OPRETID_CHANNELSDATA, vOpretExtra) && tokenevalcode==EVAL_TOKENS && vOpretExtra.size()>0)
{
vopret=vOpretExtra;
}
else GetOpReturnData(tx.vout[tx.vout.size()-1].scriptPubKey, vopret);
script = (uint8_t *)vopret.data();
if ( vopret.size() > 2 && script[0]==eval )
{
switch (eval)
{
case EVAL_CHANNELS:EVAL_PEGS:EVAL_ORACLES:EVAL_GAMES:EVAL_IMPORTGATEWAY:EVAL_ROGUE:
E_UNMARSHAL(vopret,ss >> e; ss >> f; ss >> tmp_txid;);
if (e!=eval || (txid!=zeroid && txid!=tmp_txid) || (func!=0 && f!=func)) continue;
break;
case EVAL_TOKENS:EVAL_DICE:EVAL_DILITHIUM:EVAL_FAUCET:EVAL_LOTO:EVAL_PAYMENTS:EVAL_REWARDS:
E_UNMARSHAL(vopret,ss >> e; ss >> f;);
if (e!=eval || (func!=0 && f!=func)) continue;
break;
default:
break;
}
}
}
if ( n >= skipcount ) txids.push_back(it->first.txhash);
n++;
}
return (n-skipcount);
}
return (0);
}
*/
if ( mempool.size() == 0 )
return(0);
/*
if ( funcid == NSPV_MEMPOOL_CCEVALCODE )
{
isCC = true;
evalcode = vout & 0xff;
func = (vout >> 8) & 0xff;
}
*/
LOCK(mempool.cs);
BOOST_FOREACH(const CTxMemPoolEntry &e,mempool.mapTx)
{

View File

@@ -322,31 +322,14 @@ UniValue NSPV_spend(char *srcaddr,char *destaddr,int64_t satoshis) // what its a
}
else if ( bitcoin_base58decode(rmd160,destaddr) != 25 )
{
if ( (len= is_hexstr(destaddr,0)) > 0 )
{
len >>= 1;
data.resize(len);
decode_hex(&data[0],len,destaddr);
if ( data[len-1] == OP_CHECKCRYPTOCONDITION )
{
data.resize(--len);
scriptPubKey = CScript() << data << OP_CHECKCRYPTOCONDITION;
}
else
{
result.push_back(Pair("result","error"));
result.push_back(Pair("error","only CC hex allowed for now"));
return(result); }
}
else
{
if ( (len= is_hexstr(destaddr,0)) > 0 ) {
result.push_back(Pair("result","error"));
return(result);
} else {
result.push_back(Pair("result","error"));
result.push_back(Pair("error","invalid destaddr/CCvout hex"));
return(result);
}
}
else
{
} else {
data.resize(20);
memcpy(&data[0],&rmd160[1],20);
scriptPubKey = (CScript() << OP_DUP << OP_HASH160 << ParseHex(HexStr(data)) << OP_EQUALVERIFY << OP_CHECKSIG);

View File

@@ -102,7 +102,7 @@ int32_t hush_notaries(uint8_t pubkeys[64][33],int32_t height,uint32_t timestamp)
int32_t i,htind,n; uint64_t mask = 0; struct knotary_entry *kp,*tmp;
static uint8_t hush_pubkeys[NUM_HUSH_SEASONS][64][33],didinit[NUM_HUSH_SEASONS];
//HUSH3+TUSH use block heights, HSCs use timestamps
//HUSH3+TUSH use block heights, HACs use timestamps
if ( timestamp == 0 && SMART_CHAIN_SYMBOL[0] != 0 ) {
timestamp = hush_heightstamp(height);
} else if ( SMART_CHAIN_SYMBOL[0] == 0 ) {
@@ -113,7 +113,7 @@ int32_t hush_notaries(uint8_t pubkeys[64][33],int32_t height,uint32_t timestamp)
int32_t hush_season = 0;
bool ishush3 = strncmp(SMART_CHAIN_SYMBOL, "HUSH3",5) == 0 ? true : false;
bool istush = strncmp(SMART_CHAIN_SYMBOL, "TUSH",4) == 0 ? true : false;
// TUSH uses height activation like HUSH3, other HSCs use timestamps
// TUSH uses height activation like HUSH3, other HACs use timestamps
hush_season = (ishush3 || istush) ? gethushseason(height) : getacseason(timestamp);
if(IS_HUSH_NOTARY) {

View File

@@ -1611,7 +1611,7 @@ uint64_t hush_block_subsidy(int height)
return subsidy;
}
// wrapper for more general supply curves of Hush Smart Chains
// wrapper for more general supply curves of Hush Arrakis Chains
uint64_t hush_sc_block_subsidy(int nHeight)
{
// Find current era, start from beginning reward, and determine current subsidy
@@ -1796,29 +1796,49 @@ void hush_args(char *argv0)
fprintf(stderr,".oO Starting %s Full Node (Extreme Privacy!) with genproc=%d notary=%d\n",name.c_str(),HUSH_MININGTHREADS, IS_HUSH_NOTARY);
vector<string> HUSH_nodes = {};
vector<string> DRAGONX_nodes = {};
// Only HUSH3 and DRAGONX connect to these by default, other HACs must opt-in via -connect/-addnode
const bool ishush3 = strncmp(name.c_str(), "HUSH3",5) == 0 ? true : false;
const bool isdragonx = strncmp(name.c_str(), "DRAGONX",7) == 0 ? true : false;
LogPrint("net", "%s: ishush3=%d isdragonx=%d\n", __func__, ishush3, isdragonx);
if (ishush3 || isdragonx) {
if (ishush3) {
HUSH_nodes = {"node1.hush.is","node2.hush.is","node3.hush.is",
"node4.hush.is","node5.hush.is","node6.hush.is",
"node7.hush.is","node8.hush.is","node1.hush.land",
"node2.hush.land", "node3.hush.land",
"node4.hush.land", "node5.hush.land"};
"node7.hush.is","node8.hush.is",
"178.250.189.141",
"31.202.19.157",
"45.132.75.69",
"45.63.58.167",
"b2dln7mw7ydnuopls444tuixujhcw5kn5o22cna6gqfmw2fl6drb5nad.onion",
"dslbaa5gut5kapqtd44pbg65tpl5ydsamfy62hjbldhfsvk64qs57pyd.onion",
"vsqdumnh5khjbrzlxoeucbkiuaictdzyc3ezjpxpp2ph3gfwo2ptjmyd.onion",
"plrobkepqjxs2cmig273mxnqh3qhuhdaioyb2n5kafn264ramb7tqxid.onion"
};
}
if (isdragonx) {
DRAGONX_nodes = {"node1.dragonx.is","node2.dragonx.is","node3.dragonx.is",
"node4.dragonx.is","node5.dragonx.is","node6.dragonx.is"
};
}
vector<string> more_nodes = mapMultiArgs["-addnode"];
if (more_nodes.size() > 0) {
fprintf(stderr,"%s: Adding %lu more nodes via custom -addnode arguments\n", __func__, more_nodes.size() );
}
// Add default HUSH nodes after custom addnodes, if applicable
// Add default HUSH and DRAGONX nodes after custom addnodes, if applicable
if(HUSH_nodes.size() > 0) {
LogPrint("net", "%s: adding %d hostname-based nodes\n", __func__, HUSH_nodes.size() );
LogPrint("net", "%s: adding %d HUSH3 hostname-based nodes\n", __func__, HUSH_nodes.size() );
more_nodes.insert( more_nodes.end(), HUSH_nodes.begin(), HUSH_nodes.end() );
}
if(DRAGONX_nodes.size() > 0) {
LogPrint("net", "%s: adding %d DRAGONX hostname-based nodes\n", __func__, DRAGONX_nodes.size() );
more_nodes.insert( more_nodes.end(), DRAGONX_nodes.begin(), DRAGONX_nodes.end() );
}
mapMultiArgs["-addnode"] = more_nodes;
HUSH_STOPAT = GetArg("-stopat",0);
MAX_REORG_LENGTH = GetArg("-maxreorg",MAX_REORG_LENGTH);
@@ -1832,7 +1852,9 @@ void hush_args(char *argv0)
HUSH_SNAPSHOT_INTERVAL = GetArg("-ac_snapshot",0);
Split(GetArg("-ac_nk",""), sizeof(ASSETCHAINS_NK)/sizeof(*ASSETCHAINS_NK), ASSETCHAINS_NK, 0);
ASSETCHAINS_BURN = GetArg("-ac_burn", 0);
ASSETCHAINS_MINOPRETURNFEE = GetArg("-ac_minopreturnfee", 0);
// -ac_ccactivateht=evalcode,height,evalcode,height,evalcode,height....
Split(GetArg("-ac_ccactivateht",""), sizeof(ccEnablesHeight)/sizeof(*ccEnablesHeight), ccEnablesHeight, 0);
// fill map with all eval codes and activation height of 0.
@@ -1848,7 +1870,7 @@ void hush_args(char *argv0)
fprintf(stderr, "ac_ccactivateht: invalid evalcode.%i must be between 0 and 256.\n", ecode);
else if ( ht > 0 )
{
// update global map.
// update global map.
mapHeightEvalActivate[ecode] = ht;
fprintf(stderr, "ac_ccactivateht: ecode.%i activates at height.%i\n", ecode, mapHeightEvalActivate[ecode]);
}
@@ -2158,7 +2180,7 @@ void hush_args(char *argv0)
}
}
if ( ASSETCHAINS_ENDSUBSIDY[0] != 0 || ASSETCHAINS_REWARD[0] != 0 || ASSETCHAINS_HALVING[0] != 0 || ASSETCHAINS_DECAY[0] != 0 || ASSETCHAINS_COMMISSION != 0 || ASSETCHAINS_PUBLIC != 0 || ASSETCHAINS_PRIVATE != 0 || ASSETCHAINS_TXPOW != 0 || ASSETCHAINS_FOUNDERS != 0 || ASSETCHAINS_SCRIPTPUB.size() > 1 || ASSETCHAINS_SELFIMPORT.size() > 0 || ASSETCHAINS_OVERRIDE_PUBKEY33[0] != 0 || ASSETCHAINS_TIMELOCKGTE != _ASSETCHAINS_TIMELOCKOFF|| ASSETCHAINS_ALGO != ASSETCHAINS_EQUIHASH || ASSETCHAINS_LWMAPOS != 0 || ASSETCHAINS_LASTERA > 0 || ASSETCHAINS_BEAMPORT != 0 || ASSETCHAINS_CODAPORT != 0 || ASSETCHAINS_MARMARA != 0 || nonz > 0 || ASSETCHAINS_CCLIB.size() > 0 || ASSETCHAINS_FOUNDERS_REWARD != 0 || ASSETCHAINS_NOTARY_PAY[0] != 0 || ASSETCHAINS_BLOCKTIME != 60 || ASSETCHAINS_CBOPRET != 0 || Mineropret.size() != 0 || (ASSETCHAINS_NK[0] != 0 && ASSETCHAINS_NK[1] != 0) || HUSH_SNAPSHOT_INTERVAL != 0 || ASSETCHAINS_EARLYTXIDCONTRACT != 0 || ASSETCHAINS_CBMATURITY != 0 || ASSETCHAINS_ADAPTIVEPOW != 0 )
if ( ASSETCHAINS_ENDSUBSIDY[0] != 0 || ASSETCHAINS_REWARD[0] != 0 || ASSETCHAINS_HALVING[0] != 0 || ASSETCHAINS_DECAY[0] != 0 || ASSETCHAINS_COMMISSION != 0 || ASSETCHAINS_PUBLIC != 0 || ASSETCHAINS_PRIVATE != 0 || ASSETCHAINS_TXPOW != 0 || ASSETCHAINS_FOUNDERS != 0 || ASSETCHAINS_SCRIPTPUB.size() > 1 || ASSETCHAINS_SELFIMPORT.size() > 0 || ASSETCHAINS_OVERRIDE_PUBKEY33[0] != 0 || ASSETCHAINS_TIMELOCKGTE != _ASSETCHAINS_TIMELOCKOFF|| ASSETCHAINS_ALGO != ASSETCHAINS_EQUIHASH || ASSETCHAINS_LWMAPOS != 0 || ASSETCHAINS_LASTERA > 0 || ASSETCHAINS_BEAMPORT != 0 || ASSETCHAINS_CODAPORT != 0 || ASSETCHAINS_MARMARA != 0 || nonz > 0 || ASSETCHAINS_CCLIB.size() > 0 || ASSETCHAINS_FOUNDERS_REWARD != 0 || ASSETCHAINS_NOTARY_PAY[0] != 0 || ASSETCHAINS_BLOCKTIME != 60 || ASSETCHAINS_CBOPRET != 0 || Mineropret.size() != 0 || (ASSETCHAINS_NK[0] != 0 && ASSETCHAINS_NK[1] != 0) || HUSH_SNAPSHOT_INTERVAL != 0 || ASSETCHAINS_EARLYTXIDCONTRACT != 0 || ASSETCHAINS_CBMATURITY != 0 || ASSETCHAINS_ADAPTIVEPOW != 0 || ASSETCHAINS_BURN != 0 || ASSETCHAINS_MINOPRETURNFEE)
{
if(fDebug)
fprintf(stderr,"perc %.4f%% ac_pub=[%02x%02x%02x...] acsize.%d\n",dstr(ASSETCHAINS_COMMISSION)*100,ASSETCHAINS_OVERRIDE_PUBKEY33[0],ASSETCHAINS_OVERRIDE_PUBKEY33[1],ASSETCHAINS_OVERRIDE_PUBKEY33[2],(int32_t)ASSETCHAINS_SCRIPTPUB.size());
@@ -2318,6 +2340,16 @@ void hush_args(char *argv0)
}
if ( ASSETCHAINS_ADAPTIVEPOW != 0 )
extraptr[extralen++] = ASSETCHAINS_ADAPTIVEPOW;
if ( ASSETCHAINS_BURN != 0 )
{
extralen += dragon_rwnum(1,&extraptr[extralen],sizeof(ASSETCHAINS_BURN),(void *)&ASSETCHAINS_BURN);
}
if ( ASSETCHAINS_MINOPRETURNFEE != 0 )
{
extralen += dragon_rwnum(1,&extraptr[extralen],sizeof(ASSETCHAINS_MINOPRETURNFEE),(void *)&ASSETCHAINS_MINOPRETURNFEE);
}
}
addn = GetArg("-seednode","");

View File

@@ -429,8 +429,10 @@ std::string HelpMessage(HelpMessageMode mode)
strUsage += HelpMessageOpt("-i2psam=<ip:port>", 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=<net>", _("Only connect to nodes in network <net> (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("-disableipv4", _("Disable Ipv4 network connections") + " " + strprintf(_("(default: %u)"), DEFAULT_DISABLE_IPV4));
strUsage += HelpMessageOpt("-disableipv6", _("Disable Ipv6 network connections") + " " + strprintf(_("(default: %u)"), DEFAULT_DISABLE_IPV6));
strUsage += HelpMessageOpt("-clearnet", _("Enable clearnet connections. Setting to 0 will disable clearnet and use sane defaults for Tor/i2p") + " " + strprintf(_("(default: %u)"), DEFAULT_CLEARNET));
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));
@@ -479,7 +481,6 @@ std::string HelpMessage(HelpMessageMode mode)
if (showDebug)
strUsage += HelpMessageOpt("-mintxfee=<amt>", strprintf("Fees (in %s/kB) smaller than this are considered zero fee for transaction creation (default: %s)",
CURRENCY_UNIT, FormatMoney(CWallet::minTxFee.GetFeePerK())));
strUsage += HelpMessageOpt("-opretmintxfee=<amt>", strprintf(_("Minimum fee (in %s/kB) to allow for OP_RETURN transactions (default: %s)"), CURRENCY_UNIT, 400000 ));
strUsage += HelpMessageOpt("-paytxfee=<amt>", strprintf(_("Fee (in %s/kB) to add to transactions you send (default: %s)"), CURRENCY_UNIT, FormatMoney(payTxFee.GetFeePerK())));
// If this is used incorrectly (-rescanheight too large), then the local wallet may attempt to spend funds which it does not have witness data about
// which will cause a "missing inputs" error when added to the mempool. Rescanning from correct height will fix this.
@@ -602,6 +603,8 @@ std::string HelpMessage(HelpMessageMode mode)
strUsage += HelpMessageOpt("-ac_algo", _("Choose PoW mining algorithm, either 'equihash' or 'randomx'. default is Equihash (200,9)"));
strUsage += HelpMessageOpt("-ac_blocktime", _("Block time in seconds, default is 60"));
strUsage += HelpMessageOpt("-ac_beam", _("BEAM integration"));
strUsage += HelpMessageOpt("-ac_burn", _("Allow sending funds to the transparent burn address when -ac_private=1"));
strUsage += HelpMessageOpt("-ac_minopreturnfee", _("OP_RETURN minimum fee per tx, regardless of tx size, default is 1 coin"));
strUsage += HelpMessageOpt("-ac_coda", _("CODA integration"));
strUsage += HelpMessageOpt("-ac_decay", _("Percentage of block reward decrease at each halving"));
strUsage += HelpMessageOpt("-ac_end", _("Block height at which block rewards will end"));
@@ -1085,6 +1088,13 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
LogPrintf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
LogPrintf("Hush version %s (%s)\n", FormatFullVersion());
#ifdef DEBUG_LOCKORDER
LogPrintf("DEBUG_LOCKORDER enabled\n");
#else
LogPrintf("DEBUG_LOCKORDER disabled\n");
#endif
// when specifying an explicit binding address, you want to listen on it
// even when -connect or -proxy is specified
if (mapArgs.count("-bind")) {
@@ -1128,7 +1138,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
LogPrintf("%s: parameter interaction: -externalip set -> setting -discover=0\n", __func__);
}
// Read asmap file by default for HUSH3 and all Hush Smart Chains
// Read asmap file by default for HUSH3 and all Hush Arrakis Chains
if (GetArg("-asmap",1)) {
fs::path asmap_path = fs::path(GetArg("-asmap", ""));
@@ -1637,12 +1647,38 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
}
//fprintf(stderr,"%s tik18\n", __FUNCTION__);
// Disable clearnet peers if -clearnet=0
if (!GetBoolArg("-clearnet", DEFAULT_CLEARNET)) {
#ifdef ENABLE_MINING
// mining to the same taddr links different txs together as from the same owner
// and if using -clearnet=0 that can be used to link together different .onions
// as being the same entity, because they are mining to the same taddr
if (mapArgs.count("-mineraddress")) {
return InitError(_("-mineraddress and -clearnet=0 cannot be used together because it would reduce your privacy!"));
}
#endif
SoftSetBoolArg("-disableipv4", true);
SoftSetBoolArg("-disableipv6", true);
SoftSetBoolArg("-dns", false);
SoftSetBoolArg("-dnsseed", false);
SoftSetArg("-bind", "127.0.0.1");
SoftSetArg("-onlynet", "onion");
SoftSetArg("-onlynet", "i2p");
SoftSetArg("-onion", "127.0.0.1:9050");
SoftSetArg("-i2psam", "127.0.0.1:7656");
}
if (mapArgs.count("-onlynet")) {
std::set<enum Network> nets;
BOOST_FOREACH(const std::string& snet, mapMultiArgs["-onlynet"]) {
enum Network net = ParseNetwork(snet);
if (net == NET_UNROUTABLE)
if (net == NET_UNROUTABLE) {
return InitError(strprintf(_("Unknown network specified in -onlynet: '%s'"), snet));
} else if (net == NET_IPV4 && GetBoolArg("-disableipv4", DEFAULT_DISABLE_IPV4)) {
return InitError(strprintf(_("-onlynet=ipv4 is incompatible with -disableipv4 !")));
} else if (net == NET_IPV6 && GetBoolArg("-disableipv6", DEFAULT_DISABLE_IPV4)) {
return InitError(strprintf(_("-onlynet=ipv6 is incompatible with -disableipv6 !")));
}
nets.insert(net);
}
for (int n = 0; n < NET_MAX; n++) {
@@ -1652,6 +1688,22 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
}
}
if(mapMultiArgs["-disableipv6"].size() > 1) {
return InitError("-disableipv6 can only be used once");
}
if(mapMultiArgs["-disableipv4"].size() > 1) {
return InitError("-disableipv4 can only be used once");
}
if (GetBoolArg("-disableipv6", DEFAULT_DISABLE_IPV6)) {
SetReachable(NET_IPV6, false);
}
if (GetBoolArg("-disableipv4", DEFAULT_DISABLE_IPV4)) {
SetReachable(NET_IPV4, false);
}
//fprintf(stderr,"%s tik19\n", __FUNCTION__);
if (mapArgs.count("-allowlist")) {
BOOST_FOREACH(const std::string& net, mapMultiArgs["-allowlist"]) {

View File

@@ -33,6 +33,7 @@
#include "net.h"
#include "netmessagemaker.h"
#include "pow.h"
#include "time.h"
#include "script/interpreter.h"
#include "txdb.h"
#include "txmempool.h"
@@ -106,7 +107,7 @@ size_t nCoinCacheUsage = 5000 * 300;
uint64_t nPruneTarget = 0;
// If the tip is older than this (in seconds), the node is considered to be in initial block download.
int64_t nMaxTipAge = DEFAULT_MAX_TIP_AGE;
bool ishush3 = strncmp(SMART_CHAIN_SYMBOL, "HUSH3",5) == 0 ? true : false;
const bool ishush3 = strncmp(SMART_CHAIN_SYMBOL, "HUSH3",5) == 0 ? true : false;
int32_t nFirstHalvingHeight = 340000;
unsigned int expiryDelta = DEFAULT_TX_EXPIRY_DELTA;
@@ -815,8 +816,8 @@ bool hush_dailysnapshot(int32_t height)
for (unsigned int j = tx.vin.size(); j-- > 0;)
{
uint256 blockhash; CTransaction txin;
if (tx.IsPegsImport() && j==0) continue;
if ( !tx.IsCoinImport() && !tx.IsCoinBase() && myGetTransaction(tx.vin[j].prevout.hash,txin,blockhash) )
//if (tx.IsPegsImport() && j==0) continue;
if ( !tx.IsCoinBase() && myGetTransaction(tx.vin[j].prevout.hash,txin,blockhash) )
{
int vout = tx.vin[j].prevout.n;
if ( ExtractDestination(txin.vout[vout].scriptPubKey, vDest) )
@@ -993,11 +994,10 @@ bool IsStandardTx(const CTransaction& tx, string& reason, const int nHeight)
}
nDataOut++;
//fprintf(stderr,"is OP_RETURN\n");
}
else if ((whichType == TX_MULTISIG) && (!fIsBareMultisigStd)) {
} else if ((whichType == TX_MULTISIG) && (!fIsBareMultisigStd)) {
reason = "bare-multisig";
return false;
} else if (whichType != TX_CRYPTOCONDITION && txout.IsDust(::minRelayTxFee)) {
} else if (txout.IsDust(::minRelayTxFee)) {
reason = "dust";
return false;
}
@@ -1102,12 +1102,12 @@ bool AreInputsStandard(const CTransaction& tx, const CCoinsViewCache& mapInputs,
if (tx.IsCoinBase())
return true; // Coinbases don't use vin normally
if (tx.IsCoinImport())
return tx.vin[0].scriptSig.IsCoinImport();
//if (tx.IsCoinImport())
// return tx.vin[0].scriptSig.IsCoinImport();
for (unsigned int i = 0; i < tx.vin.size(); i++)
{
if (tx.IsPegsImport() && i==0) continue;
//if (tx.IsPegsImport() && i==0) continue;
const CTxOut& prev = mapInputs.GetOutputFor(tx.vin[i]);
vector<vector<unsigned char> > vSolutions;
@@ -1179,13 +1179,13 @@ unsigned int GetLegacySigOpCount(const CTransaction& tx)
unsigned int GetP2SHSigOpCount(const CTransaction& tx, const CCoinsViewCache& inputs)
{
if (tx.IsCoinBase() || tx.IsCoinImport())
if (tx.IsCoinBase())
return 0;
unsigned int nSigOps = 0;
for (unsigned int i = 0; i < tx.vin.size(); i++)
{
if (tx.IsPegsImport() && i==0) continue;
//if (tx.IsPegsImport() && i==0) continue;
const CTxOut &prevout = inputs.GetOutputFor(tx.vin[i]);
if (prevout.scriptPubKey.IsPayToScriptHash())
nSigOps += prevout.scriptPubKey.GetSigOpCount(tx.vin[i].scriptSig);
@@ -1222,16 +1222,6 @@ bool ContextualCheckTransaction(int32_t slowflag,const CBlock *block, CBlockInde
{
const bool overwinterActive = nHeight >=1 ? true : false; //NetworkUpgradeActive(nHeight, Params().GetConsensus(), Consensus::UPGRADE_OVERWINTER);
const bool saplingActive = nHeight >=1 ? true : false; //NetworkUpgradeActive(nHeight, Params().GetConsensus(), Consensus::UPGRADE_SAPLING);
const bool isSprout = false; //!overwinterActive;
/*
// If Sprout rules apply, reject transactions which are intended for Overwinter and beyond
if (isSprout && tx.fOverwintered) {
int32_t ht = Params().GetConsensus().vUpgrades[Consensus::UPGRADE_OVERWINTER].nActivationHeight;
return state.DoS((ht < 0 || nHeight < ht) ? 0 : dosLevel,error("ContextualCheckTransaction(): ht.%d activates.%d dosLevel.%d overwinter is not active yet",nHeight, Params().GetConsensus().vUpgrades[Consensus::UPGRADE_OVERWINTER].nActivationHeight, dosLevel),REJECT_INVALID, "tx-overwinter-not-active");
//return state.DoS(isInitBlockDownload() ? 0 : dosLevel,error("ContextualCheckTransaction(): ht.%d activates.%d dosLevel.%d overwinter is not active yet",nHeight, Params().GetConsensus().vUpgrades[Consensus::UPGRADE_OVERWINTER].nActivationHeight, dosLevel),REJECT_INVALID, "tx-overwinter-not-active");
}
*/
if (saplingActive) {
// Reject transactions with valid version but missing overwintered flag
@@ -1428,7 +1418,7 @@ int32_t hush_isnotaryvout(char *coinaddr,uint32_t tiptime) {
bool istush = strncmp(SMART_CHAIN_SYMBOL, "TUSH",4) == 0 ? true : false;
int32_t height = chainActive.LastTip()->GetHeight();
int32_t season = (ishush3 || istush) ? gethushseason(height) : getacseason(tiptime);
fprintf(stderr,"%s: season=%d, tiptime=%d\n", __func__, season,tiptime);
fprintf(stderr,"%s: coinaddr=%s season=%d, tiptime=%d\n", __func__, coinaddr, season,tiptime);
if ( NOTARY_ADDRESSES[season-1][0][0] == 0 ) {
uint8_t pubkeys[64][33];
hush_notaries(pubkeys,0,tiptime);
@@ -1530,11 +1520,20 @@ bool CheckTransactionWithoutProofVerification(uint32_t tiptime,const CTransactio
{
char destaddr[65];
Getscriptaddress(destaddr,txout.scriptPubKey);
if ( hush_isnotaryvout(destaddr,tiptime) == 0 )
{
invalid_private_taddr = 1;
fprintf(stderr,"%s: invalid taddr %s on private chain!\n", __func__, destaddr);
//return state.DoS(100, error("CheckTransaction(): this is a private chain, no public allowed"),REJECT_INVALID, "bad-txns-acprivacy-chain");
const bool isburn = (strcmp(destaddr,BURN_ADDRESS) == 0);
if ((ASSETCHAINS_BURN == 1) && isburn && tx.vin.empty()) {
// -ac_burn=1 means only zaddrs can send to the burn address
fprintf(stderr,"%s: allowing zaddr to send to burn address %s on private chain because ac_burn=1\n", __func__, destaddr);
} else if ((ASSETCHAINS_BURN == 2) && isburn) {
// -ac_burn=2 allows notary taddrs to send directly to the burn address
fprintf(stderr,"%s: allowing burn address %s on private chain because ac_burn=2\n", __func__, destaddr);
} else {
invalid_private_taddr = 1;
fprintf(stderr,"%s: invalid taddr %s on private chain!\n", __func__, destaddr);
}
}
}
}
@@ -1731,22 +1730,6 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa
tiptime = (uint32_t)time(NULL);
else tiptime = (uint32_t)chainActive.LastTip()->nTime;
/*
// Node operator can choose to reject tx by number of transparent inputs
static_assert(std::numeric_limits<size_t>::max() >= std::numeric_limits<int64_t>::max(), "size_t too small");
const size_t limit = 0; //(size_t) GetArg("-mempooltxinputlimit", 0);
// Limit is ignored if Overwinter is active, which is the case on HUSH3 and all HAC's
if (NetworkUpgradeActive(nextBlockHeight, Params().GetConsensus(), Consensus::UPGRADE_OVERWINTER)) {
limit = 0;
}
if (limit > 0) {
size_t n = tx.vin.size();
if (n > limit) {
LogPrint("mempool", "Dropping txid %s : too many transparent inputs %zu > limit %zu\n", tx.GetHash().ToString(), n, limit );
return false;
}
}
*/
auto verifier = libzcash::ProofVerifier::Strict();
if (!CheckTransaction(tiptime,tx, state, verifier, 0, 0))
@@ -1853,11 +1836,6 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa
return state.Invalid(false, REJECT_DUPLICATE, "already have coins");
}
//if (tx.IsCoinImport() || tx.IsPegsImport()) {
// // Inverse of normal case; if input exists, it's been spent
// if (ExistsImportTombstone(tx, view))
// return state.Invalid(false, REJECT_DUPLICATE, "import tombstone exists");
//} else
{
// do all inputs exist?
// Note that this does not check for the presence of actual outputs (see the next check for that),
@@ -1919,13 +1897,11 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa
// Keep track of transactions that spend a coinbase, which we re-scan
// during reorgs to ensure COINBASE_MATURITY is still met.
bool fSpendsCoinbase = false;
if (!tx.IsCoinImport() && !tx.IsPegsImport()) {
BOOST_FOREACH(const CTxIn &txin, tx.vin) {
const CCoins *coins = view.AccessCoins(txin.prevout.hash);
if (coins->IsCoinBase()) {
fSpendsCoinbase = true;
break;
}
BOOST_FOREACH(const CTxIn &txin, tx.vin) {
const CCoins *coins = view.AccessCoins(txin.prevout.hash);
if (coins->IsCoinBase()) {
fSpendsCoinbase = true;
break;
}
}
// Grab the branch ID we expect this transaction to commit to. We don't
@@ -1957,7 +1933,7 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa
// Continuously rate-limit free (really, very-low-fee) transactions
// This mitigates 'penny-flooding' -- sending thousands of free transactions just to
// be annoying or make others' transactions take longer to confirm.
if (fLimitFree && nFees < ::minRelayTxFee.GetFee(nSize) && !tx.IsCoinImport() && !tx.IsPegsImport())
if (fLimitFree && nFees < ::minRelayTxFee.GetFee(nSize) )
{
static CCriticalSection csFreeLimiter;
static double dFreeCount;
@@ -1980,7 +1956,17 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa
dFreeCount += nSize;
}
if (!tx.IsCoinImport() && !tx.IsPegsImport() && fRejectAbsurdFee && nFees > ::minRelayTxFee.GetFee(nSize) * 10000 && nFees > nValueOut/19)
fRejectAbsurdFee = false;
if ( fRejectAbsurdFee && nFees > ::minRelayTxFee.GetFee(nSize) * 10000 && nFees > nValueOut/19)
// Disable checks for absurd fees when adding to the mempool. Instead, this check is done
// when a user attempts to make a transaction with an absurd fee and only rejects absurd
// fees when OP_RETURN data is NOT being used. This means users making normal financial
// transactions (z2z) are protected from absurd fees, it is only users who are storing
// arbitrary data via a z2t transaction are allowed to (or potentially required) to pay high fees
// It would be nice to detect the use of OP_RETURN right here but it seems to only be known
// inside of IsStandard() inside of IsStandardTx() and we want to avoid doing expensive checks
// multiple times.
{
string errmsg = strprintf("absurdly high fees %s, %d > %d",
hash.ToString(),
@@ -1988,7 +1974,7 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa
LogPrint("mempool", errmsg.c_str());
return state.Error("AcceptToMemoryPool: " + errmsg);
}
//fprintf(stderr,"addmempool 6\n");
//fprintf(stderr,"addmempool 6\n");
// Check against previous transactions
// This is done last to help prevent CPU exhaustion denial-of-service attacks.
@@ -2028,17 +2014,15 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa
LOCK(pool.cs);
// Store transaction in memory
pool.addUnchecked(hash, entry, !IsInitialBlockDownload());
if (!tx.IsCoinImport())
{
// Add memory address index
if (fAddressIndex) {
pool.addAddressIndex(entry, view);
}
// Add memory spent index
if (fSpentIndex) {
pool.addSpentIndex(entry, view);
}
// Add memory address index
if (fAddressIndex) {
pool.addAddressIndex(entry, view);
}
// Add memory spent index
if (fSpentIndex) {
pool.addSpentIndex(entry, view);
}
}
}
@@ -2579,7 +2563,7 @@ void UpdateCoins(const CTransaction& tx, CCoinsViewCache& inputs, CTxUndo &txund
{
txundo.vprevout.reserve(tx.vin.size());
BOOST_FOREACH(const CTxIn &txin, tx.vin) {
if (tx.IsPegsImport() && txin.prevout.n==10e8) continue;
//if (tx.IsPegsImport() && txin.prevout.n==10e8) continue;
CCoinsModifier coins = inputs.ModifyCoins(txin.prevout.hash);
unsigned nPos = txin.prevout.n;
@@ -2601,12 +2585,6 @@ void UpdateCoins(const CTransaction& tx, CCoinsViewCache& inputs, CTxUndo &txund
inputs.SetNullifiers(tx, true);
inputs.ModifyCoins(tx.GetHash())->FromTx(tx, nHeight); // add outputs
// Unorthodox state
//if (tx.IsCoinImport() || tx.IsPegsImport()) {
// // add a tombstone for the burnTx
// AddImportTombstone(tx, inputs, nHeight);
//}
}
void UpdateCoins(const CTransaction& tx, CCoinsViewCache& inputs, int nHeight)
@@ -2647,13 +2625,6 @@ namespace Consensus {
CAmount nFees = 0;
for (unsigned int i = 0; i < tx.vin.size(); i++)
{
/*
if (tx.IsPegsImport() && i==0)
{
nValueIn=GetCoinImportValue(tx);
continue;
}
*/
const COutPoint &prevout = tx.vin[i].prevout;
const CCoins *coins = inputs.AccessCoins(prevout.hash);
assert(coins);
@@ -2707,6 +2678,31 @@ namespace Consensus {
if (!MoneyRange(nFees))
return state.DoS(100, error("CheckInputs(): nFees out of range"),
REJECT_INVALID, "bad-txns-fee-outofrange");
//NOTE: Since we have access to fee here, verify that opreturn pays
//required minimum fee, even though this is a check on outputs not
//inputs. If we don't do it here we would need to duplicate already
//done work somewhere else
if ( ASSETCHAINS_MINOPRETURNFEE > 0 ) {
BOOST_FOREACH(const CTxOut& txout, tx.vout) {
const bool isopret = txout.scriptPubKey.IsOpReturn();
// HUSH+DRGX do not use -ac_minopreturnfee so this does not (yet)
// affect those chains, they will need a height activated consensus
// change
if ( isopret ) {
// Is there any difference between nTxFee and nFees ?
// They seem to be 2 vars with the same value
fprintf(stderr,"%s: opreturn=1 nFees=%ld nTxFee=%ld\n", __func__, nFees, nTxFee);
if (nTxFee < ASSETCHAINS_MINOPRETURNFEE) {
return state.DoS(100,error("CheckInputs(): tx does not have required mininum fee for OP_RETURN"), REJECT_INVALID, "bad-txns-minopreturnfee");
}
}
}
}
return true;
}
}// namespace Consensus
@@ -2741,7 +2737,7 @@ bool ContextualCheckInputs(
// still computed and checked, and any change will be caught at the next checkpoint.
if (fScriptChecks) {
for (unsigned int i = 0; i < tx.vin.size(); i++) {
if (tx.IsPegsImport() && i==0) continue;
//if (tx.IsPegsImport() && i==0) continue;
const COutPoint &prevout = tx.vin[i].prevout;
const CCoins* coins = inputs.AccessCoins(prevout.hash);
assert(coins);
@@ -2777,15 +2773,6 @@ bool ContextualCheckInputs(
}
}
/*
if (tx.IsCoinImport() || tx.IsPegsImport())
{
LOCK(cs_main);
ServerTransactionSignatureChecker checker(&tx, 0, 0, false, txdata);
return VerifyCoinImport(tx.vin[0].scriptSig, checker, state);
}
*/
return true;
}
@@ -2941,10 +2928,6 @@ int8_t GetAddressType(const CScript &scriptPubKey, CTxDestination &vDest, txnout
{
keyType = 2;
}
else if (txType == TX_CRYPTOCONDITION )
{
keyType = 3;
}
}
return keyType;
}
@@ -3021,11 +3004,11 @@ bool DisconnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex
// restore inputs
if (!tx.IsMint()) {
CTxUndo &txundo = blockUndo.vtxundo[i-1];
if (tx.IsPegsImport()) txundo.vprevout.insert(txundo.vprevout.begin(),CTxInUndo());
//if (tx.IsPegsImport()) txundo.vprevout.insert(txundo.vprevout.begin(),CTxInUndo());
if (txundo.vprevout.size() != tx.vin.size())
return error("DisconnectBlock(): transaction and undo data inconsistent");
for (unsigned int j = tx.vin.size(); j-- > 0;) {
if (tx.IsPegsImport() && j==0) continue;
//if (tx.IsPegsImport() && j==0) continue;
const COutPoint &out = tx.vin[j].prevout;
const CTxInUndo &undo = txundo.vprevout[j];
if (!ApplyTxInUndo(undo, view, out))
@@ -3059,12 +3042,6 @@ bool DisconnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex
}
}
}
/*
else if (tx.IsCoinImport() || tx.IsPegsImport())
{
RemoveImportTombstone(tx, view);
}
*/
}
// set the old best Sprout anchor back
@@ -3372,7 +3349,7 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin
{
for (size_t j = 0; j < tx.vin.size(); j++)
{
if (tx.IsPegsImport() && j==0) continue;
//if (tx.IsPegsImport() && j==0) continue;
const CTxIn input = tx.vin[j];
const CTxOut &prevout = view.GetOutputFor(tx.vin[j]);
@@ -4333,7 +4310,15 @@ bool ActivateBestChain(bool fSkipdpow, CValidationState &state, CBlock *pblock)
CBlockIndex *pindexMostWork = NULL;
const CChainParams& chainParams = Params();
do {
boost::this_thread::interruption_point();
// Sleep briefly to allow other threads a chance at grabbing cs_main if
// we are connecting a long chain of blocks and would otherwise hold the
// lock almost continuously. This helps
// the internal wallet, if it is enabled, to keep up with the connected
// blocks, reducing the overall time until the node becomes usable.
//
// This is defined to be an interruption point.
// <https://www.boost.org/doc/libs/1_72_0/doc/html/thread/thread_management.html#interruption_points>
boost::this_thread::sleep_for(boost::chrono::microseconds(200));
if (ShutdownRequested())
break;
@@ -6886,7 +6871,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
LogPrintf("dropmessagestest DROPPING RECV MESSAGE\n");
return true;
}
auto p2pdebug = GetArg("-p2pdebug",0);
const bool p2pdebug = GetArg("-p2pdebug",0);
if(p2pdebug)
fprintf(stderr,"%s: netmsg: %s from %s\n", __func__, strCommand.c_str(), pfrom->addr.ToString().c_str() );
@@ -6913,10 +6898,9 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
CAddress addrFrom;
uint64_t nNonce = 1;
int nVersion; // use temporary for version, don't set version number until validated as connected
int minVersion = MIN_PEER_PROTO_VERSION;
const int minVersion = ishush3 ? MIN_HUSH_PEER_PROTO_VERSION : MIN_PEER_PROTO_VERSION;
vRecv >> nVersion >> pfrom->nServices >> nTime >> addrMe;
if (nVersion == 10300)
nVersion = 300;
if (nVersion < minVersion)
{
// disconnect from peers older than this proto version

View File

@@ -118,6 +118,7 @@ public:
extern int8_t ASSETCHAINS_ADAPTIVEPOW;
extern uint32_t ASSETCHAINS_RANDOMX;
extern uint32_t ASSETCHAINS_MINOPRETURNFEE;
extern bool fRandomXDebug;
extern std::string devtax_scriptpub_for_height(uint32_t nHeight);
@@ -200,19 +201,20 @@ CBlockTemplate* CreateNewBlock(CPubKey _pk,const CScript& _scriptPubKeyIn, int32
//fprintf(stderr,"%s: added dummy coinbase\n", __func__);
// Largest block you're willing to create:
unsigned int nBlockMaxSize = GetArg("-blockmaxsize", MAX_BLOCK_SIZE(chainActive.LastTip()->GetHeight()+1));
unsigned int nBlockMaxSize = GetArg("-blockmaxsize", MAX_BLOCK_SIZE(1)); // MAX_BLOCK_SIZE(chainActive.LastTip()->GetHeight()+1));
// Limit to betweeen 1K and MAX_BLOCK_SIZE-1K for sanity:
nBlockMaxSize = std::max((unsigned int)1000, std::min((unsigned int)(MAX_BLOCK_SIZE(chainActive.LastTip()->GetHeight()+1)-1000), nBlockMaxSize));
nBlockMaxSize = std::max((unsigned int)1000, std::min((unsigned int)(MAX_BLOCK_SIZE(1)-1000), nBlockMaxSize));
//nBlockMaxSize = std::max((unsigned int)1000, std::min((unsigned int)(MAX_BLOCK_SIZE(chainActive.LastTip()->GetHeight()+1)-1000), nBlockMaxSize));
// How much of the block should be dedicated to high-priority transactions,
// included regardless of the fees they pay
unsigned int nBlockPrioritySize = GetArg("-blockprioritysize", DEFAULT_BLOCK_PRIORITY_SIZE);
nBlockPrioritySize = std::min(nBlockMaxSize, nBlockPrioritySize);
const unsigned int nBlockPrioritySize = std::min( nBlockMaxSize, (unsigned int) GetArg("-blockprioritysize", DEFAULT_BLOCK_PRIORITY_SIZE) );
// nBlockPrioritySize = std::min(nBlockMaxSize, nBlockPrioritySize);
// Minimum block size you want to create; block will be filled with free transactions
// until there are no more or the block reaches this size:
unsigned int nBlockMinSize = GetArg("-blockminsize", DEFAULT_BLOCK_MIN_SIZE);
nBlockMinSize = std::min(nBlockMaxSize, nBlockMinSize);
const unsigned int nBlockMinSize = std::min(nBlockMaxSize, (unsigned int) GetArg("-blockminsize", DEFAULT_BLOCK_MIN_SIZE));
// nBlockMinSize = std::min(nBlockMaxSize, nBlockMinSize);
//fprintf(stderr,"%s: nBlockMaxSize=%u, nBlockPrioritySize=%u, nBlockMinSize=%u\n", __func__, nBlockMaxSize, nBlockPrioritySize, nBlockMinSize);
@@ -308,12 +310,7 @@ CBlockTemplate* CreateNewBlock(CPubKey _pk,const CScript& _scriptPubKeyIn, int32
bool fMissingInputs = false;
bool fNotarization = false;
std::vector<int8_t> TMP_NotarizationNotaries;
//if (tx.IsCoinImport())
//{
// CAmount nValueIn = GetCoinImportValue(tx); // burn amount
// nTotalIn += nValueIn;
// dPriority += (double)nValueIn * 1000; // flat multiplier... max = 1e16.
//} else
{
TMP_NotarizationNotaries.clear();
bool fToCryptoAddress = false;
@@ -322,15 +319,6 @@ CBlockTemplate* CreateNewBlock(CPubKey _pk,const CScript& _scriptPubKeyIn, int32
BOOST_FOREACH(const CTxIn& txin, tx.vin)
{
/*
if (tx.IsPegsImport() && txin.prevout.n==10e8)
{
CAmount nValueIn = GetCoinImportValue(tx); // burn amount
nTotalIn += nValueIn;
dPriority += (double)nValueIn * 1000; // flat multiplier... max = 1e16.
continue;
}
*/
// Read prev transaction
if (!view.HaveCoins(txin.prevout.hash))
{
@@ -488,38 +476,6 @@ CBlockTemplate* CreateNewBlock(CPubKey _pk,const CScript& _scriptPubKeyIn, int32
unsigned int nTxSize = ::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION);
// fprintf(stderr,"%s: nTxSize = %u\n", __func__, nTxSize);
// Opret spam limits
if (mapArgs.count("-opretmintxfee"))
{
CAmount n = 0;
CFeeRate opretMinFeeRate;
if (ParseMoney(mapArgs["-opretmintxfee"], n) && n > 0)
opretMinFeeRate = CFeeRate(n);
else
opretMinFeeRate = CFeeRate(400000); // default opretMinFeeRate (1 HUSH per 250 Kb = 0.004 per 1 Kb = 400000 puposhis per 1 Kb)
bool fSpamTx = false;
unsigned int nTxSize = ::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION);
unsigned int nTxOpretSize = 0;
// calc total oprets size
BOOST_FOREACH(const CTxOut& txout, tx.vout) {
if (txout.scriptPubKey.IsOpReturn()) {
CScript::const_iterator it = txout.scriptPubKey.begin() + 1;
opcodetype op;
std::vector<uint8_t> opretData;
if (txout.scriptPubKey.GetOp(it, op, opretData)) {
//std::cerr << HexStr(opretData.begin(), opretData.end()) << std::endl;
nTxOpretSize += opretData.size();
}
}
}
if ((nTxOpretSize > 256) && (feeRate < opretMinFeeRate)) fSpamTx = true;
// std::cerr << tx.GetHash().ToString() << " nTxSize." << nTxSize << " nTxOpretSize." << nTxOpretSize << " feeRate." << feeRate.ToString() << " opretMinFeeRate." << opretMinFeeRate.ToString() << " fSpamTx." << fSpamTx << std::endl;
if (fSpamTx) continue;
// std::cerr << tx.GetHash().ToString() << " vecPriority.size() = " << vecPriority.size() << std::endl;
}
if (nBlockSize + nTxSize >= nBlockMaxSize-512) // room for extra autotx
{
@@ -563,6 +519,40 @@ CBlockTemplate* CreateNewBlock(CPubKey _pk,const CScript& _scriptPubKeyIn, int32
}
CAmount nTxFees = view.GetValueIn(chainActive.LastTip()->GetHeight(),&interest,tx,chainActive.LastTip()->nTime)-tx.GetValueOut();
// Opret spam limits
CAmount opretMinFee = 1 * COIN;
// Set with -ac_minopreturnfee
if (ASSETCHAINS_MINOPRETURNFEE > 0) {
opretMinFee = ASSETCHAINS_MINOPRETURNFEE;
}
{
bool fSpamTx = false;
unsigned int nTxSize = ::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION);
unsigned int nTxOpretSize = 0;
// calc total oprets size
BOOST_FOREACH(const CTxOut& txout, tx.vout) {
if (txout.scriptPubKey.IsOpReturn()) {
CScript::const_iterator it = txout.scriptPubKey.begin() + 1;
opcodetype op;
std::vector<uint8_t> opretData;
if (txout.scriptPubKey.GetOp(it, op, opretData)) {
//std::cerr << HexStr(opretData.begin(), opretData.end()) << std::endl;
nTxOpretSize += opretData.size();
}
}
}
if (nTxOpretSize > 0 && nTxFees < opretMinFee) {
fSpamTx = true;
std::cerr << __func__ << ": " << tx.GetHash().ToString() << " nTxSize=" << nTxSize << " nTxOpretSize=" << nTxOpretSize << " feeRate=" << feeRate.ToString() << " opretMinFee=" << opretMinFee << " nTxFees=" << nTxFees <<" fSpamTx=" << fSpamTx << std::endl;
continue;
}
// std::cerr << tx.GetHash().ToString() << " vecPriority.size() = " << vecPriority.size() << std::endl;
}
nTxSigOps += GetP2SHSigOpCount(tx, view);
if (nBlockSigOps + nTxSigOps >= MAX_BLOCK_SIGOPS-1)
{
@@ -711,7 +701,7 @@ CBlockTemplate* CreateNewBlock(CPubKey _pk,const CScript& _scriptPubKeyIn, int32
if ( totalsats == 0 )
{
fprintf(stderr, "Could not create notary payment, trying again.\n");
if ( SMART_CHAIN_SYMBOL[0] == 0 || (SMART_CHAIN_SYMBOL[0] != 0 && !isStake) )
if ( !isStake )
{
LEAVE_CRITICAL_SECTION(cs_main);
LEAVE_CRITICAL_SECTION(mempool.cs);
@@ -749,59 +739,21 @@ CBlockTemplate* CreateNewBlock(CPubKey _pk,const CScript& _scriptPubKeyIn, int32
pblock->hashFinalSaplingRoot = sapling_tree.root();
// all PoS chains need this data in the block at all times
if ( ASSETCHAINS_LWMAPOS || ASSETCHAINS_STAKED == 0 || HUSH_MININGTHREADS > 0 )
if ( ASSETCHAINS_LWMAPOS || HUSH_MININGTHREADS > 0 )
{
UpdateTime(pblock, Params().GetConsensus(), pindexPrev);
pblock->nBits = GetNextWorkRequired(pindexPrev, pblock, Params().GetConsensus());
}
pblock->nSolution.clear();
pblocktemplate->vTxSigOps[0] = GetLegacySigOpCount(pblock->vtx[0]);
/*
if ( SMART_CHAIN_SYMBOL[0] == 0 && IS_HUSH_NOTARY != 0 && My_notaryid >= 0 )
{
uint32_t r; CScript opret; void **ptr=0;
CMutableTransaction txNotary = CreateNewContextualCMutableTransaction(Params().GetConsensus(), chainActive.Height() + 1);
if ( pblock->nTime < pindexPrev->nTime+60 )
pblock->nTime = pindexPrev->nTime + 60;
if ( gpucount < 33 )
{
uint8_t tmpbuffer[40]; uint32_t r; int32_t n=0; uint256 randvals;
memcpy(&tmpbuffer[n],&My_notaryid,sizeof(My_notaryid)), n += sizeof(My_notaryid);
memcpy(&tmpbuffer[n],&Mining_height,sizeof(Mining_height)), n += sizeof(Mining_height);
memcpy(&tmpbuffer[n],&pblock->hashPrevBlock,sizeof(pblock->hashPrevBlock)), n += sizeof(pblock->hashPrevBlock);
vcalc_sha256(0,(uint8_t *)&randvals,tmpbuffer,n);
memcpy(&r,&randvals,sizeof(r));
pblock->nTime += (r % (33 - gpucount)*(33 - gpucount));
}
if ( hush_notaryvin(txNotary,NOTARY_PUBKEY33,ptr) > 0 )
{
CAmount txfees = 5000;
pblock->vtx.push_back(txNotary);
pblocktemplate->vTxFees.push_back(txfees);
pblocktemplate->vTxSigOps.push_back(GetLegacySigOpCount(txNotary));
nFees += txfees;
pblocktemplate->vTxFees[0] = -nFees;
//*(uint64_t *)(&pblock->vtx[0].vout[0].nValue) += txfees;
//fprintf(stderr,"added notaryvin\n");
} else {
fprintf(stderr,"error adding notaryvin, need to create 0.0001 utxos\n");
if ( SMART_CHAIN_SYMBOL[0] == 0 || (SMART_CHAIN_SYMBOL[0] != 0 && !isStake) )
{
LEAVE_CRITICAL_SECTION(cs_main);
LEAVE_CRITICAL_SECTION(mempool.cs);
}
return(0);
}
} else */
if ( ASSETCHAINS_CC == 0 && pindexPrev != 0 && ASSETCHAINS_STAKED == 0 && (SMART_CHAIN_SYMBOL[0] != 0 || IS_HUSH_NOTARY == 0 || My_notaryid < 0) )
if ( ASSETCHAINS_CC == 0 && pindexPrev != 0 && (IS_HUSH_NOTARY == 0 || My_notaryid < 0) )
{
CValidationState state;
//fprintf(stderr,"%s: check validity\n", __func__);
if ( !TestBlockValidity(state, *pblock, pindexPrev, false, false)) // invokes CC checks
{
if ( (SMART_CHAIN_SYMBOL[0] != 0 && !isStake) )
if ( !isStake )
{
LEAVE_CRITICAL_SECTION(cs_main);
LEAVE_CRITICAL_SECTION(mempool.cs);
@@ -813,11 +765,10 @@ CBlockTemplate* CreateNewBlock(CPubKey _pk,const CScript& _scriptPubKeyIn, int32
//fprintf(stderr,"valid\n");
}
}
if ( (SMART_CHAIN_SYMBOL[0] != 0 && !isStake) )
{
LEAVE_CRITICAL_SECTION(cs_main);
LEAVE_CRITICAL_SECTION(mempool.cs);
}
LEAVE_CRITICAL_SECTION(cs_main);
LEAVE_CRITICAL_SECTION(mempool.cs);
// fprintf(stderr,"%s: done\n", __func__);
return pblocktemplate.release();
}
@@ -837,7 +788,7 @@ void IncrementExtraNonce(CBlock* pblock, CBlockIndex* pindexPrev, unsigned int&
hashPrevBlock = pblock->hashPrevBlock;
}
++nExtraNonce;
unsigned int nHeight = pindexPrev->GetHeight()+1; // Height first in coinbase required for block.version=2
const unsigned int nHeight = pindexPrev->GetHeight()+1; // Height first in coinbase required for block.version=2
CMutableTransaction txCoinbase(pblock->vtx[0]);
txCoinbase.vin[0].scriptSig = (CScript() << nHeight << CScriptNum(nExtraNonce)) + COINBASE_FLAGS;
assert(txCoinbase.vin[0].scriptSig.size() <= 100);
@@ -931,6 +882,7 @@ static bool ProcessBlockFound(CBlock* pblock)
// Found a solution
{
LOCK(cs_main);
if (pblock->hashPrevBlock != chainActive.LastTip()->GetBlockHash())
{
uint256 hash; int32_t i;
@@ -1128,15 +1080,15 @@ void static RandomXMiner()
char randomxHash[RANDOMX_HASH_SIZE];
rxdebug("%s: created randomxHash of size %d\n", RANDOMX_HASH_SIZE);
char randomxKey[82]; // randomx spec says keysize of >60 bytes is implementation-specific
// initial randomx key is unique to every Hush Smart Chain, and has at least 9 bytes (2^9=128 bits) of entropy
// initial randomx key is unique to every Hush Arrakis Chain, and has at least 9 bytes (2^9=128 bits) of entropy
// since magic is 4 bytes, rpc port is 4 bytes and smart chain symbol must be at least 1 character long
snprintf(randomxKey, 81, "%08x%s%08x", ASSETCHAINS_MAGIC, SMART_CHAIN_SYMBOL, ASSETCHAINS_RPCPORT);
// With the defaults of 1024 and 64
// the key block will change every ~21.3 hours with a 75s block time
// and every ~17 hours with the default 60s block time for HSCs
// and every ~17 hours with the default 60s block time for HACs
static int randomxInterval = GetRandomXInterval();
// This lag is 80 mins for 75s blocktime and 64 mins for 60s (default) blocktime for HSCs
// This lag is 80 mins for 75s blocktime and 64 mins for 60s (default) blocktime for HACs
static int randomxBlockLag = GetRandomXBlockLag();
randomx_vm *myVM = nullptr;
@@ -1174,7 +1126,11 @@ void static RandomXMiner()
// Create new block
unsigned int nTransactionsUpdatedLast = mempool.GetTransactionsUpdated();
CBlockIndex* pindexPrev = chainActive.LastTip();
CBlockIndex* pindexPrev;
{
LOCK(cs_main);
pindexPrev = chainActive.LastTip();
}
// If we don't have a valid chain tip to work from, wait and try again.
if (pindexPrev == nullptr) {
@@ -1198,7 +1154,7 @@ void static RandomXMiner()
} else {
rxdebug("%s: calculating keyHeight with randomxInterval=%d\n", randomxInterval);
// At heights between intervals, we use the same block key and wait randomxBlockLag blocks until changing
int keyHeight = ((Mining_height - randomxBlockLag) / randomxInterval) * randomxInterval;
const int keyHeight = ((Mining_height - randomxBlockLag) / randomxInterval) * randomxInterval;
uint256 randomxBlockKey = chainActive[keyHeight]->GetBlockHash();
randomx_init_cache(randomxCache, &randomxBlockKey, sizeof randomxBlockKey);
@@ -1210,10 +1166,10 @@ void static RandomXMiner()
rxdebug("%s: initializing dataset with %d threads\n", initThreadCount);
std::vector<std::thread> threads;
uint32_t startItem = 0;
auto perThread = datasetItemCount / initThreadCount;
auto remainder = datasetItemCount % initThreadCount;
const auto perThread = datasetItemCount / initThreadCount;
const auto remainder = datasetItemCount % initThreadCount;
for (int i = 0; i < initThreadCount; ++i) {
auto count = perThread + (i == initThreadCount - 1 ? remainder : 0);
const auto count = perThread + (i == initThreadCount - 1 ? remainder : 0);
threads.push_back(std::thread(&randomx_init_dataset, randomxDataset, randomxCache, startItem, count));
startItem += count;
}
@@ -1252,7 +1208,7 @@ void static RandomXMiner()
return;
}
static uint32_t counter;
if ( counter++ < 10 && ASSETCHAINS_STAKED == 0 )
if ( counter++ < 10 )
fprintf(stderr,"RandomXMiner: created illegal blockB, retry with counter=%u\n", counter);
sleep(1);
continue;
@@ -1367,6 +1323,7 @@ void static RandomXMiner()
}
CValidationState state;
//{ LOCK(cs_main);
if ( !TestBlockValidity(state,B, chainActive.LastTip(), true, false))
{
h = UintToArith256(B.GetHash());
@@ -1377,6 +1334,7 @@ void static RandomXMiner()
fprintf(stderr,"\n");
return(false);
}
//}
SetThreadPriority(THREAD_PRIORITY_NORMAL);
LogPrintf("HushRandomXMiner:\n");
LogPrintf("proof-of-work found \n hash: %s \ntarget: %s\n", B.GetHash().GetHex(), HASHTarget.GetHex());
@@ -1444,10 +1402,8 @@ void static RandomXMiner()
rxdebug("%s: going to destroy rx VM\n");
randomx_destroy_vm(myVM);
rxdebug("%s: destroyed VM\n");
}
} catch (const boost::thread_interrupted&) {
miningTimer.stop();
c.disconnect();
@@ -1735,6 +1691,8 @@ void static BitcoinMiner()
fprintf(stderr," mined %s block %d!\n",SMART_CHAIN_SYMBOL,Mining_height);
}
CValidationState state;
//{ LOCK(cs_main);
if ( !TestBlockValidity(state,B, chainActive.LastTip(), true, false))
{
h = UintToArith256(B.GetHash());
@@ -1744,6 +1702,8 @@ void static BitcoinMiner()
gotinvalid = 1;
return(false);
}
//}
HUSH_CHOSEN_ONE = 1;
// Found a solution
SetThreadPriority(THREAD_PRIORITY_NORMAL);

View File

@@ -50,6 +50,9 @@ extern int32_t HUSH_TESTNODE;
// Satoshi originally used 10 seconds(!), did they know something Peter Wuille didn't?
#define DUMP_ADDRESSES_INTERVAL 300
// Run asmap health check every 24hr by default
#define ASMAP_HEALTHCHECK_INTERVAL 24*60*60
// This is every 2 blocks, on avg, on HUSH3
#define DUMP_ZINDEX_INTERVAL 150
@@ -1648,6 +1651,35 @@ int64_t PoissonNextSend(int64_t now, int average_interval_seconds)
return now + (int64_t)(log1p(GetRand(1ULL << 48) * -0.0000000000000035527136788 /* -1/2^48 */) * average_interval_seconds * -1000000.0 + 0.5);
}
void ASMapHealthCheck() {
// No health check if clearnet is disabled
if (!GetBoolArg("-clearnet", DEFAULT_CLEARNET)) {
return;
}
std::set<uint32_t> clearnet_asns{};
int unmapped_count{0};
LOCK(cs_vNodes);
for (const auto& pnode : vNodes) {
auto address = pnode->addr;
if(address.IsTor() || address.IsI2P() || address.IsCJDNS()) {
// These networks do not have ASNs, skip them
continue;
}
uint32_t asn = address.GetMappedAS(addrman.m_asmap);
if (asn == 0) {
++unmapped_count;
continue;
}
clearnet_asns.insert(asn);
}
LogPrintf("ASMap Health Check: %i clearnet peers are mapped to %i ASNs with %i peers being unmapped\n", vNodes.size(), clearnet_asns.size(), unmapped_count);
}
void ThreadOpenConnections()
{
// Connect to specific addresses
@@ -1753,7 +1785,7 @@ void ThreadOpenConnections()
int64_t nNow = GetTime();
int nTries = 0;
LogPrint("net", "Resolving addrman collisions\n");
LogPrint("net", "Resolving addrman collisions\n");
addrman.ResolveCollisions();
while (true) {
@@ -2378,10 +2410,14 @@ void StartNode(boost::thread_group& threadGroup, CScheduler& scheduler)
scheduler.scheduleEvery(&DumpZindexStats, DUMP_ZINDEX_INTERVAL);
}
// Dump network addresses
scheduler.scheduleEvery(&DumpAddresses, DUMP_ADDRESSES_INTERVAL);
// Look for ~/.hush/AC_NAME/plz_stop
scheduler.scheduleEvery(&CheckIfWeShouldStop, CHECK_PLZ_STOP_INTERVAL);
// Schedule ASMap Health check to run regularly
scheduler.scheduleEvery(&ASMapHealthCheck, ASMAP_HEALTHCHECK_INTERVAL);
// and schedule it to run once in 5 mins when we hopefully have peers connected
scheduler.scheduleFromNow(&ASMapHealthCheck, 300);
}
bool StopNode()
@@ -2470,7 +2506,9 @@ void RelayTransaction(const CTransaction& tx, const CDataStream& ss)
// If we have no nodes to relay to, there is nothing to do
if(vNodes.size() == 0) {
fprintf(stderr, "%s: No nodes to relay to!\n", __func__ );
if (HUSH_TESTNODE==0) {
fprintf(stderr, "%s: No nodes to relay to!\n", __func__ );
}
return;
}
@@ -2733,7 +2771,7 @@ bool CNode::GetTlsValidate()
{
if (tlsValidate == eTlsOption::FALLBACK_UNSET)
{
// This is useful for private Hush Smart Chains, that want to exist
// This is useful for private Hush Arrakis Chains, that want to exist
// on a closed VPN with an internal CA or trusted cert system, or
// various other use cases
if ( GetBoolArg("-tlsvalidate", false)) {
@@ -2927,6 +2965,7 @@ void SetNetworkActive(bool active)
if (!fNetworkActive) {
LOCK(cs_vNodes);
// Close sockets to all nodes
LogPrint("net", "%s: closing sockets to all nodes\n", __func__);
for (CNode* pnode : vNodes) {
pnode->CloseSocketDisconnect();
}

View File

@@ -85,6 +85,15 @@ static const unsigned int MAX_PROTOCOL_MESSAGE_LENGTH = (_MAX_BLOCK_SIZE + 24);
static const unsigned int MAX_SUBVERSION_LENGTH = 256;
/** -listen default */
static const bool DEFAULT_LISTEN = true;
/** -clearnet default */
static const bool DEFAULT_CLEARNET = true;
/** -disableipv4 default */
static const bool DEFAULT_DISABLE_IPV4 = false;
/** -disableipv6 default */
static const bool DEFAULT_DISABLE_IPV6 = false;
/** The maximum number of entries in mapAskFor */
static const size_t MAPASKFOR_MAX_SZ = MAX_INV_SZ;
/** The maximum number of entries in setAskFor (larger due to getdata latency)*/

View File

@@ -511,7 +511,7 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHead
// Changing this requires changing many other things and
// might change consensus. Have fun -- Duke
// NOTE: Ony HUSH3 mainnet should use this function, all HSC's should use params.AveragigWindowTimespan()
// NOTE: Ony HUSH3 mainnet should use this function, all HAC's should use params.AveragigWindowTimespan()
int64_t AveragingWindowTimespan() {
// used in const methods, beware!
// This is the correct AWT for 75s blocktime, before block 340k
@@ -578,7 +578,7 @@ unsigned int CalculateNextWorkRequired(arith_uint256 bnAvg,
return bnNew.GetCompact();
}
// HUSH does not use these functions but Hush Smart Chains can opt-in to using more bleeding edge DAA's
// HUSH does not use these functions but Hush Arrakis Chains can opt-in to using more bleeding edge DAA's
// ASIC chains do not need these protections as much -- Duke Leto
unsigned int lwmaGetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHeader *pblock, const Consensus::Params& params)
{

View File

@@ -693,7 +693,7 @@ public:
bool IsMint() const
{
return IsCoinImport() || IsCoinBase();
return IsCoinBase(); // || IsCoinImport();
}
bool IsCoinBase() const
@@ -705,7 +705,8 @@ public:
bool IsCoinImport() const
{
return (vin.size() == 1 && vin[0].prevout.n == 10e8);
return false;
//return (vin.size() == 1 && vin[0].prevout.n == 10e8);
}
bool IsPegsImport() const

View File

@@ -242,7 +242,7 @@ UniValue blockToDeltasJSON(const CBlock& block, const CBlockIndex* blockindex)
vector<unsigned char> hashBytes(out.scriptPubKey.begin()+3, out.scriptPubKey.begin()+23);
delta.push_back(Pair("address", CBitcoinAddress(CKeyID(uint160(hashBytes))).ToString()));
}
else if (out.scriptPubKey.IsPayToPublicKey() || out.scriptPubKey.IsPayToCryptoCondition()) {
else if (out.scriptPubKey.IsPayToPublicKey()) {
CTxDestination address;
if (ExtractDestination(out.scriptPubKey, address))
{
@@ -639,12 +639,6 @@ UniValue getblockhash(const UniValue& params, bool fHelp, const CPubKey& mypk)
return pblockindex->GetBlockHash().GetHex();
}
UniValue getlastsegidstakes(const UniValue& params, bool fHelp, const CPubKey& mypk)
{
UniValue ret(UniValue::VOBJ);
return ret;
}
UniValue getblockheader(const UniValue& params, bool fHelp, const CPubKey& mypk)
{
if (fHelp || params.size() < 1 || params.size() > 2)
@@ -862,7 +856,7 @@ UniValue getblockmerkletree(const UniValue& params, bool fHelp, const CPubKey& m
if (fHelp || params.size() != 1 )
throw runtime_error(
"getblockmerkletree height\n"
"\nGet full merkletree for a given Hush or HSC block height.\n"
"\nGet full merkletree for a given Hush or HAC block height.\n"
"\nArguments:\n"
"1. height (int, required) block height\n"
"\nResult:\n"
@@ -877,7 +871,7 @@ UniValue getblockmerkletree(const UniValue& params, bool fHelp, const CPubKey& m
int nHeight = params[0].get_int();
if ( (nHeight < 1) || (nHeight > chainActive.LastTip()->GetHeight()) ) {
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid Hush or HSC block height parameter");
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid Hush or HAC block height parameter");
}
phushblockindex = chainActive[nHeight];
@@ -1620,12 +1614,12 @@ UniValue getchaintxstats(const UniValue& params, bool fHelp, const CPubKey& mypk
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid block count: should be between 0 and the block's height - 1");
}
}
LogPrintf("%s: blockcount = %d\n", __func__, blockcount);
// LogPrintf("%s: blockcount = %d\n", __func__, blockcount);
const CBlockIndex* pindexPast = pindex->GetAncestor(pindex->GetHeight() - blockcount);
int nTimeDiff = pindex->GetMedianTimePast() - pindexPast->GetMedianTimePast();
int nTxDiff = pindex->nChainTx - pindexPast->nChainTx;
LogPrintf("%s: pindexPast.height = %d, pindex.height = %d\n", __func__, pindexPast->GetHeight(), pindex->GetHeight() );
// LogPrintf("%s: pindexPast.height = %d, pindex.height = %d\n", __func__, pindexPast->GetHeight(), pindex->GetHeight() );
UniValue ret(UniValue::VOBJ);
ret.pushKV("time", (int64_t)pindex->nTime);
@@ -1657,7 +1651,7 @@ UniValue getchaintxstats(const UniValue& params, bool fHelp, const CPubKey& mypk
ret.pushKV("window_tx_count", nTxDiff);
ret.pushKV("window_interval", nTimeDiff);
int64_t nPaymentsDiff = pindex->nChainPayments - pindexPast->nChainPayments;
LogPrintf("%s: pindexPast.nChainPayments = %d, pindex.nChainPayments = %d\n", __func__, pindexPast->nChainPayments, pindex->nChainPayments );
//LogPrintf("%s: pindexPast.nChainPayments = %d, pindex.nChainPayments = %d\n", __func__, pindexPast->nChainPayments, pindex->nChainPayments );
int64_t nShieldedTxDiff = pindex->nChainShieldedTx - pindexPast->nChainShieldedTx;
int64_t nShieldingTxDiff = pindex->nChainShieldingTx - pindexPast->nChainShieldingTx;
int64_t nDeshieldingTxDiff = pindex->nChainDeshieldingTx - pindexPast->nChainDeshieldingTx;

View File

@@ -90,10 +90,8 @@ static const CRPCConvertParam vRPCConvertParams[] =
{ "getblock", 1 },
{ "getblockheader", 1 },
{ "getchaintxstats", 0 },
{ "getlastsegidstakes", 0 },
{ "gettransaction", 1 },
{ "getrawtransaction", 1 },
{ "getlastsegidstakes", 0 },
{ "createrawtransaction", 0 },
{ "createrawtransaction", 1 },
{ "createrawtransaction", 2 },

View File

@@ -231,11 +231,12 @@ UniValue getinfo(const UniValue& params, bool fHelp, const CPubKey& mypk)
+ HelpExampleCli("getinfo", "")
+ HelpExampleRpc("getinfo", "")
);
//#ifdef ENABLE_WALLET
// LOCK2(cs_main, pwalletMain ? &pwalletMain->cs_wallet : NULL);
//#else
#ifdef ENABLE_WALLET
LOCK2(cs_main, pwalletMain ? &pwalletMain->cs_wallet : NULL);
#else
LOCK(cs_main);
//#endif
#endif
proxyType proxy;
GetProxy(NET_IPV4, proxy);
@@ -482,13 +483,13 @@ UniValue validateaddress(const UniValue& params, bool fHelp, const CPubKey& mypk
if (fHelp || params.size() != 1)
throw runtime_error(
"validateaddress \"addr\"\n"
"\nReturn information about the given Hush or Hush Smart Chain (HSC) address.\n"
"\nReturn information about the given Hush or Hush Arrakis Chain (HAC) address.\n"
"\nArguments:\n"
"1. \"addr\" (string, required) The address to validate\n"
"\nResult:\n"
"{\n"
" \"isvalid\" : true|false, (boolean) If the address is valid or not. If not, this is the only property returned.\n"
" \"address\" : \"addr\", (string) The Hush or HSC address validated\n"
" \"address\" : \"addr\", (string) The Hush or HAC address validated\n"
" \"scriptPubKey\" : \"hex\", (string) The hex encoded scriptPubKey generated by the address\n"
" \"ismine\" : true|false, (boolean) If the address is yours or not\n"
" \"isscript\" : true|false, (boolean) If the key is a script\n"

View File

@@ -31,6 +31,8 @@
#include <boost/foreach.hpp>
#include <univalue.h>
extern uint16_t ASSETCHAINS_P2PPORT,ASSETCHAINS_RPCPORT;
using namespace std;
using namespace hush;
@@ -276,8 +278,8 @@ UniValue addnode(const UniValue& params, bool fHelp, const CPubKey& mypk)
"1. \"node\" (string, required) The node (see getpeerinfo for nodes)\n"
"2. \"command\" (string, required) 'add' to add a node to the list, 'remove' to remove a node from the list, 'onetry' to try a connection to the node once\n"
"\nExamples:\n"
+ HelpExampleCli("addnode", "\"192.168.0.6:18030\" \"onetry\"")
+ HelpExampleRpc("addnode", "\"192.168.0.6:18030\", \"onetry\"")
+ HelpExampleCli("addnode", "\"192.168.0.6:" + to_string(ASSETCHAINS_P2PPORT) + "\" \"onetry\"")
+ HelpExampleRpc("addnode", "\"192.168.0.6:" + to_string(ASSETCHAINS_P2PPORT) + "\", \"onetry\"")
);
string strNode = params[0].get_str();
@@ -320,8 +322,8 @@ UniValue disconnectnode(const UniValue& params, bool fHelp, const CPubKey& mypk)
"\nArguments:\n"
"1. \"node\" (string, required) The node (see getpeerinfo for nodes)\n"
"\nExamples:\n"
+ HelpExampleCli("disconnectnode", "\"192.168.0.6:18030\"")
+ HelpExampleRpc("disconnectnode", "\"192.168.0.6:18030\"")
+ HelpExampleCli("disconnectnode", "\"192.168.0.6:" + to_string(ASSETCHAINS_P2PPORT) + "\"")
+ HelpExampleRpc("disconnectnode", "\"192.168.0.6:" + to_string(ASSETCHAINS_P2PPORT) + "\"")
);
CNode* pNode = FindNode(params[0].get_str());

Some files were not shown because too many files have changed in this diff Show More