Merge branch 'dev' into duke

This commit is contained in:
Duke Leto
2021-02-25 15:49:30 -08:00
11 changed files with 88 additions and 28 deletions

View File

@@ -1,4 +1,4 @@
# Copyright 2016-2020 The Hush developers
# Copyright 2016-2021 The Hush developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
@@ -483,8 +483,8 @@ nodist_libbitcoin_util_a_SOURCES = $(srcdir)/obj/build.h
# komodod binary #
komodod_SOURCES = bitcoind.cpp
komodod_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
komodod_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
komodod_CPPFLAGS = -fPIC $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
komodod_CXXFLAGS = -fPIC $(AM_CXXFLAGS) $(PIE_FLAGS)
komodod_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
if TARGET_WINDOWS

View File

@@ -1,6 +1,6 @@
// Copyright (c) 2009-2014 The Bitcoin Core developers
// Copyright (c) 2016-2017 The Zcash developers
// Copyright (c) 2016-2020 The Hush developers
// Copyright (c) 2016-2021 The Hush developers
// Distributed under the GPLv3 software license, see the accompanying
// file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
/******************************************************************************
@@ -29,7 +29,7 @@
// Must be kept in sync with configure.ac , ugh!
#define CLIENT_VERSION_MAJOR 3
#define CLIENT_VERSION_MINOR 6
#define CLIENT_VERSION_REVISION 2
#define CLIENT_VERSION_REVISION 3
#define CLIENT_VERSION_BUILD 50
//! Set to true for release, false for prerelease or test build

View File

@@ -1,8 +1,10 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2014 The Bitcoin Core developers
// Copyright (c) 2016-2020 The Hush developers
// Copyright (c) 2016-2021 The Hush developers
// Distributed under the GPLv3 software license, see the accompanying
// file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
// What happened to the SuperNET devs, who were dedicated to privacy???
// Did they go the way of the dodo when they embraced KYC?
/******************************************************************************
* Copyright © 2014-2019 The SuperNET Developers. *
* *
@@ -1095,13 +1097,52 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
fs::path pwd = fs::path(cwd);
fs::path contrib = pwd / ".." / "contrib" / "asmap";
// if no filepath, use the default in contrib
// If no asmap given (default), look for one
// First we look in PWD, the most common case (binaries)
// Then we look in /usr/share/hush, for Debian packages
// then we look in ../contrib/asmap/ for compiling from source case
// finally we try the parent directory .. as a last resort
// if no asmap can be found, something is wrong, and we exit
if (asmap_path.empty()) {
asmap_path = contrib / DEFAULT_ASMAP_FILENAME;
}
if (!asmap_path.is_absolute()) {
asmap_path = GetDataDir() / asmap_path;
// Most binaries will have it in PWD
asmap_path = pwd / DEFAULT_ASMAP_FILENAME;
printf("%s: looking for asmap file at %s\n", __func__, asmap_path.c_str() );
if(fs::exists(asmap_path)) {
printf("%s: found asmap file at %s\n", __func__, asmap_path.c_str() );
} else {
// Debian Packages
asmap_path = fs::path("/usr/share/hush") / DEFAULT_ASMAP_FILENAME;
printf("%s: looking for asmap file at %s\n", __func__, asmap_path.c_str() );
if(fs::exists(asmap_path)) {
printf("%s: found asmap file at %s\n", __func__, asmap_path.c_str() );
} else {
// Source code
asmap_path = contrib / DEFAULT_ASMAP_FILENAME;
printf("%s: looking for asmap file at %s\n", __func__, asmap_path.c_str() );
if(fs::exists(asmap_path)) {
printf("%s: found asmap file at %s\n", __func__, asmap_path.c_str() );
} else {
// Last Resort: Check the parent directory
asmap_path = pwd / ".." / DEFAULT_ASMAP_FILENAME;
printf("%s: looking for asmap file at %s\n", __func__, asmap_path.c_str() );
if(fs::exists(asmap_path)) {
printf("%s: found asmap file at %s\n", __func__, asmap_path.c_str() );
} else {
// Shit is fucked up, die an honorable death
InitError(strprintf(_("Could not find any asmap file! Please report this bug to Hush Developers")));
return false;
}
}
}
}
} else {
if (!asmap_path.is_absolute()) {
asmap_path = GetDataDir() / asmap_path;
}
printf("%s: looking for custom asmap file at %s\n", __func__, asmap_path.c_str() );
}
//TODO: verify asmap_path is not a directory
if (!fs::exists(asmap_path)) {
InitError(strprintf(_("Could not find asmap file %s"), asmap_path));
return false;
@@ -1113,8 +1154,8 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
}
const uint256 asmap_version = SerializeHash(asmap);
printf("%s: asmap version=%s with %lu mappings\n", __func__, asmap_version.ToString().c_str(), asmap.size());
LogPrintf("Using asmap version %s for IP bucketing with %lu mappings\n", asmap_version.ToString(), asmap.size());
addrman.m_asmap = std::move(asmap); // //node.connman->SetAsmap(std::move(asmap));
LogPrintf("Using asmap version %s for IP bucketing\n", asmap_version.ToString());
} else {
LogPrintf("Using /16 prefix for IP bucketing, but why?\n");

View File

@@ -1,6 +1,6 @@
// Copyright (c) 2010 Satoshi Nakamoto
// Copyright (c) 2009-2015 The Bitcoin Core developers
// Copyright (c) 2016-2020 The Hush developers
// Copyright (c) 2016-2021 The Hush developers
// Distributed under the GPLv3 software license, see the accompanying
// file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
/******************************************************************************
@@ -1266,7 +1266,7 @@ UniValue sendrawtransaction(const UniValue& params, bool fHelp, const CPubKey& m
if (fMissingInputs) {
throw JSONRPCError(RPC_TRANSACTION_ERROR, "Missing inputs");
}
throw JSONRPCError(RPC_TRANSACTION_ERROR, state.GetRejectReason());
throw JSONRPCError(RPC_TRANSACTION_ERROR, strprintf("Invalid state: %s", state.GetRejectReason()));
}
}
} else if (fHaveChain) {
@@ -1274,9 +1274,7 @@ UniValue sendrawtransaction(const UniValue& params, bool fHelp, const CPubKey& m
}
LogPrintf("%s: Relaying raw tx to mempool\n", __FUNCTION__);
RelayTransaction(tx);
}
else
{
} else {
NSPV_broadcast((char *)params[0].get_str().c_str());
}
return hashTx.GetHex();

View File

@@ -1,5 +1,5 @@
// Copyright (c) 2012-2014 The Bitcoin Core developers
// Copyright (c) 2016-2020 The Hush developers
// Copyright (c) 2016-2021 The Hush developers
// Distributed under the GPLv3 software license, see the accompanying
// file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
/******************************************************************************
@@ -21,7 +21,7 @@
#define HUSH_VERSION_H
// network protocol versioning
static const int PROTOCOL_VERSION = 1987420;
static const int PROTOCOL_VERSION = 1987421;
//! initial proto version, to be increased after version/verack negotiation
static const int INIT_PROTO_VERSION = 209;
//! In this version, 'getheaders' was introduced.

View File

@@ -1473,7 +1473,7 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn, bool fFromLoadWallet, CWalletD
}
//// debug print
LogPrintf("AddToWallet %s %s%s\n", wtxIn.GetHash().ToString(), (fInsertedNew ? "new" : ""), (fUpdated ? "update" : ""));
LogPrintf("AddToWallet %s at height %d %s%s\n", wtxIn.GetHash().ToString(), hush_blockheight(wtxIn.hashBlock), (fInsertedNew ? "new" : ""), (fUpdated ? "update" : ""));
// Write to disk
if (fInsertedNew || fUpdated)