Skip to content

Commit

Permalink
Merge branch 'auxpow'
Browse files Browse the repository at this point in the history
  • Loading branch information
domob1812 committed May 27, 2024
2 parents 43134a1 + cbf3c36 commit c712ae2
Show file tree
Hide file tree
Showing 121 changed files with 5,037 additions and 10,607 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ the pull request affects. Valid areas as:
- `net` or `p2p` for changes to the peer-to-peer network code
- `refactor` for structural changes that do not change behavior
- `rpc`, `rest` or `zmq` for changes to the RPC, REST or ZMQ APIs
- `script` for changes to the scripts and tools
- `contrib` or `cli` for changes to the scripts and tools
- `test`, `qa` or `ci` for changes to the unit tests, QA tests or CI code
- `util` or `lib` for changes to the utils or libraries
- `wallet` for changes to the wallet code
Expand Down
2 changes: 1 addition & 1 deletion ci/test/00_setup_env_arm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ export RUN_FUNCTIONAL_TESTS=false
export GOAL="install"
# -Wno-psabi is to disable ABI warnings: "note: parameter passing for argument of type ... changed in GCC 7.1"
# This could be removed once the ABI change warning does not show up by default
export BITCOIN_CONFIG="--enable-reduce-exports CXXFLAGS=-Wno-psabi"
export BITCOIN_CONFIG="--enable-reduce-exports CXXFLAGS='-Wno-psabi -Wno-error=maybe-uninitialized'"
47 changes: 1 addition & 46 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -244,12 +244,6 @@ AC_ARG_ENABLE([lcov-branch-coverage],
[use_lcov_branch=yes],
[use_lcov_branch=no])

AC_ARG_ENABLE([threadlocal],
[AS_HELP_STRING([--enable-threadlocal],
[enable features that depend on the c++ thread_local keyword (currently just thread names in debug logs). (default is to enable if there is platform support)])],
[use_thread_local=$enableval],
[use_thread_local=auto])

AC_ARG_ENABLE([zmq],
[AS_HELP_STRING([--disable-zmq],
[disable ZMQ notifications])],
Expand Down Expand Up @@ -1028,45 +1022,6 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([
[AC_MSG_RESULT([no])]
)

if test "$use_thread_local" = "yes" || test "$use_thread_local" = "auto"; then
TEMP_LDFLAGS="$LDFLAGS"
LDFLAGS="$TEMP_LDFLAGS $PTHREAD_CFLAGS"
AC_MSG_CHECKING([for thread_local support])
AC_LINK_IFELSE([AC_LANG_SOURCE([
#include <thread>
static thread_local int foo = 0;
static void run_thread() { foo++;}
int main(){
for(int i = 0; i < 10; i++) { std::thread(run_thread).detach();}
return foo;
}
])],
[
case $host in
*mingw*)
dnl mingw32's implementation of thread_local has also been shown to behave
dnl erroneously under concurrent usage; see:
dnl https://gist.github.com/jamesob/fe9a872051a88b2025b1aa37bfa98605
AC_MSG_RESULT([no])
;;
*freebsd*)
dnl FreeBSD's implementation of thread_local is also buggy (per
dnl https://groups.google.com/d/msg/bsdmailinglist/22ncTZAbDp4/Dii_pII5AwAJ)
AC_MSG_RESULT([no])
;;
*)
AC_DEFINE([HAVE_THREAD_LOCAL], [1], [Define if thread_local is supported.])
AC_MSG_RESULT([yes])
;;
esac
],
[
AC_MSG_RESULT([no])
]
)
LDFLAGS="$TEMP_LDFLAGS"
fi

dnl Check for different ways of gathering OS randomness
AC_MSG_CHECKING([for Linux getrandom function])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
Expand Down Expand Up @@ -1816,7 +1771,7 @@ CPPFLAGS="$CPPFLAGS_TEMP"
if test -n "$use_sanitizers"; then
export SECP_CFLAGS="$SECP_CFLAGS $SANITIZER_CFLAGS"
fi
ac_configure_args="${ac_configure_args} --disable-shared --with-pic --enable-benchmark=no --enable-module-recovery --disable-module-ecdh"
ac_configure_args="${ac_configure_args} --disable-shared --with-pic --with-ecmult-gen-kb=86 --enable-benchmark=no --enable-module-recovery --disable-module-ecdh"
AC_CONFIG_SUBDIRS([src/secp256k1])

