Compare commits
21 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
79040450d2 | ||
|
|
eafbe5ac94 | ||
|
|
b20544c499 | ||
|
|
a3ca53a380 | ||
|
|
e27ef57e41 | ||
|
|
54a10bbc2a | ||
|
|
5eb70c65d2 | ||
|
|
5b37dcc469 | ||
|
|
89940a5e2f | ||
|
|
6620061934 | ||
|
|
492a610637 | ||
|
|
8bd7bc2ff8 | ||
|
|
d59e9d6451 | ||
|
|
4afc3365c4 | ||
|
|
372c7b44db | ||
|
|
c8cd9a5f3b | ||
|
|
e3ab6b09cc | ||
|
|
3a6a2fcb32 | ||
|
|
19715917b5 | ||
|
|
0644af1003 | ||
| 23ef5f28ff |
@@ -21,7 +21,7 @@
|
||||
#define CLIENT_VERSION_MINOR 5
|
||||
|
||||
/* Build revision */
|
||||
#define CLIENT_VERSION_REVISION 2
|
||||
#define CLIENT_VERSION_REVISION 0
|
||||
|
||||
/* Copyright holder(s) before %s replacement */
|
||||
#define COPYRIGHT_HOLDERS "The %s developers"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
AC_PREREQ([2.69])
|
||||
define(_CLIENT_VERSION_MAJOR, 1)
|
||||
define(_CLIENT_VERSION_MINOR, 4)
|
||||
define(_CLIENT_VERSION_REVISION, 2)
|
||||
define(_CLIENT_VERSION_MINOR, 5)
|
||||
define(_CLIENT_VERSION_REVISION, 0)
|
||||
define(_CLIENT_VERSION_BUILD, 0)
|
||||
define(_CLIENT_VERSION_RC, 0)
|
||||
define(_CLIENT_VERSION_IS_RELEASE, true)
|
||||
|
||||
@@ -12,7 +12,7 @@ if [ -z "${1}" ]; then
|
||||
echo "Usage: $0 <base-dir> [<extra-bdb-configure-flag> ...]"
|
||||
echo
|
||||
echo "Must specify a single argument: the directory in which db4 will be built."
|
||||
echo "This is probably \`pwd\` if you're at the root of the palladium repository."
|
||||
echo "This is probably \`pwd\` if you're at the root of the repository."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -31,7 +31,6 @@ check_exists() {
|
||||
|
||||
sha256_check() {
|
||||
# Args: <sha256_hash> <filename>
|
||||
#
|
||||
if check_exists sha256sum; then
|
||||
echo "${1} ${2}" | sha256sum -c
|
||||
elif check_exists sha256; then
|
||||
@@ -47,14 +46,11 @@ sha256_check() {
|
||||
|
||||
http_get() {
|
||||
# Args: <url> <filename> <sha256_hash>
|
||||
#
|
||||
# It's acceptable that we don't require SSL here because we manually verify
|
||||
# content hashes below.
|
||||
#
|
||||
if [ -f "${2}" ]; then
|
||||
echo "File ${2} already exists; not downloading again"
|
||||
elif check_exists curl; then
|
||||
curl --insecure --retry 5 "${1}" -o "${2}"
|
||||
# Added -L to follow redirects
|
||||
curl -L --insecure --retry 5 "${1}" -o "${2}"
|
||||
else
|
||||
wget --no-check-certificate "${1}" -O "${2}"
|
||||
fi
|
||||
@@ -62,30 +58,39 @@ http_get() {
|
||||
sha256_check "${3}" "${2}"
|
||||
}
|
||||
|
||||
# Helper to download without hash check (for volatile config files)
|
||||
http_get_no_hash() {
|
||||
# Args: <url> <filename>
|
||||
echo "Downloading ${2}..."
|
||||
if check_exists curl; then
|
||||
curl -L --insecure --retry 5 "${1}" -o "${2}"
|
||||
else
|
||||
wget --no-check-certificate "${1}" -O "${2}"
|
||||
fi
|
||||
}
|
||||
|
||||
mkdir -p "${BDB_PREFIX}"
|
||||
http_get "${BDB_URL}" "${BDB_VERSION}.tar.gz" "${BDB_HASH}"
|
||||
tar -xzvf ${BDB_VERSION}.tar.gz -C "$BDB_PREFIX"
|
||||
cd "${BDB_PREFIX}/${BDB_VERSION}/"
|
||||
|
||||
# Apply a patch necessary when building with clang and c++11 (see https://community.oracle.com/thread/3952592)
|
||||
# Apply a patch necessary when building with clang and c++11
|
||||
CLANG_CXX11_PATCH_URL='https://gist.githubusercontent.com/LnL7/5153b251fd525fe15de69b67e63a6075/raw/7778e9364679093a32dec2908656738e16b6bdcb/clang.patch'
|
||||
CLANG_CXX11_PATCH_HASH='7a9a47b03fd5fb93a16ef42235fa9512db9b0829cfc3bdf90edd3ec1f44d637c'
|
||||
http_get "${CLANG_CXX11_PATCH_URL}" clang.patch "${CLANG_CXX11_PATCH_HASH}"
|
||||
patch -p2 < clang.patch
|
||||
|
||||
# The packaged config.guess and config.sub are ancient (2009) and can cause build issues.
|
||||
# Replace them with modern versions.
|
||||
# See https://github.com/palladium/palladium/issues/16064
|
||||
CONFIG_GUESS_URL='https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=55eaf3e779455c4e5cc9f82efb5278be8f8f900b'
|
||||
CONFIG_GUESS_HASH='2d1ff7bca773d2ec3c6217118129220fa72d8adda67c7d2bf79994b3129232c1'
|
||||
CONFIG_SUB_URL='https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=55eaf3e779455c4e5cc9f82efb5278be8f8f900b'
|
||||
CONFIG_SUB_HASH='3a4befde9bcdf0fdb2763fc1bfa74e8696df94e1ad7aac8042d133c8ff1d2e32'
|
||||
# Replace them with modern versions from GNU Savannah (HEAD).
|
||||
# FIXED: Removed hash check because these files change frequently.
|
||||
CONFIG_GUESS_URL='https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD'
|
||||
CONFIG_SUB_URL='https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD'
|
||||
|
||||
rm -f "dist/config.guess"
|
||||
rm -f "dist/config.sub"
|
||||
|
||||
http_get "${CONFIG_GUESS_URL}" dist/config.guess "${CONFIG_GUESS_HASH}"
|
||||
http_get "${CONFIG_SUB_URL}" dist/config.sub "${CONFIG_SUB_HASH}"
|
||||
http_get_no_hash "${CONFIG_GUESS_URL}" dist/config.guess
|
||||
http_get_no_hash "${CONFIG_SUB_URL}" dist/config.sub
|
||||
|
||||
cd build_unix/
|
||||
|
||||
@@ -99,7 +104,7 @@ echo
|
||||
echo "db4 build complete."
|
||||
echo
|
||||
# shellcheck disable=SC2016
|
||||
echo 'When compiling palladiumd, run `./configure` in the following way:'
|
||||
echo 'When compiling, run `./configure` in the following way:'
|
||||
echo
|
||||
echo " export BDB_PREFIX='${BDB_PREFIX}'"
|
||||
# shellcheck disable=SC2016
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.13.
|
||||
.TH PALLADIUM-CLI "1" "April 2024" "palladium-cli v1.4.2" "User Commands"
|
||||
.TH PALLADIUM-CLI "1" "April 2024" "palladium-cli v1.5.0" "User Commands"
|
||||
.SH NAME
|
||||
palladium-cli \- manual page for palladium-cli v1.4.2
|
||||
palladium-cli \\- manual page for palladium-cli v1.5.0
|
||||
.SH SYNOPSIS
|
||||
.B palladium-cli
|
||||
[\fI\,options\/\fR] \fI\,<command> \/\fR[\fI\,params\/\fR] \fI\,Send command to Palladium Core\/\fR
|
||||
@@ -15,7 +15,7 @@ palladium-cli \- manual page for palladium-cli v1.4.2
|
||||
.B palladium-cli
|
||||
[\fI\,options\/\fR] \fI\,help <command> Get help for a command\/\fR
|
||||
.SH DESCRIPTION
|
||||
Palladium Core RPC client version v1.4.2
|
||||
Palladium Core RPC client version v1.5.0
|
||||
.SH OPTIONS
|
||||
.HP
|
||||
\-?
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.13.
|
||||
.TH PALLADIUM-QT "1" "April 2024" "palladium-qt v1.4.2" "User Commands"
|
||||
.TH PALLADIUM-QT "1" "April 2024" "palladium-qt v1.5.0" "User Commands"
|
||||
.SH NAME
|
||||
palladium-qt \- manual page for palladium-qt v1.4.2
|
||||
palladium-qt \\- manual page for palladium-qt v1.5.0
|
||||
.SH SYNOPSIS
|
||||
.B palladium-qt
|
||||
[\fI\,command-line options\/\fR]
|
||||
.SH DESCRIPTION
|
||||
Palladium Core version v1.4.2
|
||||
Palladium Core version v1.5.0
|
||||
.SH OPTIONS
|
||||
.HP
|
||||
\-?
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.13.
|
||||
.TH PALLADIUM-TX "1" "April 2024" "palladium-tx v1.4.2" "User Commands"
|
||||
.TH PALLADIUM-TX "1" "April 2024" "palladium-tx v1.5.0" "User Commands"
|
||||
.SH NAME
|
||||
palladium-tx \- manual page for palladium-tx v1.4.2
|
||||
palladium-tx \\- manual page for palladium-tx v1.5.0
|
||||
.SH SYNOPSIS
|
||||
.B palladium-tx
|
||||
[\fI\,options\/\fR] \fI\,<hex-tx> \/\fR[\fI\,commands\/\fR] \fI\,Update hex-encoded palladium transaction\/\fR
|
||||
@@ -9,7 +9,7 @@ palladium-tx \- manual page for palladium-tx v1.4.2
|
||||
.B palladium-tx
|
||||
[\fI\,options\/\fR] \fI\,-create \/\fR[\fI\,commands\/\fR] \fI\,Create hex-encoded palladium transaction\/\fR
|
||||
.SH DESCRIPTION
|
||||
Palladium Core palladium\-tx utility version v1.4.2
|
||||
Palladium Core palladium\-tx utility version v1.5.0
|
||||
.SH OPTIONS
|
||||
.HP
|
||||
\-?
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.13.
|
||||
.TH PALLADIUM-WALLET "1" "April 2024" "palladium-wallet v1.4.2" "User Commands"
|
||||
.TH PALLADIUM-WALLET "1" "April 2024" "palladium-wallet v1.5.0" "User Commands"
|
||||
.SH NAME
|
||||
palladium-wallet \- manual page for palladium-wallet v1.4.2
|
||||
palladium-wallet \\- manual page for palladium-wallet v1.5.0
|
||||
.SH DESCRIPTION
|
||||
Palladium Core palladium\-wallet version v1.4.2
|
||||
Palladium Core palladium\-wallet version v1.5.0
|
||||
.PP
|
||||
palladium\-wallet is an offline tool for creating and interacting with Palladium Core wallet files.
|
||||
By default palladium\-wallet will act on wallets in the default mainnet wallet directory in the datadir.
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.13.
|
||||
.TH PALLADIUMD "1" "April 2024" "palladiumd v1.4.2" "User Commands"
|
||||
.TH PALLADIUMD "1" "April 2024" "palladiumd v1.5.0" "User Commands"
|
||||
.SH NAME
|
||||
palladiumd \- manual page for palladiumd v1.4.2
|
||||
palladiumd \\- manual page for palladiumd v1.5.0
|
||||
.SH SYNOPSIS
|
||||
.B palladiumd
|
||||
[\fI\,options\/\fR] \fI\,Start Palladium Core\/\fR
|
||||
.SH DESCRIPTION
|
||||
Palladium Core version v1.4.2
|
||||
Palladium Core version v1.5.0
|
||||
.SH OPTIONS
|
||||
.HP
|
||||
\-?
|
||||
|
||||
@@ -6,6 +6,26 @@
|
||||
- **Docker**: Installed and running ([installation guide](https://docs.docker.com/get-docker/))
|
||||
- **Disk Space**: At least 15 GB free
|
||||
|
||||
## Unified Build Menu (Recommended)
|
||||
|
||||
The easiest way to build binaries for one or multiple platforms is using the interactive menu script.
|
||||
|
||||
### Usage
|
||||
|
||||
```bash
|
||||
cd docker-build
|
||||
./build-menu.sh
|
||||
```
|
||||
|
||||
You will be prompted to select the target platforms:
|
||||
- `1`: Linux x86_64
|
||||
- `2`: Linux aarch64
|
||||
- `3`: Linux ARMv7l
|
||||
- `4`: Windows x86_64
|
||||
- `5`: Build ALL targets
|
||||
|
||||
You can also select multiple targets by separating them with spaces (e.g., `1 4`).
|
||||
|
||||
## Linux x86_64
|
||||
|
||||
Creates native Linux 64-bit binaries using a Docker container based on Ubuntu 20.04.
|
||||
|
||||
89
docker-build/build-menu.sh
Executable file
89
docker-build/build-menu.sh
Executable file
@@ -0,0 +1,89 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# Directory where this script is located
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
|
||||
# Function to run a build script
|
||||
run_build() {
|
||||
local script_name="$1"
|
||||
local description="$2"
|
||||
|
||||
echo "============================================================"
|
||||
echo "Starting build for: $description"
|
||||
echo "Script: $script_name"
|
||||
echo "============================================================"
|
||||
|
||||
if [[ -f "${SCRIPT_DIR}/${script_name}" ]]; then
|
||||
# Ensure it's executable
|
||||
chmod +x "${SCRIPT_DIR}/${script_name}"
|
||||
"${SCRIPT_DIR}/${script_name}"
|
||||
else
|
||||
echo "Error: Script ${script_name} not found!"
|
||||
fi
|
||||
|
||||
echo "============================================================"
|
||||
echo "Finished build for: $description"
|
||||
echo "============================================================"
|
||||
echo ""
|
||||
}
|
||||
|
||||
show_menu() {
|
||||
echo "Palladium Core Docker Build System"
|
||||
echo "----------------------------------"
|
||||
echo "1) Linux x86_64"
|
||||
echo "2) Linux aarch64 (ARM64)"
|
||||
echo "3) Linux armv7l (ARM 32-bit)"
|
||||
echo "4) Windows x86_64"
|
||||
echo "5) Build ALL"
|
||||
echo "0) Exit"
|
||||
echo ""
|
||||
}
|
||||
|
||||
show_menu
|
||||
read -p "Enter your choice(s) separated by space (e.g. '1 4' for Linux and Windows): " choices
|
||||
|
||||
# Convert string to array
|
||||
read -ra ADDR <<< "$choices"
|
||||
|
||||
# Check if '5' (ALL) is selected
|
||||
do_all=false
|
||||
for choice in "${ADDR[@]}"; do
|
||||
if [[ "$choice" == "5" ]]; then
|
||||
do_all=true
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$do_all" = true ]; then
|
||||
run_build "build-linux-x86_64.sh" "Linux x86_64"
|
||||
run_build "build-linux-aarch64.sh" "Linux aarch64"
|
||||
run_build "build-linux-armv7l.sh" "Linux armv7l"
|
||||
run_build "build-windows.sh" "Windows x86_64"
|
||||
else
|
||||
for choice in "${ADDR[@]}"; do
|
||||
case "$choice" in
|
||||
1)
|
||||
run_build "build-linux-x86_64.sh" "Linux x86_64"
|
||||
;;
|
||||
2)
|
||||
run_build "build-linux-aarch64.sh" "Linux aarch64"
|
||||
;;
|
||||
3)
|
||||
run_build "build-linux-armv7l.sh" "Linux armv7l"
|
||||
;;
|
||||
4)
|
||||
run_build "build-windows.sh" "Windows x86_64"
|
||||
;;
|
||||
0)
|
||||
echo "Exiting."
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
echo "Invalid option: $choice"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
|
||||
echo "All selected builds completed."
|
||||
@@ -65,6 +65,7 @@ public:
|
||||
CMainParams() {
|
||||
strNetworkID = CBaseChainParams::MAIN;
|
||||
consensus.nSubsidyHalvingInterval = 210000;
|
||||
consensus.nResilienceForkHeight = 340000;
|
||||
|
||||
consensus.BIP16Exception = uint256S("0x000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f");
|
||||
consensus.BIP34Height = 29000;
|
||||
@@ -184,6 +185,7 @@ public:
|
||||
CTestNetParams() {
|
||||
strNetworkID = CBaseChainParams::TESTNET;
|
||||
consensus.nSubsidyHalvingInterval = 210000;
|
||||
consensus.nResilienceForkHeight = 2000;
|
||||
|
||||
consensus.BIP34Height = 1700;
|
||||
consensus.BIP34Hash = uint256();
|
||||
@@ -273,6 +275,7 @@ public:
|
||||
explicit CRegTestParams(const ArgsManager& args) {
|
||||
strNetworkID = CBaseChainParams::REGTEST;
|
||||
consensus.nSubsidyHalvingInterval = 150;
|
||||
consensus.nResilienceForkHeight = 200;
|
||||
consensus.BIP16Exception = uint256();
|
||||
consensus.BIP34Height = 0;
|
||||
consensus.BIP34Hash = uint256();
|
||||
|
||||
@@ -81,8 +81,8 @@ std::string FormatFullVersion()
|
||||
{
|
||||
// Display a simplified semantic version: omit trailing ".0" and git suffix
|
||||
// by reusing FormatVersion on the aggregated CLIENT_VERSION.
|
||||
// This yields e.g. "v1.4.2" when CLIENT_VERSION_BUILD == 0,
|
||||
// or "v1.4.2.1" if a non-zero build number is used.
|
||||
// This yields e.g. "v1.5.0" when CLIENT_VERSION_BUILD == 0,
|
||||
// or "v1.5.0.1" if a non-zero build number is used.
|
||||
return std::string("v") + FormatVersion(CLIENT_VERSION);
|
||||
}
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@ struct BIP9Deployment {
|
||||
struct Params {
|
||||
uint256 hashGenesisBlock;
|
||||
int nSubsidyHalvingInterval;
|
||||
int nResilienceForkHeight;
|
||||
/* Block hash that is excepted from BIP16 enforcement */
|
||||
uint256 BIP16Exception;
|
||||
/** Block height and hash at which BIP34 becomes active */
|
||||
|
||||
31
src/pow.cpp
31
src/pow.cpp
@@ -5,6 +5,7 @@
|
||||
|
||||
#include <pow.h>
|
||||
|
||||
#include <chainparams.h>
|
||||
#include <arith_uint256.h>
|
||||
#include <chain.h>
|
||||
#include <primitives/block.h>
|
||||
@@ -28,6 +29,20 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHead
|
||||
if (params.fPowAllowMinDifficultyBlocks && pindexLast->nHeight >= 0)
|
||||
return LwmaCalculateNextWorkRequired(pindexLast, params);
|
||||
|
||||
// Palladium: Hard Fork at 350,000 for fast difficulty adjustment
|
||||
if (pindexLast->nHeight + 1 >= params.nResilienceForkHeight) {
|
||||
int64_t nIntervalNew = 60;
|
||||
if ((pindexLast->nHeight + 1) % nIntervalNew != 0)
|
||||
return pindexLast->nBits;
|
||||
|
||||
int nHeightFirst = pindexLast->nHeight - (nIntervalNew - 1);
|
||||
assert(nHeightFirst >= 0);
|
||||
const CBlockIndex* pindexFirst = pindexLast->GetAncestor(nHeightFirst);
|
||||
assert(pindexFirst);
|
||||
|
||||
return CalculateNextWorkRequired(pindexLast, pindexFirst->GetBlockTime(), params);
|
||||
}
|
||||
|
||||
if (pindexLast->nHeight >= 29000)
|
||||
return LwmaCalculateNextWorkRequired(pindexLast, params);
|
||||
|
||||
@@ -110,19 +125,25 @@ unsigned int CalculateNextWorkRequired(const CBlockIndex* pindexLast, int64_t nF
|
||||
if (params.fPowNoRetargeting)
|
||||
return pindexLast->nBits;
|
||||
|
||||
// Palladium: Hard Fork at 350,000 for fast difficulty adjustment
|
||||
int64_t nTargetTimespan = params.nPowTargetTimespan;
|
||||
if (pindexLast->nHeight + 1 >= 340000) {
|
||||
nTargetTimespan = 7200; // 60 blocks * 120 seconds
|
||||
}
|
||||
|
||||
// Limit adjustment step
|
||||
int64_t nActualTimespan = pindexLast->GetBlockTime() - nFirstBlockTime;
|
||||
if (nActualTimespan < params.nPowTargetTimespan/4)
|
||||
nActualTimespan = params.nPowTargetTimespan/4;
|
||||
if (nActualTimespan > params.nPowTargetTimespan*4)
|
||||
nActualTimespan = params.nPowTargetTimespan*4;
|
||||
if (nActualTimespan < nTargetTimespan/4)
|
||||
nActualTimespan = nTargetTimespan/4;
|
||||
if (nActualTimespan > nTargetTimespan*4)
|
||||
nActualTimespan = nTargetTimespan*4;
|
||||
|
||||
// Retarget
|
||||
const arith_uint256 bnPowLimit = UintToArith256(params.powLimit);
|
||||
arith_uint256 bnNew;
|
||||
bnNew.SetCompact(pindexLast->nBits);
|
||||
bnNew *= nActualTimespan;
|
||||
bnNew /= params.nPowTargetTimespan;
|
||||
bnNew /= nTargetTimespan;
|
||||
|
||||
if (bnNew > bnPowLimit)
|
||||
bnNew = bnPowLimit;
|
||||
|
||||
@@ -50,9 +50,7 @@
|
||||
<item>
|
||||
<widget class="QWidget" name="contentWidget" native="true">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">#contentWidget { background: rgba(255,255,255,240); border-radius: 6px; }
|
||||
|
||||
QLabel { color: rgb(40,40,40); }</string>
|
||||
<string notr="true">#contentWidget { border-radius: 6px; }</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayoutSub" stretch="1,0,0,0">
|
||||
<property name="spacing">
|
||||
|
||||
@@ -64,6 +64,14 @@
|
||||
#include <QFile>
|
||||
#include <QTextStream>
|
||||
|
||||
#include <QUrl>
|
||||
#include <QDesktopServices>
|
||||
#include <QHBoxLayout>
|
||||
#include <QLabel>
|
||||
#include <QPushButton>
|
||||
#include <QVersionNumber> // Falls Qt Version >= 5.6, sonst String-Vergleich
|
||||
#include "clientversion.h" // Wichtig um die eigene Version zu kennen
|
||||
|
||||
const std::string PalladiumGUI::DEFAULT_UIPLATFORM =
|
||||
#if defined(Q_OS_MAC)
|
||||
"macosx"
|
||||
@@ -93,10 +101,6 @@ PalladiumGUI::PalladiumGUI(interfaces::Node& node, const PlatformStyle *_platfor
|
||||
qApp->setStyleSheet(ts.readAll());
|
||||
f.close();
|
||||
}
|
||||
// Wichtig: Den Haken im Menü setzen!
|
||||
if(themeAction) {
|
||||
themeAction->setChecked(true);
|
||||
}
|
||||
}
|
||||
|
||||
//QSettings settings;
|
||||
@@ -114,21 +118,33 @@ PalladiumGUI::PalladiumGUI(interfaces::Node& node, const PlatformStyle *_platfor
|
||||
|
||||
rpcConsole = new RPCConsole(node, _platformStyle, nullptr);
|
||||
helpMessageDialog = new HelpMessageDialog(node, this, false);
|
||||
|
||||
// --- UPDATE CHECKER LAYOUT SETUP ---
|
||||
QWidget* mainContainer = new QWidget(this);
|
||||
QVBoxLayout* mainLayout = new QVBoxLayout(mainContainer);
|
||||
mainLayout->setContentsMargins(0,0,0,0);
|
||||
mainLayout->setSpacing(0);
|
||||
|
||||
updateAlertWidget = new QWidget(mainContainer);
|
||||
updateAlertWidget->setVisible(false);
|
||||
mainLayout->addWidget(updateAlertWidget);
|
||||
|
||||
#ifdef ENABLE_WALLET
|
||||
if(enableWallet)
|
||||
{
|
||||
/** Create wallet frame and make it the central widget */
|
||||
walletFrame = new WalletFrame(_platformStyle, this);
|
||||
setCentralWidget(walletFrame);
|
||||
mainLayout->addWidget(walletFrame);
|
||||
} else
|
||||
#endif // ENABLE_WALLET
|
||||
{
|
||||
/* When compiled without wallet or -disablewallet is provided,
|
||||
* the central widget is the rpc console.
|
||||
*/
|
||||
setCentralWidget(rpcConsole);
|
||||
mainLayout->addWidget(rpcConsole);
|
||||
Q_EMIT consoleShown(rpcConsole);
|
||||
}
|
||||
setCentralWidget(mainContainer);
|
||||
|
||||
// Accept D&D of URIs
|
||||
setAcceptDrops(true);
|
||||
@@ -137,6 +153,10 @@ PalladiumGUI::PalladiumGUI(interfaces::Node& node, const PlatformStyle *_platfor
|
||||
// Needs walletFrame to be initialized
|
||||
createActions();
|
||||
|
||||
if (isDark && themeAction) {
|
||||
themeAction->setChecked(true);
|
||||
}
|
||||
|
||||
// Create application menu bar
|
||||
createMenuBar();
|
||||
|
||||
@@ -220,6 +240,9 @@ PalladiumGUI::PalladiumGUI(interfaces::Node& node, const PlatformStyle *_platfor
|
||||
});
|
||||
|
||||
modalOverlay = new ModalOverlay(enableWallet, this->centralWidget());
|
||||
if (themeAction->isChecked()) {
|
||||
modalOverlay->setStyleSheet("background-color: #2b2b2b; color: white;");
|
||||
}
|
||||
connect(labelBlocksIcon, &GUIUtil::ClickableLabel::clicked, this, &PalladiumGUI::showModalOverlay);
|
||||
connect(progressBar, &GUIUtil::ClickableProgressBar::clicked, this, &PalladiumGUI::showModalOverlay);
|
||||
#ifdef ENABLE_WALLET
|
||||
@@ -231,6 +254,16 @@ PalladiumGUI::PalladiumGUI(interfaces::Node& node, const PlatformStyle *_platfor
|
||||
#ifdef Q_OS_MAC
|
||||
m_app_nap_inhibitor = new CAppNapInhibitor;
|
||||
#endif
|
||||
|
||||
// --- START EINFÜGUNG: UPDATE CHECKER ---
|
||||
networkManager = new QNetworkAccessManager(this);
|
||||
connect(networkManager, &QNetworkAccessManager::finished, this, &PalladiumGUI::onUpdateResult);
|
||||
|
||||
// updateAlertWidget is already initialized and added to layout above
|
||||
|
||||
// Check beim Start ausführen
|
||||
checkUpdate();
|
||||
// --- ENDE EINFÜGUNG: UPDATE CHECKER ---
|
||||
}
|
||||
|
||||
PalladiumGUI::~PalladiumGUI()
|
||||
@@ -1500,12 +1533,110 @@ void PalladiumGUI::toggleTheme()
|
||||
qApp->setStyleSheet(ts.readAll());
|
||||
f.close();
|
||||
}
|
||||
|
||||
// 2. Speichern, dass er an ist
|
||||
settings.setValue("darkModeEnabled", true);
|
||||
|
||||
if (modalOverlay) {
|
||||
modalOverlay->setStyleSheet("background-color: #2b2b2b; color: white;");
|
||||
}
|
||||
} else {
|
||||
// 1. Standard Theme (Weiß)
|
||||
qApp->setStyleSheet("");
|
||||
qApp->setPalette(style()->standardPalette());
|
||||
|
||||
// 2. Speichern, dass er aus ist
|
||||
settings.setValue("darkModeEnabled", false);
|
||||
|
||||
if (modalOverlay) {
|
||||
modalOverlay->setStyleSheet("");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void PalladiumGUI::checkUpdate()
|
||||
{
|
||||
// URL zu den GitHub Releases API
|
||||
QNetworkRequest request(QUrl("https://api.github.com/repos/palladium-coin/palladiumcore/releases/latest"));
|
||||
|
||||
// GitHub verlangt einen User-Agent Header, sonst wird die Anfrage blockiert
|
||||
request.setRawHeader("User-Agent", "PalladiumWallet");
|
||||
|
||||
networkManager->get(request);
|
||||
}
|
||||
|
||||
void PalladiumGUI::onUpdateResult(QNetworkReply* reply)
|
||||
{
|
||||
if (reply->error() == QNetworkReply::NoError) {
|
||||
QByteArray response = reply->readAll();
|
||||
QJsonDocument doc = QJsonDocument::fromJson(response);
|
||||
QJsonObject obj = doc.object();
|
||||
|
||||
|
||||
QString remoteVersionStr = obj["tag_name"].toString();
|
||||
latestVersionUrl = obj["html_url"].toString(); // Link zum Release
|
||||
|
||||
// Entferne das 'v' falls vorhanden für den Vergleich
|
||||
if(remoteVersionStr.startsWith("v")) {
|
||||
remoteVersionStr.remove(0, 1);
|
||||
}
|
||||
|
||||
// Aktuelle Client Version holen
|
||||
QString currentVersionStr = QString::fromStdString(FormatFullVersion());
|
||||
if(currentVersionStr.startsWith("v")) {
|
||||
currentVersionStr.remove(0, 1);
|
||||
}
|
||||
// Bereinige currentVersionStr falls nötig, FormatFullVersion gibt oft sowas wie "1.0.0-beta" zurück
|
||||
currentVersionStr = currentVersionStr.split('-').first();
|
||||
|
||||
// Vergleiche Versionen mit QVersionNumber
|
||||
QVersionNumber local = QVersionNumber::fromString(currentVersionStr);
|
||||
QVersionNumber remote = QVersionNumber::fromString(remoteVersionStr);
|
||||
|
||||
if (remote > local) {
|
||||
|
||||
// Erstelle das Layout für den Warnbalken
|
||||
if (!updateAlertWidget->layout()) {
|
||||
QHBoxLayout *layout = new QHBoxLayout(updateAlertWidget);
|
||||
layout->setContentsMargins(10, 5, 10, 5);
|
||||
|
||||
// Stylesheet für den roten Balken
|
||||
updateAlertWidget->setStyleSheet("background-color: #d9534f; color: white; border-radius: 0px;");
|
||||
updateAlertWidget->setMaximumHeight(50);
|
||||
|
||||
QLabel *label = new QLabel(tr("A new update is available! (%1)").arg(remoteVersionStr), updateAlertWidget);
|
||||
label->setStyleSheet("font-weight: bold; border: none; background: transparent; color: white;");
|
||||
|
||||
QPushButton *btn = new QPushButton(tr("Download"), updateAlertWidget);
|
||||
btn->setStyleSheet("background-color: white; color: #d9534f; font-weight: bold; border-radius: 3px; padding: 3px 10px;");
|
||||
|
||||
QString url = latestVersionUrl;
|
||||
connect(btn, &QPushButton::clicked, [this, url]() {
|
||||
if(!QDesktopServices::openUrl(QUrl(url))) {
|
||||
QMessageBox::information(this, tr("Update Available"), tr("Please visit: %1").arg(url));
|
||||
}
|
||||
});
|
||||
|
||||
QPushButton *btnClose = new QPushButton("X", updateAlertWidget);
|
||||
btnClose->setFlat(true);
|
||||
btnClose->setStyleSheet("color: white; font-weight: bold; border: none; background: transparent;");
|
||||
connect(btnClose, &QPushButton::clicked, updateAlertWidget, &QWidget::hide);
|
||||
|
||||
layout->addWidget(label);
|
||||
layout->addStretch(); // Schiebt Button nach rechts
|
||||
layout->addWidget(btn);
|
||||
layout->addWidget(btnClose);
|
||||
}
|
||||
|
||||
updateAlertWidget->setVisible(true);
|
||||
}
|
||||
}
|
||||
reply->deleteLater();
|
||||
}
|
||||
|
||||
void PalladiumGUI::openUpdateLink()
|
||||
{
|
||||
if (!latestVersionUrl.isEmpty()) {
|
||||
QDesktopServices::openUrl(QUrl(latestVersionUrl));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,11 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <QNetworkAccessManager>
|
||||
#include <QNetworkReply>
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonObject>
|
||||
|
||||
class ClientModel;
|
||||
class NetworkStyle;
|
||||
class Notificator;
|
||||
@@ -175,6 +180,12 @@ private:
|
||||
const PlatformStyle *platformStyle;
|
||||
const NetworkStyle* const m_network_style;
|
||||
|
||||
// --- NEUE VARIABLEN FÜR UPDATE CHECKER START ---
|
||||
QNetworkAccessManager* networkManager;
|
||||
QString latestVersionUrl;
|
||||
QWidget* updateAlertWidget; // Der Balken
|
||||
// --- NEUE VARIABLEN FÜR UPDATE CHECKER ENDE ---
|
||||
|
||||
/** Create the main UI actions. */
|
||||
void createActions();
|
||||
/** Create the menu bar and sub-menus. */
|
||||
@@ -310,6 +321,13 @@ public Q_SLOTS:
|
||||
void showModalOverlay();
|
||||
|
||||
void toggleTheme();
|
||||
|
||||
private Q_SLOTS:
|
||||
// --- NEUE SLOTS FÜR UPDATE CHECKER START ---
|
||||
void checkUpdate();
|
||||
void onUpdateResult(QNetworkReply* reply);
|
||||
void openUpdateLink();
|
||||
// --- NEUE SLOTS FÜR UPDATE CHECKER ENDE ---
|
||||
};
|
||||
|
||||
class UnitDisplayStatusBarControl : public QLabel
|
||||
@@ -341,4 +359,4 @@ private Q_SLOTS:
|
||||
void onMenuSelection(QAction* action);
|
||||
};
|
||||
|
||||
#endif // PALLADIUM_QT_PALLADIUMGUI_H
|
||||
#endif // PALLADIUM_QT_PALLADIUMGUI_H
|
||||
@@ -30,7 +30,7 @@ public:
|
||||
* Default setting for nMaxDatacarrierBytes. 80 bytes of data, +1 for OP_RETURN,
|
||||
* +2 for the pushdata opcodes.
|
||||
*/
|
||||
static const unsigned int MAX_OP_RETURN_RELAY = 83;
|
||||
static const unsigned int MAX_OP_RETURN_RELAY = 520;
|
||||
|
||||
/**
|
||||
* A data carrying output is an unspendable output containing data. The script
|
||||
|
||||
@@ -563,6 +563,15 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws)
|
||||
if (fRequireStandard && !IsStandardTx(tx, reason))
|
||||
return state.Invalid(TxValidationResult::TX_NOT_STANDARD, reason);
|
||||
|
||||
// Check OP_RETURN size based on activation height
|
||||
if (ChainActive().Height() < Params().GetConsensus().nResilienceForkHeight) {
|
||||
for (const CTxOut& txout : tx.vout) {
|
||||
if (txout.scriptPubKey.IsUnspendable() && txout.scriptPubKey.size() > 83) {
|
||||
return state.Invalid(TxValidationResult::TX_NOT_STANDARD, "bad-txns-oversize-opreturn-prefork");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Do not work on transactions that are too small.
|
||||
// A transaction with 1 segwit input and 1 P2WPHK output has non-witness size of 82 bytes.
|
||||
// Transactions smaller than this are not relayed to mitigate CVE-2017-12842 by not relaying
|
||||
|
||||
67
update_version.sh
Executable file
67
update_version.sh
Executable file
@@ -0,0 +1,67 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
echo "========================================================"
|
||||
echo " Palladium Core - Master Version Updater"
|
||||
echo "========================================================"
|
||||
|
||||
# 1. Get Inputs
|
||||
read -p "Enter CURRENT version string (e.g. 1.4.3): " OLD_VERSION
|
||||
read -p "Enter NEW version string (e.g. 1.5.0): " NEW_VERSION
|
||||
|
||||
if [ -z "$OLD_VERSION" ] || [ -z "$NEW_VERSION" ]; then
|
||||
echo "Error: Version strings cannot be empty."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Parse the NEW version into parts (Major.Minor.Revision)
|
||||
IFS='.' read -r -a V_PARTS <<< "$NEW_VERSION"
|
||||
MAJOR="${V_PARTS[0]}"
|
||||
MINOR="${V_PARTS[1]}"
|
||||
REV="${V_PARTS[2]}"
|
||||
|
||||
# Default to 0 if revision is missing (e.g. 1.5 becomes 1.5.0)
|
||||
if [ -z "$REV" ]; then REV="0"; fi
|
||||
|
||||
echo "--------------------------------------------------------"
|
||||
echo "Targeting: $MAJOR.$MINOR.$REV"
|
||||
echo "--------------------------------------------------------"
|
||||
|
||||
# 2. Global Text Replacement (Docs, Manpages, Comments)
|
||||
echo "[1/3] Performing global search & replace ($OLD_VERSION -> $NEW_VERSION)..."
|
||||
# We exclude .git directory and binaries to avoid corruption
|
||||
grep -rIl "$OLD_VERSION" . | grep -v "^./.git" | grep -v "update_version.sh" | while read -r file ; do
|
||||
sed -i "s/$OLD_VERSION/$NEW_VERSION/g" "$file"
|
||||
done
|
||||
echo "Global text replacement done."
|
||||
|
||||
# 3. Update configure.ac (The Linux/Unix Build System)
|
||||
echo "[2/3] Updating configure.ac..."
|
||||
if [ -f "configure.ac" ]; then
|
||||
sed -i "s/define(_CLIENT_VERSION_MAJOR, [0-9]*)/define(_CLIENT_VERSION_MAJOR, $MAJOR)/g" configure.ac
|
||||
sed -i "s/define(_CLIENT_VERSION_MINOR, [0-9]*)/define(_CLIENT_VERSION_MINOR, $MINOR)/g" configure.ac
|
||||
sed -i "s/define(_CLIENT_VERSION_REVISION, [0-9]*)/define(_CLIENT_VERSION_REVISION, $REV)/g" configure.ac
|
||||
echo "✔ configure.ac updated."
|
||||
else
|
||||
echo "❌ Warning: configure.ac not found."
|
||||
fi
|
||||
|
||||
# 4. Update Windows MSVC Config (The Windows Build System)
|
||||
echo "[3/3] Updating build_msvc/palladium_config.h..."
|
||||
MSVC_FILE="build_msvc/palladium_config.h"
|
||||
if [ -f "$MSVC_FILE" ]; then
|
||||
sed -i "s/#define CLIENT_VERSION_MAJOR [0-9]*/#define CLIENT_VERSION_MAJOR $MAJOR/g" "$MSVC_FILE"
|
||||
sed -i "s/#define CLIENT_VERSION_MINOR [0-9]*/#define CLIENT_VERSION_MINOR $MINOR/g" "$MSVC_FILE"
|
||||
sed -i "s/#define CLIENT_VERSION_REVISION [0-9]*/#define CLIENT_VERSION_REVISION $REV/g" "$MSVC_FILE"
|
||||
echo "✔ $MSVC_FILE updated."
|
||||
else
|
||||
echo "❌ Warning: $MSVC_FILE not found."
|
||||
fi
|
||||
|
||||
echo "========================================================"
|
||||
echo "Update Complete! Please run:"
|
||||
echo "1. make clean"
|
||||
echo "2. ./autogen.sh"
|
||||
echo "3. ./configure"
|
||||
echo "4. make"
|
||||
echo "========================================================"
|
||||
Reference in New Issue
Block a user