forked from such-gitea/wownero
Compare commits
65 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aba46a7c5f | ||
|
|
514328a65f | ||
|
|
172966a0c3 | ||
|
|
815d93ba24 | ||
|
|
94abe2280e | ||
|
|
556ec3c144 | ||
|
|
ec42fd80a1 | ||
|
|
805781957a | ||
|
|
03e49575a4 | ||
|
|
4f262b2de9 | ||
|
|
5563c65f64 | ||
|
|
adbb7229af | ||
|
|
e49f7450d2 | ||
|
|
10593e20a5 | ||
|
|
517d5e6915 | ||
|
|
24bbd442a3 | ||
|
|
f15de92f90 | ||
|
|
2e9b9d92fc | ||
|
|
eb189153ca | ||
|
|
6755e0d7f3 | ||
|
|
d46fb70930 | ||
|
|
39e9fa05b8 | ||
|
|
9afbcfb777 | ||
|
|
e6c875a954 | ||
|
|
12085c4c74 | ||
|
|
2a5f743d0a | ||
|
|
2fb6c1f80d | ||
|
|
8ad9d0f618 | ||
|
|
ddafd99cac | ||
|
|
26276d5df7 | ||
|
|
de536f49cb | ||
|
|
3fdf63bc90 | ||
|
|
2f402f9a45 | ||
|
|
307bd8f5ae | ||
|
|
bc3aa2ea12 | ||
|
|
94390f8364 | ||
|
|
5249d14063 | ||
|
|
9713b3f058 | ||
|
|
6f2d52de9e | ||
|
|
949158eb00 | ||
|
|
c749be7f9d | ||
|
|
036cdfadad | ||
|
|
8670b67c9c | ||
|
|
98f2524ecc | ||
|
|
a0b181f4cd | ||
|
|
2ae11e8e4b | ||
|
|
ae9de01824 | ||
|
|
5227b3280c | ||
|
|
ed34ba0774 | ||
|
|
33634f6dfd | ||
|
|
62d746ffeb | ||
|
|
da0c68074e | ||
|
|
8b392ed111 | ||
|
|
7683daa61f | ||
|
|
105fc24be0 | ||
|
|
58aa5ac491 | ||
|
|
c3f0e58191 | ||
|
|
1b96834767 | ||
|
|
73746a016e | ||
|
|
781f7ea3e6 | ||
|
|
ee9419998b | ||
|
|
f3d415f7a0 | ||
|
|
904349a75c | ||
|
|
fdb1f180e4 | ||
|
|
c34c4d2e29 |
5
.dockerignore
Normal file
5
.dockerignore
Normal file
@@ -0,0 +1,5 @@
|
||||
!Dockerfile
|
||||
/build/*
|
||||
*.md
|
||||
.git/
|
||||
.gitignore
|
||||
12
.github/FUNDING.yml
vendored
Normal file
12
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
||||
patreon: # Replace with a single Patreon username
|
||||
open_collective: # Replace with a single Open Collective username
|
||||
ko_fi: # Replace with a single Ko-fi username
|
||||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||
liberapay: # Replace with a single Liberapay username
|
||||
issuehunt: # Replace with a single IssueHunt username
|
||||
otechie: # Replace with a single Otechie username
|
||||
custom: https://dev-funding.webui.wowkira.com
|
||||
1
.gitmodules
vendored
1
.gitmodules
vendored
@@ -15,3 +15,4 @@
|
||||
[submodule "external/randomwow"]
|
||||
path = external/randomwow
|
||||
url = https://github.com/wownero/RandomWOW
|
||||
branch = master
|
||||
|
||||
@@ -690,8 +690,11 @@ else()
|
||||
add_cxx_flag_if_supported(-fstack-clash-protection CXX_SECURITY_FLAGS)
|
||||
endif()
|
||||
|
||||
add_c_flag_if_supported(-mmitigate-rop C_SECURITY_FLAGS)
|
||||
add_cxx_flag_if_supported(-mmitigate-rop CXX_SECURITY_FLAGS)
|
||||
# Removed in GCC 9.1 (or before ?), but still accepted, so spams the output
|
||||
if (NOT (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 9.1))
|
||||
add_c_flag_if_supported(-mmitigate-rop C_SECURITY_FLAGS)
|
||||
add_cxx_flag_if_supported(-mmitigate-rop CXX_SECURITY_FLAGS)
|
||||
endif()
|
||||
|
||||
# linker
|
||||
if (NOT WIN32)
|
||||
|
||||
383
Dockerfile
383
Dockerfile
@@ -1,18 +1,32 @@
|
||||
# Multistage docker build, requires docker 17.05
|
||||
FROM debian:stable-slim
|
||||
|
||||
# builder stage
|
||||
FROM ubuntu:16.04 as builder
|
||||
WORKDIR /data
|
||||
|
||||
RUN set -ex && \
|
||||
apt-get update && \
|
||||
apt-get --no-install-recommends --yes install \
|
||||
RUN echo "\e[33mThis will take some time. Go and get a cup of coffee. We could be here all night.\e[39m"
|
||||
|
||||
#su-exec
|
||||
ARG SUEXEC_VERSION=v0.2
|
||||
ARG SUEXEC_HASH=f85e5bde1afef399021fbc2a99c837cf851ceafa
|
||||
#Cmake
|
||||
ARG CMAKE_VERSION=3.14.0
|
||||
ARG CMAKE_VERSION_DOT=v3.14
|
||||
ARG CMAKE_HASH=aa76ba67b3c2af1946701f847073f4652af5cbd9f141f221c97af99127e75502
|
||||
## Boost
|
||||
ARG BOOST_VERSION=1_69_0
|
||||
ARG BOOST_VERSION_DOT=1.69.0
|
||||
ARG BOOST_HASH=8f32d4617390d1c2d16f26a27ab60d97807b35440d45891fa340fc2648b04406
|
||||
|
||||
ENV CFLAGS '-fPIC -O2 -g'
|
||||
ENV CXXFLAGS '-fPIC -O2 -g'
|
||||
ENV LDFLAGS '-static-libstdc++'
|
||||
|
||||
ENV BASE_DIR /usr/local
|
||||
|
||||
RUN apt-get update -qq && apt-get --no-install-recommends -yqq install \
|
||||
ca-certificates \
|
||||
cmake \
|
||||
g++ \
|
||||
make \
|
||||
pkg-config \
|
||||
graphviz \
|
||||
doxygen \
|
||||
git \
|
||||
curl \
|
||||
libtool-bin \
|
||||
@@ -21,192 +35,249 @@ RUN set -ex && \
|
||||
bzip2 \
|
||||
xsltproc \
|
||||
gperf \
|
||||
unzip
|
||||
|
||||
WORKDIR /usr/local
|
||||
|
||||
ENV CFLAGS='-fPIC'
|
||||
ENV CXXFLAGS='-fPIC'
|
||||
|
||||
#Cmake
|
||||
ARG CMAKE_VERSION=3.14.0
|
||||
ARG CMAKE_VERSION_DOT=v3.14
|
||||
ARG CMAKE_HASH=aa76ba67b3c2af1946701f847073f4652af5cbd9f141f221c97af99127e75502
|
||||
RUN set -ex \
|
||||
&& curl -s -O https://cmake.org/files/${CMAKE_VERSION_DOT}/cmake-${CMAKE_VERSION}.tar.gz \
|
||||
unzip > /dev/null \
|
||||
g++-aarch64-linux-gnu \
|
||||
apt-utils \
|
||||
&& cd /data || exit 1 \
|
||||
&& echo "\e[32mbuilding: su-exec\e[39m" \
|
||||
&& git clone --branch ${SUEXEC_VERSION} --single-branch --depth 1 https://github.com/ncopa/su-exec.git su-exec.git > /dev/null \
|
||||
&& cd su-exec.git || exit 1 \
|
||||
&& test `git rev-parse HEAD` = ${SUEXEC_HASH} || exit 1 \
|
||||
&& make > /dev/null \
|
||||
&& cp su-exec /data \
|
||||
&& cd /data || exit 1 \
|
||||
&& rm -rf /data/su-exec.git \
|
||||
&& echo "\e[32mbuilding: Cmake\e[39m" \
|
||||
&& set -ex \
|
||||
&& curl -s -O https://cmake.org/files/${CMAKE_VERSION_DOT}/cmake-${CMAKE_VERSION}.tar.gz > /dev/null \
|
||||
&& echo "${CMAKE_HASH} cmake-${CMAKE_VERSION}.tar.gz" | sha256sum -c \
|
||||
&& tar -xzf cmake-${CMAKE_VERSION}.tar.gz \
|
||||
&& cd cmake-${CMAKE_VERSION} \
|
||||
&& ./configure \
|
||||
&& make \
|
||||
&& make install
|
||||
|
||||
## Boost
|
||||
ARG BOOST_VERSION=1_69_0
|
||||
ARG BOOST_VERSION_DOT=1.69.0
|
||||
ARG BOOST_HASH=8f32d4617390d1c2d16f26a27ab60d97807b35440d45891fa340fc2648b04406
|
||||
RUN set -ex \
|
||||
&& curl -s -L -o boost_${BOOST_VERSION}.tar.bz2 https://dl.bintray.com/boostorg/release/${BOOST_VERSION_DOT}/source/boost_${BOOST_VERSION}.tar.bz2 \
|
||||
&& tar -xzf cmake-${CMAKE_VERSION}.tar.gz > /dev/null \
|
||||
&& cd cmake-${CMAKE_VERSION} || exit 1 \
|
||||
&& ./configure --prefix=$BASE_DIR > /dev/null \
|
||||
&& make > /dev/null \
|
||||
&& make install > /dev/null \
|
||||
&& cd /data || exit 1 \
|
||||
&& rm -rf /data/cmake-${CMAKE_VERSION} \
|
||||
&& rm -rf /data/cmake-${CMAKE_VERSION}.tar.gz \
|
||||
&& echo "\e[32mbuilding: Boost\e[39m" \
|
||||
&& set -ex \
|
||||
&& curl -s -L -o boost_${BOOST_VERSION}.tar.bz2 https://dl.bintray.com/boostorg/release/${BOOST_VERSION_DOT}/source/boost_${BOOST_VERSION}.tar.bz2 > /dev/null \
|
||||
&& echo "${BOOST_HASH} boost_${BOOST_VERSION}.tar.bz2" | sha256sum -c \
|
||||
&& tar -xvf boost_${BOOST_VERSION}.tar.bz2 \
|
||||
&& cd boost_${BOOST_VERSION} \
|
||||
&& ./bootstrap.sh \
|
||||
&& ./b2 --build-type=minimal link=static runtime-link=static --with-chrono --with-date_time --with-filesystem --with-program_options --with-regex --with-serialization --with-system --with-thread --with-locale threading=multi threadapi=pthread cflags="$CFLAGS" cxxflags="$CXXFLAGS" stage
|
||||
ENV BOOST_ROOT /usr/local/boost_${BOOST_VERSION}
|
||||
&& tar -xvf boost_${BOOST_VERSION}.tar.bz2 > /dev/null \
|
||||
&& cd boost_${BOOST_VERSION} || exit 1 \
|
||||
&& ./bootstrap.sh > /dev/null \
|
||||
&& ./b2 -a install --prefix=$BASE_DIR --build-type=minimal link=static runtime-link=static --with-chrono --with-date_time --with-filesystem --with-program_options --with-regex --with-serialization --with-system --with-thread --with-locale threading=multi threadapi=pthread cflags="$CFLAGS" cxxflags="$CXXFLAGS" stage > /dev/null \
|
||||
&& cd /data || exit 1 \
|
||||
&& rm -rf /data/boost_${BOOST_VERSION} \
|
||||
&& rm -rf /data/boost_${BOOST_VERSION}.tar.bz2
|
||||
|
||||
RUN echo "\e[33mDid I ever tell you the story of when my cousin Nicolas boost a lambo in less than 60 seconds?\e[39m"
|
||||
|
||||
WORKDIR /data
|
||||
|
||||
ENV BASE_DIR /usr/local
|
||||
|
||||
# OpenSSL
|
||||
ARG OPENSSL_VERSION=1.1.1b
|
||||
ARG OPENSSL_HASH=5c557b023230413dfb0756f3137a13e6d726838ccd1430888ad15bfb2b43ea4b
|
||||
RUN set -ex \
|
||||
&& curl -s -O https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz \
|
||||
&& echo "${OPENSSL_HASH} openssl-${OPENSSL_VERSION}.tar.gz" | sha256sum -c \
|
||||
&& tar -xzf openssl-${OPENSSL_VERSION}.tar.gz \
|
||||
&& cd openssl-${OPENSSL_VERSION} \
|
||||
&& ./Configure linux-x86_64 no-shared --static "$CFLAGS" \
|
||||
&& make build_generated \
|
||||
&& make libcrypto.a \
|
||||
&& make install
|
||||
ENV OPENSSL_ROOT_DIR=/usr/local/openssl-${OPENSSL_VERSION}
|
||||
|
||||
# ZMQ
|
||||
ARG ZMQ_VERSION=v4.3.1
|
||||
ARG ZMQ_HASH=2cb1240db64ce1ea299e00474c646a2453a8435b
|
||||
RUN set -ex \
|
||||
&& git clone https://github.com/zeromq/libzmq.git -b ${ZMQ_VERSION} \
|
||||
&& cd libzmq \
|
||||
&& test `git rev-parse HEAD` = ${ZMQ_HASH} || exit 1 \
|
||||
&& ./autogen.sh \
|
||||
&& ./configure --enable-static --disable-shared \
|
||||
&& make \
|
||||
&& make install \
|
||||
&& ldconfig
|
||||
|
||||
# zmq.hpp
|
||||
ARG CPPZMQ_VERSION=v4.3.0
|
||||
ARG CPPZMQ_HASH=213da0b04ae3b4d846c9abc46bab87f86bfb9cf4
|
||||
RUN set -ex \
|
||||
&& git clone https://github.com/zeromq/cppzmq.git -b ${CPPZMQ_VERSION} \
|
||||
&& cd cppzmq \
|
||||
&& test `git rev-parse HEAD` = ${CPPZMQ_HASH} || exit 1 \
|
||||
&& mv *.hpp /usr/local/include
|
||||
|
||||
# Readline
|
||||
ARG READLINE_VERSION=8.0
|
||||
ARG READLINE_HASH=e339f51971478d369f8a053a330a190781acb9864cf4c541060f12078948e461
|
||||
RUN set -ex \
|
||||
&& curl -s -O https://ftp.gnu.org/gnu/readline/readline-${READLINE_VERSION}.tar.gz \
|
||||
&& echo "${READLINE_HASH} readline-${READLINE_VERSION}.tar.gz" | sha256sum -c \
|
||||
&& tar -xzf readline-${READLINE_VERSION}.tar.gz \
|
||||
&& cd readline-${READLINE_VERSION} \
|
||||
&& ./configure \
|
||||
&& make \
|
||||
&& make install
|
||||
|
||||
# Sodium
|
||||
ARG SODIUM_VERSION=1.0.17
|
||||
ARG SODIUM_HASH=b732443c442239c2e0184820e9b23cca0de0828c
|
||||
RUN set -ex \
|
||||
&& git clone https://github.com/jedisct1/libsodium.git -b ${SODIUM_VERSION} \
|
||||
&& cd libsodium \
|
||||
|
||||
ENV CFLAGS '-fPIC -O2 -g'
|
||||
ENV CXXFLAGS '-fPIC -O2 -g'
|
||||
ENV LDFLAGS '-static-libstdc++'
|
||||
|
||||
RUN echo "\e[32mbuilding: Openssl\e[39m" \
|
||||
&& set -ex \
|
||||
&& curl -s -O https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz > /dev/null \
|
||||
&& echo "${OPENSSL_HASH} openssl-${OPENSSL_VERSION}.tar.gz" | sha256sum -c \
|
||||
&& tar -xzf openssl-${OPENSSL_VERSION}.tar.gz > /dev/null \
|
||||
&& cd openssl-${OPENSSL_VERSION} || exit 1 \
|
||||
&& ./Configure --prefix=$BASE_DIR linux-x86_64 no-shared --static "$CFLAGS" > /dev/null \
|
||||
&& make build_generated > /dev/null \
|
||||
&& make libcrypto.a > /dev/null \
|
||||
&& make install > /dev/null \
|
||||
&& cd /data || exit 1 \
|
||||
&& rm -rf /data/openssl-${OPENSSL_VERSION} \
|
||||
&& rm -rf /data/openssl-${OPENSSL_VERSION}.tar.gz \
|
||||
&& echo "\e[32mbuilding: ZMQ\e[39m" \
|
||||
&& set -ex \
|
||||
&& git clone --branch ${ZMQ_VERSION} --single-branch --depth 1 https://github.com/zeromq/libzmq.git > /dev/null \
|
||||
&& cd libzmq || exit 1 \
|
||||
&& test `git rev-parse HEAD` = ${ZMQ_HASH} || exit 1 \
|
||||
&& ./autogen.sh > /dev/null \
|
||||
&& ./configure --prefix=$BASE_DIR --enable-libunwind=no --enable-static --disable-shared > /dev/null \
|
||||
&& make > /dev/null \
|
||||
&& make install > /dev/null \
|
||||
&& ldconfig > /dev/null \
|
||||
&& cd /data || exit 1 \
|
||||
&& rm -rf /data/libzmq \
|
||||
&& echo "\e[32mbuilding: zmq.hpp\e[39m" \
|
||||
&& set -ex \
|
||||
&& git clone --branch ${CPPZMQ_VERSION} --single-branch --depth 1 https://github.com/zeromq/cppzmq.git > /dev/null \
|
||||
&& cd cppzmq || exit 1 \
|
||||
&& test `git rev-parse HEAD` = ${CPPZMQ_HASH} || exit 1 \
|
||||
&& mv *.hpp $BASE_DIR/include \
|
||||
&& cd /data || exit 1 \
|
||||
&& rm -rf /data/cppzmq \
|
||||
&& echo "\e[32mbuilding: Readline\e[39m" \
|
||||
&& set -ex \
|
||||
&& curl -s -O https://ftp.gnu.org/gnu/readline/readline-${READLINE_VERSION}.tar.gz > /dev/null \
|
||||
&& echo "${READLINE_HASH} readline-${READLINE_VERSION}.tar.gz" | sha256sum -c \
|
||||
&& tar -xzf readline-${READLINE_VERSION}.tar.gz > /dev/null \
|
||||
&& cd readline-${READLINE_VERSION} || exit 1 \
|
||||
&& ./configure --prefix=$BASE_DIR > /dev/null \
|
||||
&& make > /dev/null \
|
||||
&& make install > /dev/null \
|
||||
&& cd /data || exit 1 \
|
||||
&& rm -rf /data/readline-${READLINE_VERSION} \
|
||||
&& rm -rf readline-${READLINE_VERSION}.tar.gz \
|
||||
&& echo "\e[32mbuilding: Sodium\e[39m" \
|
||||
&& set -ex \
|
||||
&& git clone --branch ${SODIUM_VERSION} --single-branch --depth 1 https://github.com/jedisct1/libsodium.git > /dev/null \
|
||||
&& cd libsodium || exit 1 \
|
||||
&& test `git rev-parse HEAD` = ${SODIUM_HASH} || exit 1 \
|
||||
&& ./autogen.sh \
|
||||
&& ./configure \
|
||||
&& make \
|
||||
&& make check \
|
||||
&& make install
|
||||
&& ./configure --prefix=$BASE_DIR > /dev/null \
|
||||
&& make > /dev/null \
|
||||
&& make check > /dev/null \
|
||||
&& make install > /dev/null \
|
||||
&& cd /data || exit 1 \
|
||||
&& rm -rf /data/libsodium
|
||||
|
||||
RUN echo "\e[33mOoh wee, that was close. I thought I broke something.\e[39m"
|
||||
|
||||
WORKDIR /data
|
||||
|
||||
ENV BASE_DIR /usr/local
|
||||
|
||||
# Udev
|
||||
ARG UDEV_VERSION=v3.2.7
|
||||
ARG UDEV_HASH=4758e346a14126fc3a964de5831e411c27ebe487
|
||||
RUN set -ex \
|
||||
&& git clone https://github.com/gentoo/eudev -b ${UDEV_VERSION} \
|
||||
&& cd eudev \
|
||||
&& test `git rev-parse HEAD` = ${UDEV_HASH} || exit 1 \
|
||||
&& ./autogen.sh \
|
||||
&& ./configure --disable-gudev --disable-introspection --disable-hwdb --disable-manpages --disable-shared \
|
||||
&& make \
|
||||
&& make install
|
||||
|
||||
# Libusb
|
||||
ARG USB_VERSION=v1.0.22
|
||||
ARG USB_HASH=0034b2afdcdb1614e78edaa2a9e22d5936aeae5d
|
||||
RUN set -ex \
|
||||
&& git clone https://github.com/libusb/libusb.git -b ${USB_VERSION} \
|
||||
&& cd libusb \
|
||||
&& test `git rev-parse HEAD` = ${USB_HASH} || exit 1 \
|
||||
&& ./autogen.sh \
|
||||
&& ./configure --disable-shared \
|
||||
&& make \
|
||||
&& make install
|
||||
|
||||
# Hidapi
|
||||
ARG HIDAPI_VERSION=hidapi-0.8.0-rc1
|
||||
ARG HIDAPI_HASH=40cf516139b5b61e30d9403a48db23d8f915f52c
|
||||
RUN set -ex \
|
||||
&& git clone https://github.com/signal11/hidapi -b ${HIDAPI_VERSION} \
|
||||
&& cd hidapi \
|
||||
&& test `git rev-parse HEAD` = ${HIDAPI_HASH} || exit 1 \
|
||||
&& ./bootstrap \
|
||||
&& ./configure --enable-static --disable-shared \
|
||||
&& make \
|
||||
&& make install
|
||||
|
||||
# Protobuf
|
||||
ARG PROTOBUF_VERSION=v3.7.0
|
||||
ARG PROTOBUF_HASH=582743bf40c5d3639a70f98f183914a2c0cd0680
|
||||
RUN set -ex \
|
||||
&& git clone https://github.com/protocolbuffers/protobuf -b ${PROTOBUF_VERSION} \
|
||||
&& cd protobuf \
|
||||
&& test `git rev-parse HEAD` = ${PROTOBUF_HASH} || exit 1 \
|
||||
&& git submodule update --init --recursive \
|
||||
|
||||
ENV CFLAGS '-fPIC -O2 -g'
|
||||
ENV CXXFLAGS '-fPIC -O2 -g'
|
||||
ENV LDFLAGS '-static-libstdc++'
|
||||
|
||||
RUN echo "\e[32mbuilding: Udev\e[39m" \
|
||||
&& set -ex \
|
||||
&& git clone --branch ${UDEV_VERSION} --single-branch --depth 1 https://github.com/gentoo/eudev > /dev/null \
|
||||
&& cd eudev || exit 1 \
|
||||
&& test `git rev-parse HEAD` = ${UDEV_HASH} || exit 1 \
|
||||
&& ./autogen.sh \
|
||||
&& ./configure --enable-static --disable-shared \
|
||||
&& make \
|
||||
&& make install \
|
||||
&& ldconfig
|
||||
&& ./configure --prefix=$BASE_DIR --disable-gudev --disable-introspection --disable-hwdb --disable-manpages --disable-shared > /dev/null \
|
||||
&& make > /dev/null \
|
||||
&& make install > /dev/null \
|
||||
&& cd /data || exit 1 \
|
||||
&& rm -rf /data/eudev \
|
||||
&& echo "\e[32mbuilding: Libusb\e[39m" \
|
||||
&& set -ex \
|
||||
&& git clone --branch ${USB_VERSION} --single-branch --depth 1 https://github.com/libusb/libusb.git > /dev/null \
|
||||
&& cd libusb || exit 1 \
|
||||
&& test `git rev-parse HEAD` = ${USB_HASH} || exit 1 \
|
||||
&& ./autogen.sh > /dev/null \
|
||||
&& ./configure --prefix=$BASE_DIR --disable-shared > /dev/null \
|
||||
&& make > /dev/null \
|
||||
&& make install > /dev/null \
|
||||
&& cd /data || exit 1 \
|
||||
&& rm -rf /data/libusb \
|
||||
&& echo "\e[32mbuilding: Hidapi\e[39m" \
|
||||
&& set -ex \
|
||||
&& git clone --branch ${HIDAPI_VERSION} --single-branch --depth 1 https://github.com/signal11/hidapi > /dev/null \
|
||||
&& cd hidapi || exit 1 \
|
||||
&& test `git rev-parse HEAD` = ${HIDAPI_HASH} || exit 1 \
|
||||
&& ./bootstrap \
|
||||
&& ./configure --prefix=$BASE_DIR --enable-static --disable-shared > /dev/null \
|
||||
&& make > /dev/null \
|
||||
&& make install > /dev/null \
|
||||
&& cd /data || exit 1 \
|
||||
&& rm -rf /data/hidapi \
|
||||
&& echo "\e[32mbuilding: Protobuf\e[39m" \
|
||||
&& set -ex \
|
||||
&& git clone --branch ${PROTOBUF_VERSION} --single-branch --depth 1 https://github.com/protocolbuffers/protobuf > /dev/null \
|
||||
&& cd protobuf || exit 1 \
|
||||
&& test `git rev-parse HEAD` = ${PROTOBUF_HASH} || exit 1 \
|
||||
&& git submodule update --init --recursive > /dev/null \
|
||||
&& ./autogen.sh > /dev/null \
|
||||
&& ./configure --prefix=$BASE_DIR --enable-static --disable-shared > /dev/null \
|
||||
&& make > /dev/null \
|
||||
&& make install > /dev/null \
|
||||
&& ldconfig \
|
||||
&& cd /data || exit 1 \
|
||||
&& rm -rf /data/protobuf
|
||||
|
||||
WORKDIR /src
|
||||
COPY . .
|
||||
WORKDIR /data
|
||||
# BUILD_PATH:
|
||||
# Using 'USE_SINGLE_BUILDDIR=1 make' creates a unified build dir (/wownero.git/build/release/bin)
|
||||
|
||||
ENV USE_SINGLE_BUILDDIR=1
|
||||
ARG NPROC
|
||||
RUN set -ex && \
|
||||
git submodule init && git submodule update && \
|
||||
rm -rf build && \
|
||||
if [ -z "$NPROC" ] ; \
|
||||
then make -j$(nproc) release-static ; \
|
||||
else make -j$NPROC release-static ; \
|
||||
fi
|
||||
ARG PROJECT_URL=https://github.com/wownero/wownero.git
|
||||
ARG BRANCH=master
|
||||
ARG BUILD_PATH=/wownero.git/build/release/bin
|
||||
|
||||
# runtime stage
|
||||
FROM ubuntu:16.04
|
||||
ENV CFLAGS '-fPIC -O1'
|
||||
ENV CXXFLAGS '-fPIC -O1'
|
||||
ENV LDFLAGS '-static-libstdc++'
|
||||
|
||||
RUN set -ex && \
|
||||
apt-get update && \
|
||||
apt-get --no-install-recommends --yes install ca-certificates && \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt
|
||||
COPY --from=builder /src/build/release/bin /usr/local/bin/
|
||||
RUN echo "\e[33mNow we're getting somewhere.\e[39m"
|
||||
|
||||
# Create monero user
|
||||
RUN adduser --system --group --disabled-password monero && \
|
||||
mkdir -p /wallet /home/monero/.bitmonero && \
|
||||
chown -R monero:monero /home/monero/.bitmonero && \
|
||||
chown -R monero:monero /wallet
|
||||
RUN echo "\e[32mcloning: $PROJECT_URL on branch: $BRANCH\e[39m" \
|
||||
&& git clone --branch "$BRANCH" --single-branch --recursive $PROJECT_URL wownero.git > /dev/null \
|
||||
&& cd wownero.git || exit 1 \
|
||||
&& echo "\e[32mbuilding static binaries\e[39m" \
|
||||
&& apt-get update -qq && apt-get install -yqq --no-install-recommends \
|
||||
libreadline-dev \
|
||||
&& USE_SINGLE_BUILDDIR=1 make release-static > /dev/null \
|
||||
&& echo "\e[32mcopy and clean up\e[39m" \
|
||||
&& mv /data$BUILD_PATH/wownerod /data/ \
|
||||
&& chmod +x /data/wownerod \
|
||||
&& mv /data$BUILD_PATH/wownero-wallet-rpc /data/ \
|
||||
&& chmod +x /data/wownero-wallet-rpc \
|
||||
&& mv /data$BUILD_PATH/wownero-wallet-cli /data/ \
|
||||
&& chmod +x /data/wownero-wallet-cli \
|
||||
&& cp /data/wownerod /usr/local/bin/wownerod \
|
||||
&& cp /data/wownero-wallet-rpc /usr/local/bin/wownero-wallet-rpc \
|
||||
&& cp /data/wownero-wallet-cli /usr/local/bin/wownero-wallet-cli \
|
||||
&& cp /data/su-exec /usr/local/bin/su-exec \
|
||||
&& rm /data/su-exec \
|
||||
&& cd /data || exit 1 \
|
||||
&& apt-get autoremove --purge -yqq > /dev/null \
|
||||
&& apt-get clean > /dev/null \
|
||||
&& rm -rf /var/tmp/* /tmp/* /var/lib/apt/* > /dev/null
|
||||
|
||||
# Contains the blockchain
|
||||
VOLUME /home/monero/.bitmonero
|
||||
VOLUME ["/data"]
|
||||
|
||||
# Generate your wallet via accessing the container and run:
|
||||
# cd /wallet
|
||||
# monero-wallet-cli
|
||||
VOLUME /wallet
|
||||
|
||||
EXPOSE 18080
|
||||
EXPOSE 18081
|
||||
|
||||
# switch to user monero
|
||||
USER monero
|
||||
|
||||
ENTRYPOINT ["monerod", "--p2p-bind-ip=0.0.0.0", "--p2p-bind-port=18080", "--rpc-bind-ip=0.0.0.0", "--rpc-bind-port=18081", "--non-interactive", "--confirm-external-bind"]
|
||||
ENV USER_ID 1000
|
||||
ENV LOG_LEVEL 0
|
||||
ENV DAEMON_HOST 127.0.0.1
|
||||
ENV DAEMON_PORT 34568
|
||||
ENV RPC_USER ""
|
||||
ENV RPC_PASSWD ""
|
||||
ENV RPC_LOGIN ""
|
||||
ENV WALLET_PASSWD ""
|
||||
ENV WALLET_ACCESS ""
|
||||
ENV RPC_BIND_IP 0.0.0.0
|
||||
ENV RPC_BIND_PORT 34568
|
||||
ENV P2P_BIND_IP 0.0.0.0
|
||||
ENV P2P_BIND_PORT 34567
|
||||
|
||||
RUN wownerod --version
|
||||
RUN echo "\e[33mAll done.\e[39m"
|
||||
|
||||
10
PKGBUILD
10
PKGBUILD
@@ -3,13 +3,13 @@
|
||||
|
||||
pkgbase=('wownero-git')
|
||||
pkgname=('wownero-git')
|
||||
pkgver=0.5.0.2
|
||||
pkgver=v0.6.1.1.r2.9afbcfb7
|
||||
pkgrel=1
|
||||
pkgdesc="a fairly launched privacy-centric meme coin with no premine and a finite supply"
|
||||
license=('custom:Cryptonote')
|
||||
arch=('x86_64')
|
||||
url="http://wownero.org/"
|
||||
depends=('boost-libs' 'zeromq' 'unbound' 'libusb')
|
||||
depends=('openssl' 'zeromq' 'libpgm' 'unbound' 'libsodium')
|
||||
makedepends=('git' 'cmake' 'boost')
|
||||
provides=('wownero-git')
|
||||
|
||||
@@ -18,14 +18,12 @@ source=("${pkgname}"::"git+https://github.com/wownero/wownero")
|
||||
sha256sums=('SKIP')
|
||||
|
||||
pkgver() {
|
||||
cd "${srcdir}/${pkgname}"
|
||||
printf "$(echo ${pkgver} | sed 's/\.r.*//').r%s.g%s" \
|
||||
"$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
|
||||
cd "$srcdir/$pkgname"
|
||||
git describe --long --tags | sed 's/\([^-]*-\)g/r\1/;s/-/./g'
|
||||
}
|
||||
|
||||
build() {
|
||||
cd "${srcdir}/${pkgname}"
|
||||
git fetch --tags && git checkout tags/v0.5.0.2 -b v0.5.0.2
|
||||
USE_SINGLE_BUILDDIR=1 make
|
||||
}
|
||||
|
||||
|
||||
33
README.md
33
README.md
@@ -21,9 +21,14 @@ Blockchain Explorers
|
||||
- https://explore.wownero.com
|
||||
- https://explorer.wowkira.com
|
||||
- http://explorer.wowne.ro
|
||||
- http://wow4edxxxudchgj7.onion
|
||||
- http://dr4koizzq4ixyxqkz7qagx7bopt4gnrbtrp7cbqcji2fkp4mnve3wrqd.onion
|
||||
- http://wow5eqtzqvsg5jctqzg5g7uk3u62sfqiacj5x6lo4by7bvnj6jkvubyd.onion
|
||||
|
||||
Public Nodes
|
||||
- node.wowne.ro:34568
|
||||
- wowkira.com:34568
|
||||
- wow.aluisyo.network:34568
|
||||
|
||||
## Introduction
|
||||
|
||||
Wownero is a privacy-centric memecoin that was fairly launched on April 1, 2018 with no pre-mine, stealth-mine or ICO. Wownero has a maximum supply of around 184 million WOW with a slow and steady emission over 50 years. It is a fork of Monero, but with its own genesis block, so there is no degradation of privacy due to ring signatures using different participants for the same tx outputs on opposing forks.
|
||||
@@ -40,7 +45,7 @@ Dates are provided in the format YYYY-MM-DD.
|
||||
| 53666 | 2018-10-06 | Cool Cage | v0.3.0.0 | v0.3.1.3 | Cryptonight variant 2, LWMA v2, ringsize = 22, MMS
|
||||
| 63469 | 2018-11-11 | Dank Doge | v0.4.0.0 | v0.4.0.0 | LWMA v4
|
||||
| 81769 | 2019-02-19 | Erotic EggplantEmoji | v0.5.0.0 | v0.5.0.2 | Cryptonight/wow, LWMA v1 with N=144, Updated Bulletproofs, Fee Per Byte, Auto-churn
|
||||
| 114969 | 2019-06-14 | F For Fappening | v0.6.0.0 | v0.6.0.0 | RandomWOW, new block weight algorithm, slightly more efficient RingCT format
|
||||
| 114969 | 2019-06-14 | F For Fappening | v0.6.1.0 | v0.6.1.2 | RandomWOW, new block weight algorithm, slightly more efficient RingCT format
|
||||
|
||||
X's indicate that these details have not been determined as of commit date.
|
||||
|
||||
@@ -123,13 +128,29 @@ Once node is synced to network, run the CLI wallet by entering:
|
||||
|
||||
Type `help` in CLI wallet to see standard commands (for advanced options, type `help_advanced`).
|
||||
|
||||
## Tor Anonymity Network
|
||||
|
||||
* Install [Tor Browser](https://www.torproject.org/download/)
|
||||
* Open `torrc` file in a text editor ([installation directory]/Browser/TorBrowser/Data/Tor/torrc) and add hidden service information as follows:
|
||||
|
||||
```
|
||||
HiddenServiceDir [installation directory]/Browser/TorBrowser/Data/Tor/wow_node
|
||||
HiddenServiceVersion 3
|
||||
HiddenServicePort 44469 127.0.0.1:44469
|
||||
```
|
||||
* Save `torrc` file and restart Tor Browser (keep open)
|
||||
* Change directory to the `wow_node` folder, open `hostname` file, and copy your node's ".onion" address
|
||||
* Start wownerod with the following parameters:
|
||||
|
||||
```
|
||||
./wownerod --proxy tor,127.0.0.1:9150,25 --anonymous-inbound YOUR_NODE_ADDRESS.onion,127.0.0.1:44469,25 --add-peer wo5dkrgua62whkitjqmj6wzlp3hnth2w3lau2oj675rmaeexzy2q6cid.onion:44469
|
||||
```
|
||||
For more information, check out [ANONYMITY_NETWORKS](https://github.com/wownero/wownero/blob/master/ANONYMITY_NETWORKS.md).
|
||||
|
||||
## Wownero Graphical Wallets
|
||||
|
||||
* [Wownero-Light-Wallet](https://github.com/wownero/Wownero-Light-Wallet)
|
||||
|
||||

|
||||
|
||||
|
||||
* [Wownerujo Android Wallet](https://github.com/wownero/wownerujo)
|
||||
|
||||

|
||||
@@ -137,7 +158,7 @@ Type `help` in CLI wallet to see standard commands (for advanced options, type `
|
||||
|
||||
## Donating to Wownero Project
|
||||
|
||||
Developers are volunteers doing this mostly for shits and giggles. If you would like to support our shenanigans and stimulant addictions, please consider donating to [WFS proposals](https://funding.wownero.com/proposals) or the [dev slush fund](https://funding.wownero.com/donate).
|
||||
Developers are volunteers doing this mostly for shits and giggles. If you would like to support our shenanigans and stimulant addictions, please consider donating to [WFS proposals](https://funding.wownero.com/proposals) or the [dev slush fund](https://dev-funding.webui.wowkira.com).
|
||||
|
||||
Donations may also be sent to:
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
# Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers
|
||||
|
||||
# Check what commit we're on
|
||||
execute_process(COMMAND "${GIT}" rev-parse --short HEAD RESULT_VARIABLE RET OUTPUT_VARIABLE COMMIT OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
execute_process(COMMAND "${GIT}" rev-parse --short=9 HEAD RESULT_VARIABLE RET OUTPUT_VARIABLE COMMIT OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
if(RET)
|
||||
# Something went wrong, set the version tag to -unknown
|
||||
@@ -38,6 +38,7 @@ if(RET)
|
||||
set(VERSIONTAG "unknown")
|
||||
configure_file("src/version.cpp.in" "${TO}")
|
||||
else()
|
||||
string(SUBSTRING ${COMMIT} 0 9 COMMIT)
|
||||
message(STATUS "You are currently on commit ${COMMIT}")
|
||||
|
||||
# Get all the tags
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package=openssl
|
||||
$(package)_version=1.0.2q
|
||||
$(package)_version=1.0.2r
|
||||
$(package)_download_path=https://www.openssl.org/source
|
||||
$(package)_file_name=$(package)-$($(package)_version).tar.gz
|
||||
$(package)_sha256_hash=5744cfcbcec2b1b48629f7354203bc1e5e9b5466998bbccc5b5fcde3b18eb684
|
||||
$(package)_sha256_hash=ae51d08bba8a83958e894946f15303ff894d75c2b8bbd44a852b64e3fe11d0d6
|
||||
|
||||
define $(package)_set_vars
|
||||
$(package)_config_env=AR="$($(package)_ar)" RANLIB="$($(package)_ranlib)" CC="$($(package)_cc)"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
packages:=boost openssl zeromq cppzmq expat ldns cppzmq readline libiconv hidapi protobuf libusb
|
||||
packages:=boost openssl zeromq cppzmq expat ldns readline libiconv hidapi protobuf libusb
|
||||
native_packages := native_ccache native_protobuf
|
||||
|
||||
darwin_native_packages = native_biplist native_ds_store native_mac_alias
|
||||
|
||||
@@ -8,6 +8,7 @@ OPTION(BUILD_TESTS "Build tests." OFF)
|
||||
|
||||
SET(STATIC ON)
|
||||
SET(UNBOUND_STATIC ON)
|
||||
SET(ARCH "default")
|
||||
|
||||
SET(BUILD_TESTS @build_tests@)
|
||||
SET(TREZOR_DEBUG @build_tests@)
|
||||
|
||||
@@ -54,6 +54,9 @@
|
||||
#undef MONERO_DEFAULT_LOG_CATEGORY
|
||||
#define MONERO_DEFAULT_LOG_CATEGORY "net"
|
||||
|
||||
#define AGGRESSIVE_TIMEOUT_THRESHOLD 120 // sockets
|
||||
#define NEW_CONNECTION_TIMEOUT_LOCAL 1200000 // 2 minutes
|
||||
#define NEW_CONNECTION_TIMEOUT_REMOTE 10000 // 10 seconds
|
||||
#define DEFAULT_TIMEOUT_MS_LOCAL 1800000 // 30 minutes
|
||||
#define DEFAULT_TIMEOUT_MS_REMOTE 300000 // 5 minutes
|
||||
#define TIMEOUT_EXTRA_MS_PER_BYTE 0.2
|
||||
@@ -189,7 +192,7 @@ PRAGMA_WARNING_DISABLE_VS(4355)
|
||||
|
||||
m_protocol_handler.after_init_connection();
|
||||
|
||||
reset_timer(get_default_timeout(), false);
|
||||
reset_timer(boost::posix_time::milliseconds(m_local ? NEW_CONNECTION_TIMEOUT_LOCAL : NEW_CONNECTION_TIMEOUT_REMOTE), false);
|
||||
|
||||
// first read on the raw socket to detect SSL for the server
|
||||
buffer_ssl_init_fill = 0;
|
||||
@@ -691,7 +694,7 @@ PRAGMA_WARNING_DISABLE_VS(4355)
|
||||
{
|
||||
unsigned count;
|
||||
try { count = host_count(m_host); } catch (...) { count = 0; }
|
||||
const unsigned shift = std::min(std::max(count, 1u) - 1, 8u);
|
||||
const unsigned shift = get_state().sock_count > AGGRESSIVE_TIMEOUT_THRESHOLD ? std::min(std::max(count, 1u) - 1, 8u) : 0;
|
||||
boost::posix_time::milliseconds timeout(0);
|
||||
if (m_local)
|
||||
timeout = boost::posix_time::milliseconds(DEFAULT_TIMEOUT_MS_LOCAL >> shift);
|
||||
@@ -730,8 +733,6 @@ PRAGMA_WARNING_DISABLE_VS(4355)
|
||||
template<class t_protocol_handler>
|
||||
void connection<t_protocol_handler>::reset_timer(boost::posix_time::milliseconds ms, bool add)
|
||||
{
|
||||
if (m_connection_type != e_connection_type_RPC)
|
||||
return;
|
||||
MTRACE("Setting " << ms << " expiry");
|
||||
auto self = safe_shared_from_this();
|
||||
if(!self)
|
||||
|
||||
@@ -99,6 +99,8 @@ public:
|
||||
template<class callback_t>
|
||||
bool for_connection(const boost::uuids::uuid &connection_id, const callback_t &cb);
|
||||
size_t get_connections_count();
|
||||
size_t get_out_connections_count();
|
||||
size_t get_in_connections_count();
|
||||
void set_handler(levin_commands_handler<t_connection_context>* handler, void (*destroy)(levin_commands_handler<t_connection_context>*) = NULL);
|
||||
|
||||
async_protocol_handler_config():m_pcommands_handler(NULL), m_pcommands_handler_destroy(NULL), m_max_packet_size(LEVIN_DEFAULT_MAX_PACKET_SIZE), m_invoke_timeout(LEVIN_DEFAULT_TIMEOUT_PRECONFIGURED)
|
||||
@@ -882,6 +884,28 @@ size_t async_protocol_handler_config<t_connection_context>::get_connections_coun
|
||||
}
|
||||
//------------------------------------------------------------------------------------------
|
||||
template<class t_connection_context>
|
||||
size_t async_protocol_handler_config<t_connection_context>::get_out_connections_count()
|
||||
{
|
||||
CRITICAL_REGION_LOCAL(m_connects_lock);
|
||||
size_t count = 0;
|
||||
for (const auto &c: m_connects)
|
||||
if (!c.second->m_connection_context.m_is_income)
|
||||
++count;
|
||||
return count;
|
||||
}
|
||||
//------------------------------------------------------------------------------------------
|
||||
template<class t_connection_context>
|
||||
size_t async_protocol_handler_config<t_connection_context>::get_in_connections_count()
|
||||
{
|
||||
CRITICAL_REGION_LOCAL(m_connects_lock);
|
||||
size_t count = 0;
|
||||
for (const auto &c: m_connects)
|
||||
if (c.second->m_connection_context.m_is_income)
|
||||
++count;
|
||||
return count;
|
||||
}
|
||||
//------------------------------------------------------------------------------------------
|
||||
template<class t_connection_context>
|
||||
void async_protocol_handler_config<t_connection_context>::set_handler(levin_commands_handler<t_connection_context>* handler, void (*destroy)(levin_commands_handler<t_connection_context>*))
|
||||
{
|
||||
if (m_pcommands_handler && m_pcommands_handler_destroy)
|
||||
|
||||
@@ -193,7 +193,6 @@ namespace net_utils
|
||||
return CONNECT_FAILURE;
|
||||
}
|
||||
}
|
||||
m_ssl_options.support = ssl_support_t::e_ssl_support_enabled;
|
||||
}
|
||||
return CONNECT_SUCCESS;
|
||||
}else
|
||||
@@ -223,7 +222,6 @@ namespace net_utils
|
||||
return false;
|
||||
if (m_ssl_options.support == epee::net_utils::ssl_support_t::e_ssl_support_autodetect)
|
||||
{
|
||||
m_ssl_options.support = epee::net_utils::ssl_support_t::e_ssl_support_enabled;
|
||||
if (try_connect_result == CONNECT_NO_SSL)
|
||||
{
|
||||
MERROR("SSL handshake failed on an autodetect connection, reconnecting without SSL");
|
||||
@@ -396,7 +394,7 @@ namespace net_utils
|
||||
if (!m_connected || !m_ssl_socket->next_layer().is_open())
|
||||
return false;
|
||||
if (ssl)
|
||||
*ssl = m_ssl_options.support == ssl_support_t::e_ssl_support_enabled;
|
||||
*ssl = m_ssl_options.support != ssl_support_t::e_ssl_support_disabled;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -651,7 +649,7 @@ namespace net_utils
|
||||
bool write(const void* data, size_t sz, boost::system::error_code& ec)
|
||||
{
|
||||
bool success;
|
||||
if(m_ssl_options.support == ssl_support_t::e_ssl_support_enabled)
|
||||
if(m_ssl_options.support != ssl_support_t::e_ssl_support_disabled)
|
||||
success = boost::asio::write(*m_ssl_socket, boost::asio::buffer(data, sz), ec);
|
||||
else
|
||||
success = boost::asio::write(m_ssl_socket->next_layer(), boost::asio::buffer(data, sz), ec);
|
||||
@@ -660,7 +658,7 @@ namespace net_utils
|
||||
|
||||
void async_write(const void* data, size_t sz, boost::system::error_code& ec)
|
||||
{
|
||||
if(m_ssl_options.support == ssl_support_t::e_ssl_support_enabled)
|
||||
if(m_ssl_options.support != ssl_support_t::e_ssl_support_disabled)
|
||||
boost::asio::async_write(*m_ssl_socket, boost::asio::buffer(data, sz), boost::lambda::var(ec) = boost::lambda::_1);
|
||||
else
|
||||
boost::asio::async_write(m_ssl_socket->next_layer(), boost::asio::buffer(data, sz), boost::lambda::var(ec) = boost::lambda::_1);
|
||||
@@ -668,7 +666,7 @@ namespace net_utils
|
||||
|
||||
void async_read(char* buff, size_t sz, boost::asio::detail::transfer_at_least_t transfer_at_least, handler_obj& hndlr)
|
||||
{
|
||||
if(m_ssl_options.support != ssl_support_t::e_ssl_support_enabled)
|
||||
if(m_ssl_options.support == ssl_support_t::e_ssl_support_disabled)
|
||||
boost::asio::async_read(m_ssl_socket->next_layer(), boost::asio::buffer(buff, sz), transfer_at_least, hndlr);
|
||||
else
|
||||
boost::asio::async_read(*m_ssl_socket, boost::asio::buffer(buff, sz), transfer_at_least, hndlr);
|
||||
|
||||
@@ -294,6 +294,11 @@ namespace net_utils
|
||||
m_max_speed_up(0)
|
||||
{}
|
||||
|
||||
connection_context_base(const connection_context_base& a): connection_context_base()
|
||||
{
|
||||
set_details(a.m_connection_id, a.m_remote_address, a.m_is_income, a.m_ssl);
|
||||
}
|
||||
|
||||
connection_context_base& operator=(const connection_context_base& a)
|
||||
{
|
||||
set_details(a.m_connection_id, a.m_remote_address, a.m_is_income, a.m_ssl);
|
||||
|
||||
@@ -136,6 +136,7 @@ namespace epee
|
||||
//for pod types
|
||||
array_entry_t<type_name> sa;
|
||||
size_t size = read_varint();
|
||||
CHECK_AND_ASSERT_THROW_MES(size <= m_count, "Size sanity check failed");
|
||||
sa.reserve(size);
|
||||
//TODO: add some optimization here later
|
||||
while(size--)
|
||||
|
||||
@@ -64,7 +64,8 @@ void buffer::append(const void *data, size_t sz)
|
||||
size_t reserve = (((size() + sz) * 3 / 2) + 4095) & ~4095;
|
||||
new_storage.reserve(reserve);
|
||||
new_storage.resize(size());
|
||||
memcpy(new_storage.data(), storage.data() + offset, storage.size() - offset);
|
||||
if (size() > 0)
|
||||
memcpy(new_storage.data(), storage.data() + offset, storage.size() - offset);
|
||||
offset = 0;
|
||||
std::swap(storage, new_storage);
|
||||
}
|
||||
|
||||
@@ -62,13 +62,15 @@ wipeable_string::wipeable_string(wipeable_string &&other)
|
||||
wipeable_string::wipeable_string(const std::string &other)
|
||||
{
|
||||
grow(other.size());
|
||||
memcpy(buffer.data(), other.c_str(), size());
|
||||
if (size() > 0)
|
||||
memcpy(buffer.data(), other.c_str(), size());
|
||||
}
|
||||
|
||||
wipeable_string::wipeable_string(std::string &&other)
|
||||
{
|
||||
grow(other.size());
|
||||
memcpy(buffer.data(), other.c_str(), size());
|
||||
if (size() > 0)
|
||||
memcpy(buffer.data(), other.c_str(), size());
|
||||
if (!other.empty())
|
||||
{
|
||||
memwipe(&other[0], other.size()); // we're kinda left with this again aren't we
|
||||
@@ -79,7 +81,8 @@ wipeable_string::wipeable_string(std::string &&other)
|
||||
wipeable_string::wipeable_string(const char *s)
|
||||
{
|
||||
grow(strlen(s));
|
||||
memcpy(buffer.data(), s, size());
|
||||
if (size() > 0)
|
||||
memcpy(buffer.data(), s, size());
|
||||
}
|
||||
|
||||
wipeable_string::wipeable_string(const char *s, size_t len)
|
||||
@@ -112,14 +115,18 @@ void wipeable_string::grow(size_t sz, size_t reserved)
|
||||
}
|
||||
size_t old_sz = buffer.size();
|
||||
std::unique_ptr<char[]> tmp{new char[old_sz]};
|
||||
memcpy(tmp.get(), buffer.data(), old_sz * sizeof(char));
|
||||
if (old_sz > 0)
|
||||
{
|
||||
memcpy(tmp.get(), buffer.data(), old_sz * sizeof(char));
|
||||
memwipe(buffer.data(), old_sz * sizeof(char));
|
||||
}
|
||||
buffer.reserve(reserved);
|
||||
buffer.resize(sz);
|
||||
memcpy(buffer.data(), tmp.get(), old_sz * sizeof(char));
|
||||
if (old_sz > 0)
|
||||
{
|
||||
memcpy(buffer.data(), tmp.get(), old_sz * sizeof(char));
|
||||
memwipe(tmp.get(), old_sz * sizeof(char));
|
||||
}
|
||||
}
|
||||
|
||||
void wipeable_string::push_back(char c)
|
||||
|
||||
@@ -129,6 +129,7 @@ script: |
|
||||
chmod +x ${WRAP_DIR}/${prog}
|
||||
done
|
||||
|
||||
git config --global core.abbrev 9
|
||||
cd monero
|
||||
BASEPREFIX=`pwd`/contrib/depends
|
||||
# Build dependencies for each host
|
||||
@@ -153,7 +154,7 @@ script: |
|
||||
export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGPATH}
|
||||
mkdir build && cd build
|
||||
cmake .. -DCMAKE_TOOLCHAIN_FILE=${BASEPREFIX}/${i}/share/toolchain.cmake -DBACKCOMPAT=ON
|
||||
make
|
||||
make ${MAKEOPTS}
|
||||
DISTNAME=monero-${i}
|
||||
mv bin ${DISTNAME}
|
||||
find ${DISTNAME}/ | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}.tar.gz
|
||||
|
||||
@@ -77,6 +77,7 @@ script: |
|
||||
create_per-host_faketime_wrappers "2000-01-01 12:00:00"
|
||||
export PATH=${WRAP_DIR}:${PATH}
|
||||
|
||||
git config --global core.abbrev 9
|
||||
cd monero
|
||||
BASEPREFIX=`pwd`/contrib/depends
|
||||
|
||||
@@ -100,7 +101,7 @@ script: |
|
||||
export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGPATH}
|
||||
mkdir build && cd build
|
||||
cmake .. -DCMAKE_TOOLCHAIN_FILE=${BASEPREFIX}/${i}/share/toolchain.cmake
|
||||
make
|
||||
make ${MAKEOPTS}
|
||||
DISTNAME=monero-${i}
|
||||
mv bin ${DISTNAME}
|
||||
find ${DISTNAME}/ | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}.tar.gz
|
||||
|
||||
@@ -100,6 +100,7 @@ script: |
|
||||
create_per-host_linker_wrapper "2000-01-01 12:00:00"
|
||||
export PATH=${WRAP_DIR}:${PATH}
|
||||
|
||||
git config --global core.abbrev 9
|
||||
cd monero
|
||||
BASEPREFIX=`pwd`/contrib/depends
|
||||
# Build dependencies for each host
|
||||
@@ -125,7 +126,7 @@ script: |
|
||||
export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGPATH}
|
||||
mkdir build && cd build
|
||||
cmake .. -DCMAKE_TOOLCHAIN_FILE=${BASEPREFIX}/${i}/share/toolchain.cmake
|
||||
make
|
||||
make ${MAKEOPTS}
|
||||
DISTNAME=monero-${i}
|
||||
mv bin ${DISTNAME}
|
||||
find ${DISTNAME}/ | sort | zip -X@ ${OUTDIR}/${DISTNAME}.zip
|
||||
|
||||
2
external/miniupnp
vendored
2
external/miniupnp
vendored
Submodule external/miniupnp updated: 6b9b73a567...4c700e0952
2
external/randomwow
vendored
2
external/randomwow
vendored
Submodule external/randomwow updated: 435a8382d8...10fee444f1
@@ -1081,11 +1081,11 @@ void BlockchainLMDB::add_tx_amount_output_indices(const uint64_t tx_id,
|
||||
|
||||
int result = 0;
|
||||
|
||||
int num_outputs = amount_output_indices.size();
|
||||
size_t num_outputs = amount_output_indices.size();
|
||||
|
||||
MDB_val_set(k_tx_id, tx_id);
|
||||
MDB_val v;
|
||||
v.mv_data = (void *)amount_output_indices.data();
|
||||
v.mv_data = num_outputs ? (void *)amount_output_indices.data() : (void*)"";
|
||||
v.mv_size = sizeof(uint64_t) * num_outputs;
|
||||
// LOG_PRINT_L1("tx_outputs[tx_hash] size: " << v.mv_size);
|
||||
|
||||
@@ -1468,7 +1468,7 @@ void BlockchainLMDB::open(const std::string& filename, const int db_flags)
|
||||
mdb_env_close(m_env);
|
||||
m_open = false;
|
||||
MFATAL("Existing lmdb database needs to be converted, which cannot be done on a read-only database.");
|
||||
MFATAL("Please run monerod once to convert the database.");
|
||||
MFATAL("Please run wownerod once to convert the database.");
|
||||
return;
|
||||
}
|
||||
// Note that there was a schema change within version 0 as well.
|
||||
@@ -1960,7 +1960,7 @@ bool BlockchainLMDB::prune_worker(int mode, uint32_t pruning_seed)
|
||||
|
||||
TIME_MEASURE_START(t);
|
||||
|
||||
size_t n_total_records = 0, n_prunable_records = 0, n_pruned_records = 0;
|
||||
size_t n_total_records = 0, n_prunable_records = 0, n_pruned_records = 0, commit_counter = 0;
|
||||
uint64_t n_bytes = 0;
|
||||
|
||||
mdb_txn_safe txn;
|
||||
@@ -2063,6 +2063,7 @@ bool BlockchainLMDB::prune_worker(int mode, uint32_t pruning_seed)
|
||||
{
|
||||
MDEBUG("Pruning at height " << block_height << "/" << blockchain_height);
|
||||
++n_pruned_records;
|
||||
++commit_counter;
|
||||
n_bytes += k.mv_size + v.mv_size;
|
||||
result = mdb_cursor_del(c_txs_prunable, 0);
|
||||
if (result)
|
||||
@@ -2072,6 +2073,25 @@ bool BlockchainLMDB::prune_worker(int mode, uint32_t pruning_seed)
|
||||
result = mdb_cursor_del(c_txs_prunable_tip, 0);
|
||||
if (result)
|
||||
throw0(DB_ERROR(lmdb_error("Failed to delete transaction tip data: ", result).c_str()));
|
||||
|
||||
if (mode != prune_mode_check && commit_counter >= 4096)
|
||||
{
|
||||
MDEBUG("Committing txn at checkpoint...");
|
||||
txn.commit();
|
||||
result = mdb_txn_begin(m_env, NULL, 0, txn);
|
||||
if (result)
|
||||
throw0(DB_ERROR(lmdb_error("Failed to create a transaction for the db: ", result).c_str()));
|
||||
result = mdb_cursor_open(txn, m_txs_pruned, &c_txs_pruned);
|
||||
if (result)
|
||||
throw0(DB_ERROR(lmdb_error("Failed to open a cursor for txs_pruned: ", result).c_str()));
|
||||
result = mdb_cursor_open(txn, m_txs_prunable, &c_txs_prunable);
|
||||
if (result)
|
||||
throw0(DB_ERROR(lmdb_error("Failed to open a cursor for txs_prunable: ", result).c_str()));
|
||||
result = mdb_cursor_open(txn, m_txs_prunable_tip, &c_txs_prunable_tip);
|
||||
if (result)
|
||||
throw0(DB_ERROR(lmdb_error("Failed to open a cursor for txs_prunable_tip: ", result).c_str()));
|
||||
commit_counter = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2141,6 +2161,7 @@ bool BlockchainLMDB::prune_worker(int mode, uint32_t pruning_seed)
|
||||
result = mdb_cursor_del(c_txs_prunable, 0);
|
||||
if (result)
|
||||
throw0(DB_ERROR(lmdb_error("Failed to delete transaction prunable data: ", result).c_str()));
|
||||
++commit_counter;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2157,6 +2178,34 @@ bool BlockchainLMDB::prune_worker(int mode, uint32_t pruning_seed)
|
||||
", seed " << epee::string_tools::to_string_hex(pruning_seed));
|
||||
}
|
||||
}
|
||||
|
||||
if (mode != prune_mode_check && commit_counter >= 4096)
|
||||
{
|
||||
MDEBUG("Committing txn at checkpoint...");
|
||||
txn.commit();
|
||||
result = mdb_txn_begin(m_env, NULL, 0, txn);
|
||||
if (result)
|
||||
throw0(DB_ERROR(lmdb_error("Failed to create a transaction for the db: ", result).c_str()));
|
||||
result = mdb_cursor_open(txn, m_txs_pruned, &c_txs_pruned);
|
||||
if (result)
|
||||
throw0(DB_ERROR(lmdb_error("Failed to open a cursor for txs_pruned: ", result).c_str()));
|
||||
result = mdb_cursor_open(txn, m_txs_prunable, &c_txs_prunable);
|
||||
if (result)
|
||||
throw0(DB_ERROR(lmdb_error("Failed to open a cursor for txs_prunable: ", result).c_str()));
|
||||
result = mdb_cursor_open(txn, m_txs_prunable_tip, &c_txs_prunable_tip);
|
||||
if (result)
|
||||
throw0(DB_ERROR(lmdb_error("Failed to open a cursor for txs_prunable_tip: ", result).c_str()));
|
||||
result = mdb_cursor_open(txn, m_tx_indices, &c_tx_indices);
|
||||
if (result)
|
||||
throw0(DB_ERROR(lmdb_error("Failed to open a cursor for tx_indices: ", result).c_str()));
|
||||
MDB_val val;
|
||||
val.mv_size = sizeof(ti);
|
||||
val.mv_data = (void *)&ti;
|
||||
result = mdb_cursor_get(c_tx_indices, (MDB_val*)&zerokval, &val, MDB_GET_BOTH);
|
||||
if (result)
|
||||
throw0(DB_ERROR(lmdb_error("Failed to restore cursor for tx_indices: ", result).c_str()));
|
||||
commit_counter = 0;
|
||||
}
|
||||
}
|
||||
mdb_cursor_close(c_tx_indices);
|
||||
}
|
||||
|
||||
@@ -177,7 +177,7 @@ int main(int argc, char* argv[])
|
||||
}
|
||||
r = core_storage->init(db, opt_testnet ? cryptonote::TESTNET : opt_stagenet ? cryptonote::STAGENET : cryptonote::MAINNET);
|
||||
|
||||
if (core_storage->get_blockchain_pruning_seed())
|
||||
if (core_storage->get_blockchain_pruning_seed() && !opt_blocks_dat)
|
||||
{
|
||||
LOG_PRINT_L0("Blockchain is pruned, cannot export");
|
||||
return 1;
|
||||
|
||||
Binary file not shown.
@@ -217,6 +217,10 @@ namespace cryptonote
|
||||
ADD_CHECKPOINT(88200, "50bb43d5d563524d6b9f308a2483b80934bab2ab5250757558318834476f1cfb");
|
||||
ADD_CHECKPOINT(100000, "0c1f3bec32fe4ac9bd4b6ce1f4dfc52824f0947d756c9a1a453252c9423071f5");
|
||||
ADD_CHECKPOINT(111450, "d6eadc95607765b36afd8b9148eac20eb101632021348cd34371fc1d8b67f6b6");
|
||||
ADD_CHECKPOINT(114969, "b48245956b87f243048fd61021f4b3e5443e57eee7ff8ba4762d18926e80b80c"); //Hard fork to v13
|
||||
ADD_CHECKPOINT(114980, "3a96963b93154889bd7d59c8a60cf8005e864b930627616e51a4ad11cd9a3d50");
|
||||
ADD_CHECKPOINT(115257, "338e056551087fe23d6c4b4280244bc5362b004716d85ec799a775f190f9fea9"); //Hard fork to v14
|
||||
ADD_CHECKPOINT(118500, "2ef1cd0c68f1b8e1acf384109431b6377dbdbd6705964be17b7358c47ea07447");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ void hash_extra_skein(const void *data, size_t length, char *hash);
|
||||
|
||||
void tree_hash(const char (*hashes)[HASH_SIZE], size_t count, char *root_hash);
|
||||
|
||||
#define RX_BLOCK_VERSION 12
|
||||
#define RX_BLOCK_VERSION 13
|
||||
void rx_slow_hash_allocate_state(void);
|
||||
void rx_slow_hash_free_state(void);
|
||||
uint64_t rx_seedheight(const uint64_t height);
|
||||
|
||||
@@ -116,7 +116,8 @@ void keccak(const uint8_t *in, size_t inlen, uint8_t *md, int mdlen)
|
||||
local_abort("Bad keccak use");
|
||||
}
|
||||
|
||||
memcpy(temp, in, inlen);
|
||||
if (inlen > 0)
|
||||
memcpy(temp, in, inlen);
|
||||
temp[inlen++] = 1;
|
||||
memset(temp + inlen, 0, rsiz - inlen);
|
||||
temp[rsiz - 1] |= 0x80;
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
|
||||
#include <assert.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "hash-ops.h"
|
||||
@@ -82,23 +83,24 @@ void tree_hash(const char (*hashes)[HASH_SIZE], size_t count, char *root_hash) {
|
||||
|
||||
size_t cnt = tree_hash_cnt( count );
|
||||
|
||||
char ints[cnt][HASH_SIZE];
|
||||
memset(ints, 0 , sizeof(ints)); // zero out as extra protection for using uninitialized mem
|
||||
char *ints = calloc(cnt, HASH_SIZE); // zero out as extra protection for using uninitialized mem
|
||||
assert(ints);
|
||||
|
||||
memcpy(ints, hashes, (2 * cnt - count) * HASH_SIZE);
|
||||
|
||||
for (i = 2 * cnt - count, j = 2 * cnt - count; j < cnt; i += 2, ++j) {
|
||||
cn_fast_hash(hashes[i], 64, ints[j]);
|
||||
cn_fast_hash(hashes[i], 64, ints + j * HASH_SIZE);
|
||||
}
|
||||
assert(i == count);
|
||||
|
||||
while (cnt > 2) {
|
||||
cnt >>= 1;
|
||||
for (i = 0, j = 0; j < cnt; i += 2, ++j) {
|
||||
cn_fast_hash(ints[i], 64, ints[j]);
|
||||
cn_fast_hash(ints + i * HASH_SIZE, 64, ints + j * HASH_SIZE);
|
||||
}
|
||||
}
|
||||
|
||||
cn_fast_hash(ints[0], 64, root_hash);
|
||||
cn_fast_hash(ints, 64, root_hash);
|
||||
free(ints);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -320,7 +320,7 @@ namespace cryptonote
|
||||
}
|
||||
if (!typename Archive<W>::is_saving())
|
||||
pruned = true;
|
||||
return true;
|
||||
return ar.stream().good();
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -146,7 +146,7 @@ namespace cryptonote
|
||||
if (!base_only)
|
||||
{
|
||||
const bool bulletproof = rct::is_rct_bulletproof(rv.type);
|
||||
if (bulletproof && rv.type == rct::RCTTypeBulletproof)
|
||||
if (rct::is_rct_new_bulletproof(rv.type))
|
||||
{
|
||||
if (rv.p.bulletproofs.size() != 1)
|
||||
{
|
||||
@@ -241,8 +241,7 @@ namespace cryptonote
|
||||
tx.invalidate_hashes();
|
||||
//TODO: validate tx
|
||||
|
||||
get_transaction_hash(tx, tx_hash);
|
||||
return true;
|
||||
return get_transaction_hash(tx, tx_hash);
|
||||
}
|
||||
//---------------------------------------------------------------
|
||||
bool parse_and_validate_tx_from_blob(const blobdata& tx_blob, transaction& tx, crypto::hash& tx_hash, crypto::hash& tx_prefix_hash)
|
||||
@@ -415,7 +414,7 @@ namespace cryptonote
|
||||
const size_t n_outputs = tx.vout.size();
|
||||
if (n_outputs <= 2)
|
||||
return blob_size;
|
||||
if (rv.type != rct::RCTTypeBulletproof)
|
||||
if (rct::is_rct_old_bulletproof(rv.type))
|
||||
return blob_size;
|
||||
const uint64_t bp_base = 368;
|
||||
const size_t n_padded_outputs = rct::n_bulletproof_max_amounts(rv.p.bulletproofs);
|
||||
@@ -997,6 +996,7 @@ namespace cryptonote
|
||||
{
|
||||
crypto::hash h = null_hash;
|
||||
get_transaction_hash(t, h, NULL);
|
||||
CHECK_AND_ASSERT_THROW_MES(get_transaction_hash(t, h, NULL), "Failed to calculate transaction hash");
|
||||
return h;
|
||||
}
|
||||
//---------------------------------------------------------------
|
||||
@@ -1289,7 +1289,7 @@ namespace cryptonote
|
||||
txs_ids.reserve(1 + b.tx_hashes.size());
|
||||
crypto::hash h = null_hash;
|
||||
size_t bl_sz = 0;
|
||||
get_transaction_hash(b.miner_tx, h, bl_sz);
|
||||
CHECK_AND_ASSERT_THROW_MES(get_transaction_hash(b.miner_tx, h, bl_sz), "Failed to calculate transaction hash");
|
||||
txs_ids.push_back(h);
|
||||
for(auto& th: b.tx_hashes)
|
||||
txs_ids.push_back(th);
|
||||
|
||||
@@ -126,7 +126,7 @@ namespace cryptonote
|
||||
m_miner_extra_sleep(BACKGROUND_MINING_DEFAULT_MINER_EXTRA_SLEEP_MILLIS),
|
||||
m_block_reward(0)
|
||||
{
|
||||
|
||||
m_attrs.set_stack_size(THREAD_STACK_SIZE);
|
||||
}
|
||||
//-----------------------------------------------------------------------------------------------------
|
||||
miner::~miner()
|
||||
@@ -363,7 +363,7 @@ namespace cryptonote
|
||||
return m_threads_total;
|
||||
}
|
||||
//-----------------------------------------------------------------------------------------------------
|
||||
bool miner::start(const account_public_address& adr, size_t threads_count, const boost::thread::attributes& attrs, bool do_background, bool ignore_battery)
|
||||
bool miner::start(const account_public_address& adr, size_t threads_count, bool do_background, bool ignore_battery)
|
||||
{
|
||||
m_block_reward = 0;
|
||||
m_mine_address = adr;
|
||||
@@ -374,7 +374,6 @@ namespace cryptonote
|
||||
m_threads_autodetect.push_back({epee::misc_utils::get_ns_count(), m_total_hashes});
|
||||
m_threads_total = 1;
|
||||
}
|
||||
m_attrs = attrs;
|
||||
m_starter_nonce = crypto::rand<uint32_t>();
|
||||
CRITICAL_REGION_LOCAL(m_threads_lock);
|
||||
if(is_mining())
|
||||
@@ -398,7 +397,7 @@ namespace cryptonote
|
||||
|
||||
for(size_t i = 0; i != m_threads_total; i++)
|
||||
{
|
||||
m_threads.push_back(boost::thread(attrs, boost::bind(&miner::worker_thread, this)));
|
||||
m_threads.push_back(boost::thread(m_attrs, boost::bind(&miner::worker_thread, this)));
|
||||
}
|
||||
|
||||
if (threads_count == 0)
|
||||
@@ -408,7 +407,7 @@ namespace cryptonote
|
||||
|
||||
if( get_is_background_mining_enabled() )
|
||||
{
|
||||
m_background_mining_thread = boost::thread(attrs, boost::bind(&miner::background_worker_thread, this));
|
||||
m_background_mining_thread = boost::thread(m_attrs, boost::bind(&miner::background_worker_thread, this));
|
||||
LOG_PRINT_L0("Background mining controller thread started" );
|
||||
}
|
||||
|
||||
@@ -490,10 +489,7 @@ namespace cryptonote
|
||||
{
|
||||
if(m_do_mining)
|
||||
{
|
||||
boost::thread::attributes attrs;
|
||||
attrs.set_stack_size(THREAD_STACK_SIZE);
|
||||
|
||||
start(m_mine_address, m_threads_total, attrs, get_is_background_mining_enabled(), get_ignore_battery());
|
||||
start(m_mine_address, m_threads_total, get_is_background_mining_enabled(), get_ignore_battery());
|
||||
}
|
||||
}
|
||||
//-----------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -66,7 +66,7 @@ namespace cryptonote
|
||||
static void init_options(boost::program_options::options_description& desc);
|
||||
bool set_block_template(const block& bl, const difficulty_type& diffic, uint64_t height, uint64_t block_reward);
|
||||
bool on_block_chain_update();
|
||||
bool start(const account_public_address& adr, size_t threads_count, const boost::thread::attributes& attrs, bool do_background = false, bool ignore_battery = false);
|
||||
bool start(const account_public_address& adr, size_t threads_count, bool do_background = false, bool ignore_battery = false);
|
||||
uint64_t get_speed() const;
|
||||
uint32_t get_threads_count() const;
|
||||
void send_stop_signal();
|
||||
|
||||
@@ -101,8 +101,8 @@
|
||||
|
||||
|
||||
#define BLOCKS_IDS_SYNCHRONIZING_DEFAULT_COUNT 10000 //by default, blocks ids count in synchronizing
|
||||
#define BLOCKS_SYNCHRONIZING_DEFAULT_COUNT_PRE_V4 100 //by default, blocks count in blocks downloading
|
||||
#define BLOCKS_SYNCHRONIZING_DEFAULT_COUNT 20 //by default, blocks count in blocks downloading
|
||||
#define BLOCKS_SYNCHRONIZING_DEFAULT_COUNT_PRE_V4 20 //by default, blocks count in blocks downloading
|
||||
#define BLOCKS_SYNCHRONIZING_DEFAULT_COUNT 10 //by default, blocks count in blocks downloading
|
||||
#define BLOCKS_SYNCHRONIZING_MAX_COUNT 2048 //must be a power of 2, greater than 128, equal to SEEDHASH_EPOCH_BLOCKS
|
||||
|
||||
#define CRYPTONOTE_MEMPOOL_TX_LIVETIME (86400*3) //seconds, three days
|
||||
@@ -113,7 +113,7 @@
|
||||
#define P2P_LOCAL_WHITE_PEERLIST_LIMIT 1000
|
||||
#define P2P_LOCAL_GRAY_PEERLIST_LIMIT 5000
|
||||
|
||||
#define P2P_DEFAULT_CONNECTIONS_COUNT 8
|
||||
#define P2P_DEFAULT_CONNECTIONS_COUNT 12
|
||||
#define P2P_DEFAULT_HANDSHAKE_INTERVAL 60 //secondes
|
||||
#define P2P_DEFAULT_PACKET_MAX_SIZE 50000000 //50000000 bytes maximum packet size
|
||||
#define P2P_DEFAULT_PEERS_IN_HANDSHAKE 250
|
||||
|
||||
@@ -1951,10 +1951,14 @@ bool Blockchain::handle_get_objects(NOTIFY_REQUEST_GET_OBJECTS::request& arg, NO
|
||||
|
||||
if (missed_tx_ids.size() != 0)
|
||||
{
|
||||
LOG_ERROR("Error retrieving blocks, missed " << missed_tx_ids.size()
|
||||
<< " transactions for block with hash: " << get_block_hash(bl.second)
|
||||
<< std::endl
|
||||
);
|
||||
// do not display an error if the peer asked for an unpruned block which we are not meant to have
|
||||
if (tools::has_unpruned_block(get_block_height(bl.second), get_current_blockchain_height(), get_blockchain_pruning_seed()))
|
||||
{
|
||||
LOG_ERROR("Error retrieving blocks, missed " << missed_tx_ids.size()
|
||||
<< " transactions for block with hash: " << get_block_hash(bl.second)
|
||||
<< std::endl
|
||||
);
|
||||
}
|
||||
|
||||
// append missed transaction hashes to response missed_ids field,
|
||||
// as done below if any standalone transactions were requested
|
||||
@@ -4960,7 +4964,7 @@ void Blockchain::cancel()
|
||||
}
|
||||
|
||||
#if defined(PER_BLOCK_CHECKPOINT)
|
||||
static const char expected_block_hashes_hash[] = "7014aab67dba5c34f117548a7f9c137b2ca590ae5e6b701a237163ece6d330eb";
|
||||
static const char expected_block_hashes_hash[] = "156a2a9adf0478a1a72c5f886940ab5d9462441e592914c4fa9f72ce8e3fd46e";
|
||||
void Blockchain::load_compiled_in_block_hashes(const GetCheckpointsCallback& get_checkpoints)
|
||||
{
|
||||
if (get_checkpoints == nullptr || !m_fast_sync)
|
||||
|
||||
@@ -686,7 +686,7 @@ namespace cryptonote
|
||||
if (prune_blockchain)
|
||||
{
|
||||
// display a message if the blockchain is not pruned yet
|
||||
if (m_blockchain_storage.get_current_blockchain_height() > 1 && !m_blockchain_storage.get_blockchain_pruning_seed())
|
||||
if (!m_blockchain_storage.get_blockchain_pruning_seed())
|
||||
{
|
||||
MGINFO("Pruning blockchain...");
|
||||
CHECK_AND_ASSERT_MES(m_blockchain_storage.prune_blockchain(), false, "Failed to prune blockchain");
|
||||
@@ -808,7 +808,7 @@ namespace cryptonote
|
||||
if (tx.version >= 2)
|
||||
{
|
||||
rct::rctSig &rv = tx.rct_signatures;
|
||||
if (rv.type != rct::RCTTypeBulletproof){
|
||||
if (!rct::is_rct_new_bulletproof(rv.type)){
|
||||
if (rv.outPk.size() != tx.vout.size())
|
||||
{
|
||||
LOG_PRINT_L1("WRONG TRANSACTION BLOB, Bad outPk size in tx " << tx_hash << ", rejected");
|
||||
@@ -1918,7 +1918,7 @@ namespace cryptonote
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
bool core::check_block_rate()
|
||||
{
|
||||
if (m_offline || m_nettype == FAKECHAIN || m_target_blockchain_height > get_current_blockchain_height())
|
||||
if (m_offline || m_nettype == FAKECHAIN || m_target_blockchain_height > get_current_blockchain_height() || m_target_blockchain_height == 0)
|
||||
{
|
||||
MDEBUG("Not checking block rate, offline or syncing");
|
||||
return true;
|
||||
|
||||
@@ -72,7 +72,7 @@ bool tx_sanity_check(Blockchain &blockchain, const cryptonote::blobdata &tx_blob
|
||||
|
||||
if (n_indices <= 10)
|
||||
{
|
||||
MERROR("n_indices is only " << n_indices);
|
||||
MDEBUG("n_indices is only " << n_indices << ", not checking");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -83,6 +83,8 @@ namespace cryptonote
|
||||
|
||||
uint32_t pruning_seed;
|
||||
|
||||
uint8_t address_type;
|
||||
|
||||
BEGIN_KV_SERIALIZE_MAP()
|
||||
KV_SERIALIZE(incoming)
|
||||
KV_SERIALIZE(localhost)
|
||||
@@ -107,6 +109,7 @@ namespace cryptonote
|
||||
KV_SERIALIZE(connection_id)
|
||||
KV_SERIALIZE(height)
|
||||
KV_SERIALIZE(pruning_seed)
|
||||
KV_SERIALIZE(address_type)
|
||||
END_KV_SERIALIZE_MAP()
|
||||
};
|
||||
|
||||
|
||||
@@ -52,6 +52,7 @@ PUSH_WARNINGS
|
||||
DISABLE_VS_WARNINGS(4355)
|
||||
|
||||
#define LOCALHOST_INT 2130706433
|
||||
#define CURRENCY_PROTOCOL_MAX_OBJECT_REQUEST_COUNT 500
|
||||
|
||||
namespace cryptonote
|
||||
{
|
||||
|
||||
@@ -285,6 +285,7 @@ namespace cryptonote
|
||||
|
||||
cnx.height = cntxt.m_remote_blockchain_height;
|
||||
cnx.pruning_seed = cntxt.m_pruning_seed;
|
||||
cnx.address_type = (uint8_t)cntxt.m_remote_address.get_type_id();
|
||||
|
||||
connections.push_back(cnx);
|
||||
|
||||
@@ -809,12 +810,27 @@ namespace cryptonote
|
||||
NOTIFY_NEW_FLUFFY_BLOCK::request fluffy_response;
|
||||
fluffy_response.b.block = t_serializable_object_to_blob(b);
|
||||
fluffy_response.current_blockchain_height = arg.current_blockchain_height;
|
||||
std::vector<bool> seen(b.tx_hashes.size(), false);
|
||||
for(auto& tx_idx: arg.missing_tx_indices)
|
||||
{
|
||||
if(tx_idx < b.tx_hashes.size())
|
||||
{
|
||||
MDEBUG(" tx " << b.tx_hashes[tx_idx]);
|
||||
if (seen[tx_idx])
|
||||
{
|
||||
LOG_ERROR_CCONTEXT
|
||||
(
|
||||
"Failed to handle request NOTIFY_REQUEST_FLUFFY_MISSING_TX"
|
||||
<< ", request is asking for duplicate tx "
|
||||
<< ", tx index = " << tx_idx << ", block tx count " << b.tx_hashes.size()
|
||||
<< ", block_height = " << arg.current_blockchain_height
|
||||
<< ", dropping connection"
|
||||
);
|
||||
drop_connection(context, true, false);
|
||||
return 1;
|
||||
}
|
||||
txids.push_back(b.tx_hashes[tx_idx]);
|
||||
seen[tx_idx] = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -914,6 +930,17 @@ namespace cryptonote
|
||||
int t_cryptonote_protocol_handler<t_core>::handle_request_get_objects(int command, NOTIFY_REQUEST_GET_OBJECTS::request& arg, cryptonote_connection_context& context)
|
||||
{
|
||||
MLOG_P2P_MESSAGE("Received NOTIFY_REQUEST_GET_OBJECTS (" << arg.blocks.size() << " blocks, " << arg.txs.size() << " txes)");
|
||||
|
||||
if (arg.blocks.size() + arg.txs.size() > CURRENCY_PROTOCOL_MAX_OBJECT_REQUEST_COUNT)
|
||||
{
|
||||
LOG_ERROR_CCONTEXT(
|
||||
"Requested objects count is too big ("
|
||||
<< arg.blocks.size() + arg.txs.size() << ") expected not more then "
|
||||
<< CURRENCY_PROTOCOL_MAX_OBJECT_REQUEST_COUNT);
|
||||
drop_connection(context, false, false);
|
||||
return 1;
|
||||
}
|
||||
|
||||
NOTIFY_RESPONSE_GET_OBJECTS::request rsp;
|
||||
if(!m_core.handle_get_objects(arg, rsp, context))
|
||||
{
|
||||
@@ -2369,7 +2396,7 @@ skip:
|
||||
MINFO("Target height decreasing from " << previous_target << " to " << target);
|
||||
m_core.set_target_blockchain_height(target);
|
||||
if (target == 0 && context.m_state > cryptonote_connection_context::state_before_handshake && !m_stopping)
|
||||
MCWARNING("global", "monerod is now disconnected from the network");
|
||||
MCWARNING("global", "wownerod is now disconnected from the network");
|
||||
}
|
||||
|
||||
m_block_queue.flush_spans(context.m_connection_id, false);
|
||||
|
||||
@@ -46,6 +46,19 @@
|
||||
namespace daemonize {
|
||||
|
||||
namespace {
|
||||
const char *get_address_type_name(epee::net_utils::address_type address_type)
|
||||
{
|
||||
switch (address_type)
|
||||
{
|
||||
default:
|
||||
case epee::net_utils::address_type::invalid: return "invalid";
|
||||
case epee::net_utils::address_type::ipv4: return "IPv4";
|
||||
case epee::net_utils::address_type::ipv6: return "IPv6";
|
||||
case epee::net_utils::address_type::i2p: return "I2P";
|
||||
case epee::net_utils::address_type::tor: return "Tor";
|
||||
}
|
||||
}
|
||||
|
||||
void print_peer(std::string const & prefix, cryptonote::peer const & peer)
|
||||
{
|
||||
time_t now;
|
||||
@@ -559,8 +572,7 @@ bool t_rpc_command_executor::mining_status() {
|
||||
uint64_t daily = 86400ull / mres.block_target * mres.block_reward * ratio;
|
||||
uint64_t monthly = 86400ull / mres.block_target * 30.5 * mres.block_reward * ratio;
|
||||
uint64_t yearly = 86400ull / mres.block_target * 356 * mres.block_reward * ratio;
|
||||
tools::msg_writer() << "Expected: " << cryptonote::print_money(daily) << " monero daily, "
|
||||
<< cryptonote::print_money(monthly) << " monero monthly, " << cryptonote::print_money(yearly) << " yearly";
|
||||
tools::msg_writer() << "Possible reward: " << cryptonote::print_money(monthly) << " WOW monthly, " << cryptonote::print_money(yearly) << " WOW yearly";
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -590,6 +602,7 @@ bool t_rpc_command_executor::print_connections() {
|
||||
}
|
||||
|
||||
tools::msg_writer() << std::setw(30) << std::left << "Remote Host"
|
||||
<< std::setw(8) << "Type"
|
||||
<< std::setw(6) << "SSL"
|
||||
<< std::setw(20) << "Peer id"
|
||||
<< std::setw(20) << "Support Flags"
|
||||
@@ -610,6 +623,7 @@ bool t_rpc_command_executor::print_connections() {
|
||||
tools::msg_writer()
|
||||
//<< std::setw(30) << std::left << in_out
|
||||
<< std::setw(30) << std::left << address
|
||||
<< std::setw(8) << (get_address_type_name((epee::net_utils::address_type)info.address_type))
|
||||
<< std::setw(6) << (info.ssl ? "yes" : "no")
|
||||
<< std::setw(20) << epee::string_tools::pad_string(info.peer_id, 16, '0', true)
|
||||
<< std::setw(20) << info.support_flags
|
||||
|
||||
@@ -90,6 +90,20 @@ namespace hw {
|
||||
AKout = keys.AKout;
|
||||
}
|
||||
|
||||
ABPkeys &ABPkeys::operator=(const ABPkeys& keys) {
|
||||
if (&keys == this)
|
||||
return *this;
|
||||
Aout = keys.Aout;
|
||||
Bout = keys.Bout;
|
||||
is_subaddress = keys.is_subaddress;
|
||||
is_change_address = keys.is_change_address;
|
||||
additional_key = keys.additional_key;
|
||||
index = keys.index;
|
||||
Pout = keys.Pout;
|
||||
AKout = keys.AKout;
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool Keymap::find(const rct::key& P, ABPkeys& keys) const {
|
||||
size_t sz = ABP.size();
|
||||
for (size_t i=0; i<sz; i++) {
|
||||
|
||||
@@ -77,6 +77,7 @@ namespace hw {
|
||||
ABPkeys(const rct::key& A, const rct::key& B, const bool is_subaddr, bool is_subaddress, bool is_change_address, size_t index, const rct::key& P,const rct::key& AK);
|
||||
ABPkeys(const ABPkeys& keys) ;
|
||||
ABPkeys() {index=0;is_subaddress=false;is_subaddress=false;is_change_address=false;}
|
||||
ABPkeys &operator=(const ABPkeys &keys);
|
||||
};
|
||||
|
||||
class Keymap {
|
||||
|
||||
@@ -1579,7 +1579,7 @@ namespace nodetool
|
||||
}
|
||||
else
|
||||
{
|
||||
const el::Level level = el::Level::Warning;
|
||||
const el::Level level = el::Level::Debug;
|
||||
MCLOG_RED(level, "global", "No incoming connections - check firewalls/routers allow port " << get_this_peer_port());
|
||||
}
|
||||
}
|
||||
@@ -2207,10 +2207,11 @@ namespace nodetool
|
||||
auto public_zone = m_network_zones.find(epee::net_utils::zone::public_);
|
||||
if (public_zone != m_network_zones.end())
|
||||
{
|
||||
const auto current = public_zone->second.m_config.m_net_config.max_out_connection_count;
|
||||
const auto current = public_zone->second.m_net_server.get_config_object().get_out_connections_count();
|
||||
public_zone->second.m_config.m_net_config.max_out_connection_count = count;
|
||||
if(current > count)
|
||||
public_zone->second.m_net_server.get_config_object().del_out_connections(current - count);
|
||||
m_payload_handler.set_max_out_peers(count);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2220,7 +2221,7 @@ namespace nodetool
|
||||
auto public_zone = m_network_zones.find(epee::net_utils::zone::public_);
|
||||
if (public_zone != m_network_zones.end())
|
||||
{
|
||||
const auto current = public_zone->second.m_config.m_net_config.max_in_connection_count;
|
||||
const auto current = public_zone->second.m_net_server.get_config_object().get_in_connections_count();
|
||||
public_zone->second.m_config.m_net_config.max_in_connection_count = count;
|
||||
if(current > count)
|
||||
public_zone->second.m_net_server.get_config_object().del_in_connections(current - count);
|
||||
|
||||
@@ -379,8 +379,14 @@ namespace nodetool
|
||||
trim_gray_peerlist();
|
||||
}else
|
||||
{
|
||||
//update record in white list
|
||||
m_peers_gray.replace(by_addr_it_gr, ple);
|
||||
//update record in gray list
|
||||
peerlist_entry new_ple = ple;
|
||||
if (by_addr_it_gr->pruning_seed && ple.pruning_seed == 0) // guard against older nodes not passing pruning info around
|
||||
new_ple.pruning_seed = by_addr_it_gr->pruning_seed;
|
||||
if (by_addr_it_gr->rpc_port && ple.rpc_port == 0) // guard against older nodes not passing RPC port around
|
||||
new_ple.rpc_port = by_addr_it_gr->rpc_port;
|
||||
new_ple.last_seen = by_addr_it_gr->last_seen; // do not overwrite the last seen timestamp, incoming peer list are untrusted
|
||||
m_peers_gray.replace(by_addr_it_gr, new_ple);
|
||||
}
|
||||
return true;
|
||||
CATCH_ENTRY_L0("peerlist_manager::append_with_peer_gray()", false);
|
||||
|
||||
@@ -134,10 +134,11 @@ namespace boost
|
||||
a & port;
|
||||
a & length;
|
||||
|
||||
if (length > net::tor_address::buffer_size())
|
||||
const size_t buffer_size = net::tor_address::buffer_size();
|
||||
if (length > buffer_size)
|
||||
MONERO_THROW(net::error::invalid_tor_address, "Tor address too long");
|
||||
|
||||
char host[net::tor_address::buffer_size()] = {0};
|
||||
char host[buffer_size] = {0};
|
||||
a.load_binary(host, length);
|
||||
host[sizeof(host) - 1] = 0;
|
||||
|
||||
@@ -155,10 +156,11 @@ namespace boost
|
||||
a & port;
|
||||
a & length;
|
||||
|
||||
if (length > net::i2p_address::buffer_size())
|
||||
const size_t buffer_size = net::i2p_address::buffer_size();
|
||||
if (length > buffer_size)
|
||||
MONERO_THROW(net::error::invalid_i2p_address, "i2p address too long");
|
||||
|
||||
char host[net::i2p_address::buffer_size()] = {0};
|
||||
char host[buffer_size] = {0};
|
||||
a.load_binary(host, length);
|
||||
host[sizeof(host) - 1] = 0;
|
||||
|
||||
|
||||
@@ -1099,7 +1099,7 @@ namespace rct {
|
||||
tools::threadpool::waiter waiter;
|
||||
std::deque<bool> results(bulletproof ? rv.p.bulletproofs.size() : rv.outPk.size(), false);
|
||||
DP("range proofs verified?");
|
||||
if (bulletproof && rv.type == RCTTypeBulletproof)
|
||||
if (rct::is_rct_new_bulletproof(rv.type))
|
||||
{
|
||||
for (size_t i = 0; i < rv.p.bulletproofs.size(); i++)
|
||||
tpool.submit(&waiter, [&, i] { results[i] = verBulletproof(rv.p.bulletproofs[i]); });
|
||||
@@ -1232,7 +1232,7 @@ namespace rct {
|
||||
for (const rctSig *rvp: rvv)
|
||||
{
|
||||
const rctSig &rv = *rvp;
|
||||
if (rv.type != RCTTypeBulletproof){
|
||||
if (!rct::is_rct_new_bulletproof(rv.type)){
|
||||
if (!proofs.empty() && !verBulletproof_old(proofs))
|
||||
{
|
||||
LOG_PRINT_L1("Aggregate range proof verified failed");
|
||||
|
||||
@@ -251,6 +251,11 @@ namespace rct {
|
||||
}
|
||||
}
|
||||
|
||||
bool is_rct_new_bulletproof(int type)
|
||||
{
|
||||
return is_rct_bulletproof(type) && !is_rct_old_bulletproof(type);
|
||||
}
|
||||
|
||||
bool is_rct_borromean(int type)
|
||||
{
|
||||
switch (type)
|
||||
|
||||
@@ -256,7 +256,7 @@ namespace rct {
|
||||
{
|
||||
FIELD(type)
|
||||
if (type == RCTTypeNull)
|
||||
return true;
|
||||
return ar.stream().good();
|
||||
if (type != RCTTypeFull && type != RCTTypeSimple && type != RCTTypeBulletproof && type != RCTTypeBulletproof2 && type != RCTTypeFullBulletproof && type != RCTTypeSimpleBulletproof)
|
||||
return false;
|
||||
VARINT_FIELD(txnFee)
|
||||
@@ -316,7 +316,7 @@ namespace rct {
|
||||
ar.delimit_array();
|
||||
}
|
||||
ar.end_array();
|
||||
return true;
|
||||
return ar.stream().good();
|
||||
}
|
||||
};
|
||||
struct rctSigPrunable {
|
||||
@@ -329,7 +329,7 @@ namespace rct {
|
||||
bool serialize_rctsig_prunable(Archive<W> &ar, uint8_t type, size_t inputs, size_t outputs, size_t mixin)
|
||||
{
|
||||
if (type == RCTTypeNull)
|
||||
return true;
|
||||
return ar.stream().good();
|
||||
if (type != RCTTypeFull && type != RCTTypeSimple && type != RCTTypeBulletproof && type != RCTTypeBulletproof2 && type != RCTTypeFullBulletproof && type != RCTTypeSimpleBulletproof)
|
||||
return false;
|
||||
if (type == RCTTypeSimpleBulletproof || type == RCTTypeFullBulletproof)
|
||||
@@ -448,7 +448,7 @@ namespace rct {
|
||||
}
|
||||
ar.end_array();
|
||||
}
|
||||
return true;
|
||||
return ar.stream().good();
|
||||
}
|
||||
|
||||
};
|
||||
@@ -574,6 +574,7 @@ namespace rct {
|
||||
bool is_rct_simple(int type);
|
||||
bool is_rct_bulletproof(int type);
|
||||
bool is_rct_old_bulletproof(int type);
|
||||
bool is_rct_new_bulletproof(int type);
|
||||
bool is_rct_borromean(int type);
|
||||
|
||||
static inline const rct::key &pk2rct(const crypto::public_key &pk) { return (const rct::key&)pk; }
|
||||
|
||||
@@ -59,6 +59,8 @@ using namespace epee;
|
||||
#define MAX_RESTRICTED_FAKE_OUTS_COUNT 40
|
||||
#define MAX_RESTRICTED_GLOBAL_FAKE_OUTS_COUNT 5000
|
||||
|
||||
#define OUTPUT_HISTOGRAM_RECENT_CUTOFF_RESTRICTION (3 * 86400) // 3 days max, the wallet requests 1.8 days
|
||||
|
||||
namespace
|
||||
{
|
||||
void add_reason(std::string &reasons, const char *reason)
|
||||
@@ -905,16 +907,13 @@ namespace cryptonote
|
||||
return true;
|
||||
}
|
||||
|
||||
boost::thread::attributes attrs;
|
||||
attrs.set_stack_size(THREAD_STACK_SIZE);
|
||||
|
||||
cryptonote::miner &miner= m_core.get_miner();
|
||||
if (miner.is_mining())
|
||||
{
|
||||
res.status = "Already mining";
|
||||
return true;
|
||||
}
|
||||
if(!miner.start(info.address, static_cast<size_t>(req.threads_count), attrs, req.do_background_mining, req.ignore_battery))
|
||||
if(!miner.start(info.address, static_cast<size_t>(req.threads_count), req.do_background_mining, req.ignore_battery))
|
||||
{
|
||||
res.status = "Failed, mining not started";
|
||||
LOG_PRINT_L0(res.status);
|
||||
@@ -1898,6 +1897,13 @@ namespace cryptonote
|
||||
if (use_bootstrap_daemon_if_necessary<COMMAND_RPC_GET_OUTPUT_HISTOGRAM>(invoke_http_mode::JON_RPC, "get_output_histogram", req, res, r))
|
||||
return r;
|
||||
|
||||
const bool restricted = m_restricted && ctx;
|
||||
if (restricted && req.recent_cutoff > 0 && req.recent_cutoff < (uint64_t)time(NULL) - OUTPUT_HISTOGRAM_RECENT_CUTOFF_RESTRICTION)
|
||||
{
|
||||
res.status = "Recent cutoff is too old";
|
||||
return true;
|
||||
}
|
||||
|
||||
std::map<uint64_t, std::tuple<uint64_t, uint64_t, uint64_t>> histogram;
|
||||
try
|
||||
{
|
||||
|
||||
@@ -408,10 +408,7 @@ namespace rpc
|
||||
return;
|
||||
}
|
||||
|
||||
boost::thread::attributes attrs;
|
||||
attrs.set_stack_size(THREAD_STACK_SIZE);
|
||||
|
||||
if(!m_core.get_miner().start(info.address, static_cast<size_t>(req.threads_count), attrs, req.do_background_mining, req.ignore_battery))
|
||||
if(!m_core.get_miner().start(info.address, static_cast<size_t>(req.threads_count), req.do_background_mining, req.ignore_battery))
|
||||
{
|
||||
res.error_details = "Failed, mining not started";
|
||||
LOG_PRINT_L0(res.error_details);
|
||||
|
||||
@@ -63,7 +63,9 @@ namespace rpc
|
||||
d.cached_to -= 10;
|
||||
d.cached_top_hash = hash10;
|
||||
d.cached_m10_hash = crypto::null_hash;
|
||||
d.cached_distribution.resize(d.cached_distribution.size() - 10);
|
||||
CHECK_AND_ASSERT_MES(d.cached_distribution.size() >= 10, boost::none, "Cached distribution size does not match cached bounds");
|
||||
for (int p = 0; p < 10; ++p)
|
||||
d.cached_distribution.pop_back();
|
||||
can_extend = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,7 +146,8 @@ struct binary_archive<false> : public binary_archive_base<std::istream, false>
|
||||
void serialize_uvarint(T &v)
|
||||
{
|
||||
typedef std::istreambuf_iterator<char> it;
|
||||
tools::read_varint(it(stream_), it(), v); // XXX handle failure
|
||||
if (tools::read_varint(it(stream_), it(), v) < 0)
|
||||
stream_.setstate(std::ios_base::failbit);
|
||||
}
|
||||
|
||||
void begin_array(size_t &s)
|
||||
|
||||
@@ -566,6 +566,7 @@ void toJsonValue(rapidjson::Document& doc, const cryptonote::connection_info& in
|
||||
INSERT_INTO_JSON_OBJECT(val, doc, incoming, info.incoming);
|
||||
INSERT_INTO_JSON_OBJECT(val, doc, localhost, info.localhost);
|
||||
INSERT_INTO_JSON_OBJECT(val, doc, local_ip, info.local_ip);
|
||||
INSERT_INTO_JSON_OBJECT(val, doc, address_type, info.address_type);
|
||||
|
||||
INSERT_INTO_JSON_OBJECT(val, doc, ip, info.ip);
|
||||
INSERT_INTO_JSON_OBJECT(val, doc, port, info.port);
|
||||
@@ -601,6 +602,7 @@ void fromJsonValue(const rapidjson::Value& val, cryptonote::connection_info& inf
|
||||
GET_FROM_JSON_OBJECT(val, info.incoming, incoming);
|
||||
GET_FROM_JSON_OBJECT(val, info.localhost, localhost);
|
||||
GET_FROM_JSON_OBJECT(val, info.local_ip, local_ip);
|
||||
GET_FROM_JSON_OBJECT(val, info.address_type, address_type);
|
||||
|
||||
GET_FROM_JSON_OBJECT(val, info.ip, ip);
|
||||
GET_FROM_JSON_OBJECT(val, info.port, port);
|
||||
|
||||
@@ -212,7 +212,7 @@ inline bool do_serialize(Archive &ar, bool &v)
|
||||
* \brief self-explanatory
|
||||
*/
|
||||
#define END_SERIALIZE() \
|
||||
return true; \
|
||||
return ar.stream().good(); \
|
||||
}
|
||||
|
||||
/*! \macro VALUE(f)
|
||||
|
||||
@@ -4121,7 +4121,9 @@ bool simple_wallet::init(const boost::program_options::variables_map& vm)
|
||||
|
||||
m_wallet->callback(this);
|
||||
|
||||
check_background_mining(password);
|
||||
bool skip_check_backround_mining = !command_line::get_arg(vm, arg_command).empty();
|
||||
if (!skip_check_backround_mining)
|
||||
check_background_mining(password);
|
||||
|
||||
if (welcome)
|
||||
message_writer(console_color_yellow, true) << tr("If you are new to Wownero, type \"welcome\" for a brief overview.");
|
||||
@@ -4744,7 +4746,7 @@ void simple_wallet::stop_background_mining()
|
||||
return;
|
||||
}
|
||||
}
|
||||
message_writer(console_color_red, false) << tr("Background mining not enabled. Run \"set setup-background-mining 1\" to change.");
|
||||
message_writer() << tr("To enable automatic background mining run \"set setup-background-mining 1\".");
|
||||
}
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
void simple_wallet::check_background_mining(const epee::wipeable_string &password)
|
||||
@@ -4752,7 +4754,7 @@ void simple_wallet::check_background_mining(const epee::wipeable_string &passwor
|
||||
tools::wallet2::BackgroundMiningSetupType setup = m_wallet->setup_background_mining();
|
||||
if (setup == tools::wallet2::BackgroundMiningNo)
|
||||
{
|
||||
message_writer(console_color_red, false) << tr("Background mining not enabled. Run \"set setup-background-mining 1\" to change.");
|
||||
message_writer() << tr("To enable automatic background mining run \"set setup-background-mining 1\".");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -4790,7 +4792,7 @@ void simple_wallet::check_background_mining(const epee::wipeable_string &passwor
|
||||
if (std::cin.eof() || !command_line::is_yes(accepted)) {
|
||||
m_wallet->setup_background_mining(tools::wallet2::BackgroundMiningNo);
|
||||
m_wallet->rewrite(m_wallet_file, password);
|
||||
message_writer(console_color_red, false) << tr("Background mining not enabled. Set setup-background-mining to 1 to change.");
|
||||
message_writer() << tr("To enable automatic background mining run \"set setup-background-mining 1\".");
|
||||
return;
|
||||
}
|
||||
m_wallet->setup_background_mining(tools::wallet2::BackgroundMiningYes);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#define DEF_MONERO_VERSION_TAG "@VERSIONTAG@"
|
||||
#define DEF_MONERO_VERSION "0.6.0.0"
|
||||
#define DEF_MONERO_VERSION "0.6.1.2"
|
||||
#define DEF_MONERO_RELEASE_NAME "F For Fappening"
|
||||
#define DEF_MONERO_VERSION_FULL DEF_MONERO_VERSION "-" DEF_MONERO_VERSION_TAG
|
||||
|
||||
|
||||
@@ -1113,7 +1113,7 @@ wallet2::wallet2(network_type nettype, uint64_t kdf_rounds, bool unattended):
|
||||
m_segregation_height(0),
|
||||
m_ignore_fractional_outputs(true),
|
||||
m_track_uses(false),
|
||||
m_setup_background_mining(BackgroundMiningMaybe),
|
||||
m_setup_background_mining(BackgroundMiningNo),
|
||||
m_is_initialized(false),
|
||||
m_kdf_rounds(kdf_rounds),
|
||||
is_old_file_format(false),
|
||||
@@ -3324,7 +3324,7 @@ bool wallet2::get_rct_distribution(uint64_t &start_height, std::vector<uint64_t>
|
||||
cryptonote::COMMAND_RPC_GET_OUTPUT_DISTRIBUTION::response res = AUTO_VAL_INIT(res);
|
||||
req.amounts.push_back(0);
|
||||
req.from_height = 0;
|
||||
req.cumulative = false;
|
||||
req.cumulative = true;
|
||||
req.binary = true;
|
||||
req.compress = true;
|
||||
m_daemon_rpc_mutex.lock();
|
||||
@@ -3355,8 +3355,8 @@ bool wallet2::get_rct_distribution(uint64_t &start_height, std::vector<uint64_t>
|
||||
MWARNING("Failed to request output distribution: results are not for amount 0");
|
||||
return false;
|
||||
}
|
||||
for (size_t i = 1; i < res.distributions[0].data.distribution.size(); ++i)
|
||||
res.distributions[0].data.distribution[i] += res.distributions[0].data.distribution[i-1];
|
||||
// for (size_t i = 1; i < res.distributions[0].data.distribution.size(); ++i)
|
||||
// res.distributions[0].data.distribution[i] += res.distributions[0].data.distribution[i-1];
|
||||
start_height = res.distributions[0].data.start_height;
|
||||
distribution = std::move(res.distributions[0].data.distribution);
|
||||
return true;
|
||||
@@ -3789,7 +3789,7 @@ bool wallet2::load_keys(const std::string& keys_file_name, const epee::wipeable_
|
||||
m_segregation_height = 0;
|
||||
m_ignore_fractional_outputs = true;
|
||||
m_track_uses = false;
|
||||
m_setup_background_mining = BackgroundMiningMaybe;
|
||||
m_setup_background_mining = BackgroundMiningNo;
|
||||
m_subaddress_lookahead_major = SUBADDRESS_LOOKAHEAD_MAJOR;
|
||||
m_subaddress_lookahead_minor = SUBADDRESS_LOOKAHEAD_MINOR;
|
||||
m_original_keys_available = false;
|
||||
@@ -9177,7 +9177,7 @@ std::vector<wallet2::pending_tx> wallet2::create_transactions_2(std::vector<cryp
|
||||
const bool bulletproof = use_fork_rules(get_bulletproof_fork(), 0);
|
||||
const rct::RCTConfig rct_config {
|
||||
bulletproof ? rct::RangeProofPaddedBulletproof : rct::RangeProofBorromean,
|
||||
bulletproof ? (use_fork_rules(12, 0) ? 1 : 2) : 0
|
||||
bulletproof ? (use_fork_rules(HF_VERSION_SMALLER_BP, -10) ? 2 : 1) : 0
|
||||
};
|
||||
|
||||
const uint64_t base_fee = get_base_fee();
|
||||
@@ -9826,7 +9826,7 @@ std::vector<wallet2::pending_tx> wallet2::create_transactions_from(const crypton
|
||||
const bool bulletproof = use_fork_rules(get_bulletproof_fork(), 0);
|
||||
const rct::RCTConfig rct_config {
|
||||
bulletproof ? rct::RangeProofPaddedBulletproof : rct::RangeProofBorromean,
|
||||
bulletproof ? (use_fork_rules(12, 0) ? 1 : 2) : 0,
|
||||
bulletproof ? (use_fork_rules(HF_VERSION_SMALLER_BP, -10) ? 2 : 1) : 0
|
||||
};
|
||||
const uint64_t base_fee = get_base_fee();
|
||||
const uint64_t fee_multiplier = get_fee_multiplier(priority, get_fee_algorithm());
|
||||
|
||||
@@ -141,7 +141,7 @@ namespace wallet_args
|
||||
if (command_line::get_arg(vm, command_line::arg_help))
|
||||
{
|
||||
Print(print) << "Wownero '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")" << ENDL;
|
||||
Print(print) << wallet_args::tr("This is the command line monero wallet. It needs to connect to a monero\n"
|
||||
Print(print) << wallet_args::tr("This is the command line wownero wallet. It needs to connect to a wownero\n"
|
||||
"daemon to work correctly.") << ENDL;
|
||||
Print(print) << wallet_args::tr("Usage:") << ENDL << " " << usage;
|
||||
Print(print) << desc_all;
|
||||
|
||||
@@ -260,7 +260,7 @@ namespace tools
|
||||
tools::wallet2::BackgroundMiningSetupType setup = m_wallet->setup_background_mining();
|
||||
if (setup == tools::wallet2::BackgroundMiningNo)
|
||||
{
|
||||
MLOG_RED(el::Level::Warning, "Background mining not enabled. Run \"set setup-background-mining 1\" in monero-wallet-cli to change.");
|
||||
MLOG_RED(el::Level::Warning, "Background mining not enabled. Run \"set setup-background-mining 1\" in wownero-wallet-cli to change.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -285,8 +285,8 @@ namespace tools
|
||||
{
|
||||
MINFO("The daemon is not set up to background mine.");
|
||||
MINFO("With background mining enabled, the daemon will mine when idle and not on batttery.");
|
||||
MINFO("Enabling this supports the network you are using, and makes you eligible for receiving new monero");
|
||||
MINFO("Set setup-background-mining to 1 in monero-wallet-cli to change.");
|
||||
MINFO("Enabling this supports the network you are using, and makes you eligible for receiving new wownero");
|
||||
MINFO("Set setup-background-mining to 1 in wownero-wallet-cli to change.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user