AC_OUTPUT
Expand Down
44 changes: 22 additions & 22 deletions contrib/windeploy/win-codesign.cert
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
-----BEGIN CERTIFICATE-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rE+5Ex1ELXCPqNj8ZSn+S9IKZOag
zDFBA93RTVD438peXPz//xgusgnmSqSPS5tCp9KSvew81acu4v/+egg9EgSSx5Ho
9fkOX7JuygvN3r3UZqsddxdwf2dPvBDYlMdieF8qsR7H5DQPQoaTVrIhW4TFtJl/
UPjVlnDwu+yvMC70F+CaVgQs01uZ0VKuG3KNkkEj6+V/SM54NVVgcY/Q7llKIFA8
Qk8Ip8/83cVBptKW+OU+i2ZwoYskLbdfDE31X2knUIouNZgBBMhzc5WjJCEGXAPm
9xYZMn87cc+ejxCw6/WC4b6tDCziO8drq76Pl6LTNPOtRkEVqt12p8Uqi9PgznUB
bdHeoF5XHt1Ca2ySpSYuMz5djwIC2ws8kiMm44/AyTm6dwRcesiOTqnaRc+t
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIGsDCCBJigAwIBAgIQCK1AsmDSnEyfXs2pvZOu2TANBgkqhkiG9w0BAQwFADBi
Expand Down
2 changes: 1 addition & 1 deletion depends/packages/miniupnpc.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package=miniupnpc
$(package)_version=2.2.7
$(package)_download_path=https://miniupnp.tuxfamily.org/files/
$(package)_download_path=http://miniupnp.free.fr/files/
$(package)_file_name=$(package)-$($(package)_version).tar.gz
$(package)_sha256_hash=b0c3a27056840fd0ec9328a5a9bac3dc5e0ec6d2e8733349cf577b0aa1e70ac1
$(package)_patches=dont_leak_info.patch cmake_get_src_addr.patch fix_windows_snprintf.patch
Expand Down
2 changes: 1 addition & 1 deletion doc/bitcoin-conf.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ The `includeconf=<file>` option in the `bitcoin.conf` file can be used to includ

Operating System | Data Directory | Example Path
-- | -- | --
Windows | `%APPDATA%\Bitcoin\` | `C:\Users\username\AppData\Roaming\Bitcoin\bitcoin.conf`
Windows | `%LOCALAPPDATA%\Bitcoin\` | `C:\Users\username\AppData\Local\Bitcoin\bitcoin.conf`
Linux | `$HOME/.bitcoin/` | `/home/username/.bitcoin/bitcoin.conf`
macOS | `$HOME/Library/Application Support/Bitcoin/` | `/Users/username/Library/Application Support/Bitcoin/bitcoin.conf`

Expand Down
18 changes: 9 additions & 9 deletions doc/build-netbsd.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# NetBSD Build Guide

Updated for NetBSD [9.2](https://netbsd.org/releases/formal-9/NetBSD-9.2.html).
**Updated for NetBSD [10.0](https://netbsd.org/releases/formal-10/NetBSD-10.0.html)**

This guide describes how to build bitcoind, command-line utilities, and GUI on NetBSD.

Expand All @@ -12,23 +12,23 @@ Install the required dependencies the usual way you [install software on NetBSD]
The example commands below use `pkgin`.

```bash
pkgin install autoconf automake libtool pkg-config git gmake boost libevent
pkgin install autoconf automake libtool pkg-config git gmake boost-headers libevent

