From d2dfac4646fcf1b75f8560ce96c78542c0183884 Mon Sep 17 00:00:00 2001 From: rustaceanrob Date: Sat, 16 May 2026 15:33:30 +0100 Subject: [PATCH] Remove `bitcoin-tx` executable This is a CLI for manually manipulating transactions. Nice to have but seems outside of the scope for maintenance here. --- .github/ci-windows.py | 1 - CMakeLists.txt | 3 - cmake/module/Maintenance.cmake | 3 +- contrib/completions/bash/bitcoin-tx.bash | 57 -- contrib/completions/bash/bitcoin.bash | 4 - contrib/completions/fish/bitcoin-tx.fish | 65 -- contrib/devtools/gen-manpages.py | 1 - doc/files.md | 1 - doc/man/bitcoin-tx.1 | 5 - src/CMakeLists.txt | 15 - src/bitcoin-tx-res.rc | 33 - src/bitcoin-tx.cpp | 885 ----------------------- src/bitcoin.cpp | 2 - test/CMakeLists.txt | 1 - test/config.ini.in | 1 - 15 files changed, 1 insertion(+), 1076 deletions(-) delete mode 100644 contrib/completions/bash/bitcoin-tx.bash delete mode 100644 contrib/completions/fish/bitcoin-tx.fish delete mode 100644 doc/man/bitcoin-tx.1 delete mode 100644 src/bitcoin-tx-res.rc delete mode 100644 src/bitcoin-tx.cpp diff --git a/.github/ci-windows.py b/.github/ci-windows.py index f4931fee3065..d2ed22fbe234 100755 --- a/.github/ci-windows.py +++ b/.github/ci-windows.py @@ -168,7 +168,6 @@ def run_tests(ci_type): "BITCOIND": "bitcoind.exe", "BITCOINCLI": "bitcoin-cli.exe", "BITCOIN_BENCH": "bench_bitcoin.exe", - "BITCOINTX": "bitcoin-tx.exe", "BITCOINUTIL": "bitcoin-util.exe", "BITCOINCHAINSTATE": "bitcoin-chainstate.exe", } diff --git a/CMakeLists.txt b/CMakeLists.txt index 1315eade7aec..280a61f12acb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -108,7 +108,6 @@ option(BUILD_DAEMON "Build bitcoind executable." ON) option(BUILD_CLI "Build bitcoin-cli executable." ON) option(BUILD_TESTS "Build test_bitcoin and other unit test executables." ON) -option(BUILD_TX "Build bitcoin-tx executable." ${BUILD_TESTS}) option(BUILD_UTIL_CHAINSTATE "Build experimental bitcoin-chainstate executable." OFF) option(BUILD_KERNEL_LIB "Build experimental bitcoinkernel library." ${BUILD_UTIL_CHAINSTATE}) @@ -183,7 +182,6 @@ if(BUILD_FOR_FUZZING) set(BUILD_BITCOIN_BIN OFF) set(BUILD_DAEMON OFF) set(BUILD_CLI OFF) - set(BUILD_TX OFF) set(BUILD_UTIL_CHAINSTATE OFF) set(BUILD_KERNEL_LIB OFF) set(BUILD_KERNEL_TEST OFF) @@ -590,7 +588,6 @@ message(" bitcoin ............................. ${BUILD_BITCOIN_BIN}") message(" bitcoind ............................ ${BUILD_DAEMON}") message(" bitcoin-node (multiprocess) ......... ${BUILD_DAEMON}") message(" bitcoin-cli ......................... ${BUILD_CLI}") -message(" bitcoin-tx .......................... ${BUILD_TX}") message(" bitcoin-chainstate (experimental) ... ${BUILD_UTIL_CHAINSTATE}") message(" libbitcoinkernel (experimental) ..... ${BUILD_KERNEL_LIB}") message(" kernel-test (experimental) .......... ${BUILD_KERNEL_TEST}") diff --git a/cmake/module/Maintenance.cmake b/cmake/module/Maintenance.cmake index ba0514005094..f86970364ec6 100644 --- a/cmake/module/Maintenance.cmake +++ b/cmake/module/Maintenance.cmake @@ -19,7 +19,7 @@ function(setup_split_debug_script) endfunction() function(add_windows_deploy_target) - if(MINGW AND TARGET bitcoin AND TARGET bitcoind AND TARGET bitcoin-cli AND TARGET bitcoin-tx AND TARGET test_bitcoin) + if(MINGW AND TARGET bitcoin AND TARGET bitcoind AND TARGET bitcoin-cli AND TARGET test_bitcoin) find_program(MAKENSIS_EXECUTABLE makensis) if(NOT MAKENSIS_EXECUTABLE) add_custom_target(deploy @@ -38,7 +38,6 @@ function(add_windows_deploy_target) COMMAND ${CMAKE_STRIP} $ -o ${PROJECT_BINARY_DIR}/release/$ COMMAND ${CMAKE_STRIP} $ -o ${PROJECT_BINARY_DIR}/release/$ COMMAND ${CMAKE_STRIP} $ -o ${PROJECT_BINARY_DIR}/release/$ - COMMAND ${CMAKE_STRIP} $ -o ${PROJECT_BINARY_DIR}/release/$ COMMAND ${CMAKE_STRIP} $ -o ${PROJECT_BINARY_DIR}/release/$ COMMAND ${MAKENSIS_EXECUTABLE} -V2 ${PROJECT_BINARY_DIR}/bitcoin-win64-setup.nsi VERBATIM diff --git a/contrib/completions/bash/bitcoin-tx.bash b/contrib/completions/bash/bitcoin-tx.bash deleted file mode 100644 index 28359bfdf04a..000000000000 --- a/contrib/completions/bash/bitcoin-tx.bash +++ /dev/null @@ -1,57 +0,0 @@ -# bash programmable completion for bitcoin-tx(1) -# Copyright (c) 2016-present The Bitcoin Core developers -# Distributed under the MIT software license, see the accompanying -# file COPYING or http://www.opensource.org/licenses/mit-license.php. - -_bitcoin_tx() { - local cur prev words=() cword - local bitcoin_tx - - # save and use original argument to invoke bitcoin-tx for -help - # it might not be in $PATH - bitcoin_tx="$1" - - COMPREPLY=() - _get_comp_words_by_ref -n =: cur prev words cword - - case "$cur" in - load=*:*) - cur="${cur#load=*:}" - _filedir - return 0 - ;; - *=*) # prevent attempts to complete other arguments - return 0 - ;; - esac - - if [[ "$cword" == 1 || ( "$prev" != "-create" && "$prev" == -* ) ]]; then - # only options (or an uncompletable hex-string) allowed - # parse bitcoin-tx -help for options - local helpopts - helpopts=$($bitcoin_tx -help | sed -e '/^ -/ p' -e d ) - COMPREPLY=( $( compgen -W "$helpopts" -- "$cur" ) ) - else - # only commands are allowed - # parse -help for commands - local helpcmds - helpcmds=$($bitcoin_tx -help | sed -e '1,/Commands:/d' -e 's/=.*/=/' -e '/^ [a-z]/ p' -e d ) - COMPREPLY=( $( compgen -W "$helpcmds" -- "$cur" ) ) - fi - - # Prevent space if an argument is desired - if [[ $COMPREPLY == *= ]]; then - compopt -o nospace - fi - - return 0 -} && -complete -F _bitcoin_tx bitcoin-tx - -# Local variables: -# mode: shell-script -# sh-basic-offset: 4 -# sh-indent-comment: t -# indent-tabs-mode: nil -# End: -# ex: ts=4 sw=4 et filetype=sh diff --git a/contrib/completions/bash/bitcoin.bash b/contrib/completions/bash/bitcoin.bash index a2ecae03e5ec..65e6c9382c2b 100644 --- a/contrib/completions/bash/bitcoin.bash +++ b/contrib/completions/bash/bitcoin.bash @@ -57,10 +57,6 @@ _bitcoin() { _bitcoin_wrap bitcoin-cli "$offset" return 0 ;; - tx) - _bitcoin_wrap bitcoin-tx "$offset" - return 0 - ;; esac case "$cur" in diff --git a/contrib/completions/fish/bitcoin-tx.fish b/contrib/completions/fish/bitcoin-tx.fish deleted file mode 100644 index 0ff262b948e4..000000000000 --- a/contrib/completions/fish/bitcoin-tx.fish +++ /dev/null @@ -1,65 +0,0 @@ -# Disable files from being included in completions by default -complete --command bitcoin-tx --no-files - -# Modified version of __fish_seen_subcommand_from -# Uses regex to detect cmd= syntax -function __fish_bitcoin_seen_cmd - set -l cmd (commandline -oc) - set -e cmd[1] - for i in $cmd - for j in $argv - if string match --quiet --regex -- "^$j.*" $i - return 0 - end - end - end - return 1 -end - -# Extract options -function __fish_bitcoin_tx_get_options - set --local cmd (commandline -oc)[1] - if string match --quiet --regex -- '^-help$|-\?$' $cmd - return - end - - for option in ($cmd -help 2>&1 | string match -r '^ -.*' | string replace -r ' -' '-' | string replace -r '=.*' '=') - echo $option - end -end - -# Extract commands -function __fish_bitcoin_tx_get_commands - argparse 'commandsonly' -- $argv - set --local cmd (commandline -oc)[1] - set --local commands - - if set -q _flag_commandsonly - set --append commands ($cmd -help | sed -e '1,/Commands:/d' -e 's/=/=\t/' -e 's/(=/=/' -e '/^ [a-z]/ p' -e d | string replace -r '\ \ ' '' | string replace -r '=.*' '') - else - set --append commands ($cmd -help | sed -e '1,/Commands:/d' -e 's/=/=\t/' -e 's/(=/=/' -e '/^ [a-z]/ p' -e d | string replace -r '\ \ ' '') - end - - for command in $commands - echo $command - end -end - -# Add options -complete \ - --command bitcoin-tx \ - --condition "not __fish_bitcoin_seen_cmd (__fish_bitcoin_tx_get_commands --commandsonly)" \ - --arguments "(__fish_bitcoin_tx_get_options)" \ - --no-files - -# Add commands -complete \ - --command bitcoin-tx \ - --arguments "(__fish_bitcoin_tx_get_commands)" \ - --no-files - -# Add file completions for load and set commands -complete \ - --command bitcoin-tx \ - --condition 'string match --regex -- "(load|set)=" (commandline -pt)' \ - --force-files diff --git a/contrib/devtools/gen-manpages.py b/contrib/devtools/gen-manpages.py index 81c835e214a7..3b9853881307 100755 --- a/contrib/devtools/gen-manpages.py +++ b/contrib/devtools/gen-manpages.py @@ -13,7 +13,6 @@ 'bin/bitcoin', 'bin/bitcoind', 'bin/bitcoin-cli', -'bin/bitcoin-tx', ] parser = argparse.ArgumentParser( diff --git a/doc/files.md b/doc/files.md index 37812d07c1b5..81fe0f94ed9c 100644 --- a/doc/files.md +++ b/doc/files.md @@ -90,7 +90,6 @@ This table describes the files installed by Bitcoin Core across different platfo | bitcoin.conf | [Generated](../contrib/devtools/gen-bitcoin-conf.sh) configuration file | | bin/bitcoin | Command-line tool for interacting with Bitcoin. Calls other binaries below. | | bin/bitcoin-cli | Tool for making node RPC calls. | -| bin/bitcoin-tx | Tool for creating and modifying transactions | | bin/bitcoind | Bitcoin node daemon | | *lib/libbitcoinkernel.so* | Shared library containing core consensus and validation code | | *lib/pkgconfig/libbitcoinkernel.pc* | Pkg-config metadata for linking to `libbitcoinkernel` | diff --git a/doc/man/bitcoin-tx.1 b/doc/man/bitcoin-tx.1 deleted file mode 100644 index 776bb462342a..000000000000 --- a/doc/man/bitcoin-tx.1 +++ /dev/null @@ -1,5 +0,0 @@ -.TH BITCOIN-TX "1" -.SH NAME -bitcoin-tx \- manual page for bitcoin-tx - -This is a placeholder file. Please follow the instructions in \fIcontrib/devtools/README.md\fR to generate the manual pages after a release. diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b983c8378d6b..7bfa5a89bcfa 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -302,21 +302,6 @@ if(BUILD_CLI) endif() -if(BUILD_TX) - add_executable(bitcoin-tx bitcoin-tx.cpp) - add_windows_resources(bitcoin-tx bitcoin-tx-res.rc) - add_windows_application_manifest(bitcoin-tx) - target_link_libraries(bitcoin-tx - core_interface - bitcoin_common - bitcoin_util - univalue - ) - install_binary_component(bitcoin-tx HAS_MANPAGE) -endif() - - - if(BUILD_KERNEL_LIB) add_subdirectory(kernel) if (BUILD_KERNEL_TEST) diff --git a/src/bitcoin-tx-res.rc b/src/bitcoin-tx-res.rc deleted file mode 100644 index 77ffb6bdfa26..000000000000 --- a/src/bitcoin-tx-res.rc +++ /dev/null @@ -1,33 +0,0 @@ -#include // needed for VERSIONINFO -#include "clientversion.h" // holds the needed client version information - -#define VER_PRODUCTVERSION CLIENT_VERSION_MAJOR,CLIENT_VERSION_MINOR,CLIENT_VERSION_BUILD -#define VER_FILEVERSION VER_PRODUCTVERSION - -VS_VERSION_INFO VERSIONINFO -FILEVERSION VER_FILEVERSION -PRODUCTVERSION VER_PRODUCTVERSION -FILEOS VOS_NT_WINDOWS32 -FILETYPE VFT_APP -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904E4" // U.S. English - multilingual (hex) - BEGIN - VALUE "CompanyName", CLIENT_NAME " project" - VALUE "FileDescription", "bitcoin-tx (CLI Bitcoin transaction editor utility)" - VALUE "FileVersion", CLIENT_VERSION_STRING - VALUE "InternalName", "bitcoin-tx" - VALUE "LegalCopyright", COPYRIGHT_STR - VALUE "LegalTrademarks1", "Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php." - VALUE "OriginalFilename", "bitcoin-tx.exe" - VALUE "ProductName", "bitcoin-tx" - VALUE "ProductVersion", CLIENT_VERSION_STRING - END - END - - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x0, 1252 // language neutral - multilingual (decimal) - END -END diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp deleted file mode 100644 index f21db40f3c3c..000000000000 --- a/src/bitcoin-tx.cpp +++ /dev/null @@ -1,885 +0,0 @@ -// Copyright (c) 2009-present The Bitcoin Core developers -// Distributed under the MIT software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -#include // IWYU pragma: keep - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include