```

NetBSD currently ships with an older version of `gcc` than is needed to build. You should upgrade your `gcc` and then pass this new version to the configure script.

For example, grab `gcc9`:
For example, grab `gcc12`:
```
pkgin install gcc9
pkgin install gcc12
```

Then, when configuring, pass the following:
```bash
./configure
...
CC="/usr/pkg/gcc9/bin/gcc" \
CXX="/usr/pkg/gcc9/bin/g++" \
CC="/usr/pkg/gcc12/bin/gcc" \
CXX="/usr/pkg/gcc12/bin/g++" \
...
```

Expand Down Expand Up @@ -66,10 +66,10 @@ pkgin install db4

#### GUI Dependencies

Bitcoin Core includes a GUI built with the cross-platform Qt Framework. To compile the GUI, we need to install `qt5`.
Bitcoin Core includes a GUI built with the cross-platform Qt Framework. To compile the GUI, Qt 5 is required.

```bash
pkgin install qt5
pkgin install qt5-qtbase qt5-qttools
```

The GUI can encode addresses in a QR Code. To build in QR support for the GUI, install `qrencode`.
Expand All @@ -84,7 +84,7 @@ There is an included test suite that is useful for testing code changes when dev
To run the test suite (recommended), you will need to have Python 3 installed:

```bash
pkgin install python37
pkgin install python39
```

### Building Bitcoin Core
Expand Down
2 changes: 1 addition & 1 deletion doc/files.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Platform | Data directory path
---------|--------------------
Linux | `$HOME/.bitcoin/`
macOS | `$HOME/Library/Application Support/Bitcoin/`
Windows | `%APPDATA%\Bitcoin\` <sup>[\[1\]](#note1)</sup>
Windows | `%LOCALAPPDATA%\Bitcoin\` <sup>[\[1\]](#note1)</sup>

2. A custom data directory path can be specified with the `-datadir` option.

Expand Down
2 changes: 1 addition & 1 deletion doc/managing-wallets.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ By default, wallets are created in the `wallets` folder of the data directory, w
| Operating System | Default wallet directory |
| -----------------|:------------------------------------------------------------|
| Linux | `/home/<user>/.bitcoin/wallets` |
| Windows | `C:\Users\<user>\AppData\Roaming\Bitcoin\wallets` |
| Windows | `C:\Users\<user>\AppData\Local\Bitcoin\wallets` |
| macOS | `/Users/<user>/Library/Application Support/Bitcoin/wallets` |

### 1.2 Encrypting the Wallet
Expand Down
9 changes: 7 additions & 2 deletions doc/policy/packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,13 @@ The following rules are enforced for all packages:
heavily connected, i.e. some transaction in the package is the ancestor or descendant of all
the other transactions.

The following rules are only enforced for packages to be submitted to the mempool (not enforced for
test accepts):
* [CPFP Carve Out](./mempool-limits.md#CPFP-Carve-Out) is disabled in packaged contexts. (#21800)

- *Rationale*: This carve out cannot be accurately applied when there are multiple transactions'
ancestors and descendants being considered at the same time.

The following rules are only enforced for packages to be submitted to the mempool (not
enforced for test accepts):

* Packages must be child-with-unconfirmed-parents packages. This also means packages must contain at
least 2 transactions. (#22674)
Expand Down
7 changes: 7 additions & 0 deletions doc/release-notes/release-notes-27064.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Files
-----

The default data directory on Windows has been moved from `C:\Users\Username\AppData\Roaming\Bitcoin`
to `C:\Users\Username\AppData\Local\Bitcoin`. Bitcoin Core will check the existence
of the old directory first and continue to use that directory for backwards
compatibility if it is present.
2 changes: 2 additions & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ BITCOIN_CORE_H = \
wallet/feebumper.h \
wallet/fees.h \
wallet/load.h \
wallet/migrate.h \
wallet/receive.h \
wallet/rpc/util.h \
wallet/rpc/wallet.h \
Expand Down Expand Up @@ -524,6 +525,7 @@ libbitcoin_wallet_a_SOURCES = \
wallet/fees.cpp \
wallet/interfaces.cpp \
wallet/load.cpp \
wallet/migrate.cpp \
wallet/receive.cpp \
wallet/rpc/addresses.cpp \
wallet/rpc/auxpow.cpp \
Expand Down
3 changes: 2 additions & 1 deletion src/Makefile.test.include
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ FUZZ_WALLET_SRC = \
wallet/test/fuzz/coincontrol.cpp \
wallet/test/fuzz/coinselection.cpp \
wallet/test/fuzz/fees.cpp \
wallet/test/fuzz/parse_iso8601.cpp
wallet/test/fuzz/parse_iso8601.cpp \
wallet/test/fuzz/wallet_bdb_parser.cpp

if USE_SQLITE
FUZZ_WALLET_SRC += \
Expand Down
6 changes: 3 additions & 3 deletions src/bitcoin-cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ class AddrinfoRequestHandler : public BaseRequestHandler
total += counts.at(i);
}
addresses.pushKV("total", total);
result.pushKV("addresses_known", addresses);
result.pushKV("addresses_known", std::move(addresses));
return JSONRPCReplyObj(std::move(result), NullUniValue, /*id=*/1, JSONRPCVersion::V1_LEGACY);
}
};
Expand Down Expand Up @@ -348,7 +348,7 @@ class GetinfoRequestHandler: public BaseRequestHandler
connections.pushKV("in", batch[ID_NETWORKINFO]["result"]["connections_in"]);
connections.pushKV("out", batch[ID_NETWORKINFO]["result"]["connections_out"]);
connections.pushKV("total", batch[ID_NETWORKINFO]["result"]["connections"]);
result.pushKV("connections", connections);
result.pushKV("connections", std::move(connections));

result.pushKV("networks", batch[ID_NETWORKINFO]["result"]["networks"]);
result.pushKV("difficulty", batch[ID_BLOCKCHAININFO]["result"]["difficulty"]);
Expand Down Expand Up @@ -940,7 +940,7 @@ static void GetWalletBalances(UniValue& result)
const UniValue& balance = getbalances.find_value("result")["mine"]["trusted"];
balances.pushKV(wallet_name, balance);
}
result.pushKV("balances", balances);
result.pushKV("balances", std::move(balances));
}

/**
Expand Down
1 change: 1 addition & 0 deletions src/bitcoin-wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ static void SetupWalletToolArgs(ArgsManager& argsman)
argsman.AddArg("-legacy", "Create legacy wallet. Only for 'create'", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
argsman.AddArg("-format=<format>", "The format of the wallet file to create. Either \"bdb\" or \"sqlite\". Only used with 'createfromdump'", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
argsman.AddArg("-printtoconsole", "Send trace/debug info to console (default: 1 when no -debug is true, 0 otherwise).", ArgsManager::ALLOW_ANY, OptionsCategory::DEBUG_TEST);
argsman.AddArg("-withinternalbdb", "Use the internal Berkeley DB parser when dumping a Berkeley DB wallet file (default: false)", ArgsManager::ALLOW_ANY, OptionsCategory::DEBUG_TEST);

argsman.AddCommand("info", "Get wallet info");
argsman.AddCommand("create", "Create new wallet file");
Expand Down
11 changes: 9 additions & 2 deletions src/common/args.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -696,12 +696,19 @@ bool HasTestOption(const ArgsManager& args, const std::string& test_option)

fs::path GetDefaultDataDir()
{
// Windows: C:\Users\Username\AppData\Roaming\Namecoin
// Windows:
// old: C:\Users\Username\AppData\Roaming\Namecoin
// new: C:\Users\Username\AppData\Local\Namecoin
// macOS: ~/Library/Application Support/Namecoin
// Unix-like: ~/.namecoin
#ifdef WIN32
// Windows
return GetSpecialFolderPath(CSIDL_APPDATA) / "Namecoin";
// Check for existence of datadir in old location and keep it there
fs::path legacy_path = GetSpecialFolderPath(CSIDL_APPDATA) / "Namecoin";
if (fs::exists(legacy_path)) return legacy_path;

// Otherwise, fresh installs can start in the new, "proper" location
return GetSpecialFolderPath(CSIDL_LOCAL_APPDATA) / "Namecoin";
#else
fs::path pathRet;
char* pszHome = getenv("HOME");
Expand Down
18 changes: 9 additions & 9 deletions src/core_write.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,14 +216,14 @@ void TxToUniv(const CTransaction& tx, const uint256& block_hash, UniValue& entry
UniValue o(UniValue::VOBJ);
o.pushKV("asm", ScriptToAsmStr(txin.scriptSig, true));
o.pushKV("hex", HexStr(txin.scriptSig));
in.pushKV("scriptSig", o);
in.pushKV("scriptSig", std::move(o));
}
if (!tx.vin[i].scriptWitness.IsNull()) {
UniValue txinwitness(UniValue::VARR);
for (const auto& item : tx.vin[i].scriptWitness.stack) {
txinwitness.push_back(HexStr(item));
}
in.pushKV("txinwitness", txinwitness);
in.pushKV("txinwitness", std::move(txinwitness));
}
if (have_undo) {
const Coin& prev_coin = txundo->vprevout[i];
Expand All @@ -239,14 +239,14 @@ void TxToUniv(const CTransaction& tx, const uint256& block_hash, UniValue& entry
p.pushKV("generated", bool(prev_coin.fCoinBase));
p.pushKV("height", uint64_t(prev_coin.nHeight));
p.pushKV("value", ValueFromAmount(prev_txout.nValue));
p.pushKV("scriptPubKey", o_script_pub_key);
in.pushKV("prevout", p);
p.pushKV("scriptPubKey", std::move(o_script_pub_key));
in.pushKV("prevout", std::move(p));
}
}
in.pushKV("sequence", (int64_t)txin.nSequence);
vin.push_back(in);
vin.push_back(std::move(in));
}
entry.pushKV("vin", vin);
entry.pushKV("vin", std::move(vin));

UniValue vout(UniValue::VARR);
for (unsigned int i = 0; i < tx.vout.size(); i++) {
Expand All @@ -259,14 +259,14 @@ void TxToUniv(const CTransaction& tx, const uint256& block_hash, UniValue& entry

UniValue o(UniValue::VOBJ);
ScriptToUniv(txout.scriptPubKey, /*out=*/o, /*include_hex=*/true, /*include_address=*/true);
out.pushKV("scriptPubKey", o);
vout.push_back(out);
out.pushKV("scriptPubKey", std::move(o));
vout.push_back(std::move(out));

if (have_undo) {
amt_total_out += txout.nValue;
}
}
entry.pushKV("vout", vout);
entry.pushKV("vout", std::move(vout));

if (have_undo) {
const CAmount fee = amt_total_in - amt_total_out;
Expand Down
Loading

0 comments on commit c712ae2

Please sign in to comment.