22 Commits

Author SHA1 Message Date
NotRin7
79040450d2 Update modaloverlay and palladiumgui files 2025-12-10 01:19:11 +01:00
NotRin7
eafbe5ac94 Merge pull request #14 from palladium-coin/logic-improvements
Logic improvements
2025-11-25 15:00:01 +01:00
NotRin7
b20544c499 add params to chainparams.cpp 2025-11-24 00:03:44 +01:00
NotRin7
a3ca53a380 Merge pull request #13 from palladium-coin/master
Merge pull request #12 from palladium-coin/logic-improvements
2025-11-23 23:54:28 +01:00
NotRin7
e27ef57e41 Merge pull request #12 from palladium-coin/logic-improvements
Logic improvements
2025-11-22 20:07:33 +01:00
NotRin7
54a10bbc2a Release v1.5.0: Hard Fork Logic (Chat & DAA) activated at block 340,000 2025-11-22 18:59:39 +01:00
NotRin7
5eb70c65d2 replacing the deprecated state.DoS call with state.Invalid 2025-11-22 17:16:34 +01:00
NotRin7
5b37dcc469 fix linker error 2025-11-22 17:12:34 +01:00
NotRin7
89940a5e2f better diff adjustment at block 350.000 2025-11-22 16:38:29 +01:00
NotRin7
6620061934 fix 2025-11-22 16:18:00 +01:00
NotRin7
492a610637 Merge pull request #11 from NotRin7/master
smal fixes
2025-11-20 18:10:31 +01:00
NotRin7
8bd7bc2ff8 cod update 2025-11-20 17:53:49 +01:00
NotRin7
d59e9d6451 add combine script 2025-11-20 17:50:26 +01:00
NotRin7
4afc3365c4 Update palladiumgui.cpp 2025-11-20 17:43:40 +01:00
NotRin7
372c7b44db fix 2.0 2025-11-20 17:33:32 +01:00
NotRin7
c8cd9a5f3b fix 2025-11-20 15:58:58 +01:00
NotRin7
e3ab6b09cc Merge pull request #9 from palladium-coin/implement-update-checker
Implement update checker
2025-11-19 21:32:19 +01:00
NotRin7
3a6a2fcb32 Update palladiumgui.cpp 2025-11-19 21:31:38 +01:00
NotRin7
19715917b5 Update install_db4.sh 2025-11-19 21:18:41 +01:00
NotRin7
0644af1003 update info 2025-11-19 21:03:19 +01:00
23ef5f28ff Update client version to 1.4.3
Update version number in configure.ac, build_msvc config, clientversion.cpp,
and all man pages from 1.4.2 to 1.4.3
2025-11-19 08:18:17 +01:00
NotRin7
91975bb8bb gui: Add Dark Mode support with toggle switch
- Added dark.qss stylesheet for dark theme
- Implemented toggleTheme() slot in PalladiumGUI
- Added 'Dark Mode' checkbox to Settings menu
- Theme preference is saved in QSettings (darkModeEnabled)
- Updated palladium.qrc to include style resources
2025-11-18 17:34:01 +01:00
22 changed files with 610 additions and 50 deletions

View File

@@ -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"

View File

@@ -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)

View File

@@ -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

View File

@@ -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
\-?

View File

@@ -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
\-?

View File

@@ -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
\-?

View File

@@ -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.

View File

@@ -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
\-?

View File

@@ -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
View 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."

View File

@@ -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();

View File

@@ -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);
}

View File

@@ -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 */

View File

@@ -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;

View File

@@ -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">

View File

@@ -83,4 +83,8 @@
<file alias="spinner-034">res/movies/spinner-034.png</file>
<file alias="spinner-035">res/movies/spinner-035.png</file>
</qresource>
<qresource prefix="/">
<file>res/styles/dark.qss</file>
</qresource>
</RCC>

View File

@@ -61,6 +61,16 @@
#include <QVBoxLayout>
#include <QWindow>
#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)
@@ -79,7 +89,21 @@ PalladiumGUI::PalladiumGUI(interfaces::Node& node, const PlatformStyle *_platfor
platformStyle(_platformStyle),
m_network_style(networkStyle)
{
// --- DARK MODE AUTO-LOAD ---
QSettings settings;
bool isDark = settings.value("darkModeEnabled", false).toBool();
if (isDark) {
// Stylesheet laden
QFile f(":/res/styles/dark.qss");
if (f.open(QFile::ReadOnly | QFile::Text)) {
QTextStream ts(&f);
qApp->setStyleSheet(ts.readAll());
f.close();
}
}
//QSettings settings;
if (!restoreGeometry(settings.value("MainWindowGeometry").toByteArray())) {
// Restore failed (perhaps missing setting), center the window
move(QGuiApplication::primaryScreen()->availableGeometry().center() - frameGeometry().center());
@@ -94,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);
@@ -117,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();
@@ -200,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
@@ -211,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()
@@ -414,6 +467,10 @@ void PalladiumGUI::createActions()
connect(new QShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_C), this), &QShortcut::activated, this, &PalladiumGUI::showDebugWindowActivateConsole);
connect(new QShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_D), this), &QShortcut::activated, this, &PalladiumGUI::showDebugWindow);
themeAction = new QAction(tr("&Dark Mode"), this);
themeAction->setCheckable(true);
connect(themeAction, SIGNAL(triggered()), this, SLOT(toggleTheme()));
}
void PalladiumGUI::createMenuBar()
@@ -506,6 +563,8 @@ void PalladiumGUI::createMenuBar()
help->addSeparator();
help->addAction(aboutAction);
help->addAction(aboutQtAction);
settings->addAction(themeAction);
}
void PalladiumGUI::createToolBars()
@@ -1463,3 +1522,121 @@ void UnitDisplayStatusBarControl::onMenuSelection(QAction* action)
optionsModel->setDisplayUnit(action->data());
}
}
void PalladiumGUI::toggleTheme()
{
QSettings settings;
if (themeAction->isChecked()) {
// 1. Dark Mode laden
QFile f(":/res/styles/dark.qss");
if (f.open(QFile::ReadOnly | QFile::Text)) {
QTextStream ts(&f);
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));
}
}

View File

@@ -25,6 +25,11 @@
#include <memory>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QJsonDocument>
#include <QJsonObject>
class ClientModel;
class NetworkStyle;
class Notificator;
@@ -153,7 +158,7 @@ private:
QAction* m_close_wallet_action{nullptr};
QAction* m_wallet_selector_label_action = nullptr;
QAction* m_wallet_selector_action = nullptr;
QAction *themeAction;
QLabel *m_wallet_selector_label = nullptr;
QComboBox* m_wallet_selector = nullptr;
@@ -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. */
@@ -308,6 +319,15 @@ public Q_SLOTS:
void setTrayIconVisible(bool);
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
@@ -339,4 +359,4 @@ private Q_SLOTS:
void onMenuSelection(QAction* action);
};
#endif // PALLADIUM_QT_PALLADIUMGUI_H
#endif // PALLADIUM_QT_PALLADIUMGUI_H

146
src/qt/res/styles/dark.qss Normal file
View File

@@ -0,0 +1,146 @@
/* =======================================================
PALLADIUM CORE DARK THEME (dark.qss)
======================================================= */
/* --- GRUNDLAGEN --- */
QWidget {
background-color: #2D2D2D;
color: #E0E0E0;
selection-background-color: #007BFF;
selection-color: #FFFFFF;
outline: none;
}
/* --- MENÜLEISTE (Oben: File, Settings...) --- */
QMenuBar {
background-color: #2D2D2D;
color: #E0E0E0;
border-bottom: 1px solid #3A3A3A;
}
QMenuBar::item {
background-color: transparent;
padding: 6px 10px;
}
QMenuBar::item:selected {
background-color: #3A3A3A;
}
QMenu {
background-color: #2D2D2D;
border: 1px solid #555;
}
QMenu::item {
padding: 5px 20px;
}
QMenu::item:selected {
background-color: #007BFF;
color: white;
}
/* --- TOOLBAR (Die Icons oben) --- */
/* Wir machen sie etwas heller, damit schwarze Icons sichtbar bleiben */
QToolBar {
background-color: #3D3D3D;
border-bottom: 1px solid #3A3A3A;
padding: 2px;
spacing: 5px;
}
QToolButton {
background-color: transparent;
border: 1px solid transparent;
border-radius: 4px;
padding: 4px;
color: #E0E0E0;
}
QToolButton:hover {
background-color: #4D4D4D;
border: 1px solid #555;
}
QToolButton:checked {
background-color: #007BFF;
color: white;
}
/* --- TABS (Overview, Send, Receive) --- */
QTabWidget::pane {
border: 1px solid #3A3A3A;
}
QTabBar::tab {
background: #1E1E1E;
color: #AAAAAA;
padding: 8px 20px;
border: 1px solid #3A3A3A;
border-bottom: none;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
margin-right: 2px;
}
QTabBar::tab:selected {
background: #2D2D2D; /* Gleiche Farbe wie Hintergrund */
color: #FFFFFF;
border-bottom: 1px solid #2D2D2D; /* "Verbindet" den Tab mit dem Inhalt */
font-weight: bold;
}
/* --- EINGABEFELDER --- */
QLineEdit, QTextEdit, QPlainTextEdit, QSpinBox, QDoubleSpinBox {
background-color: #1E1E1E;
color: #FFFFFF;
border: 1px solid #3A3A3A;
border-radius: 3px;
padding: 4px;
}
QLineEdit:focus {
border: 1px solid #007BFF;
}
/* --- LISTEN & TABELLEN (Transaktionen) --- */
QTableView, QListView, QTreeWidget {
background-color: #1E1E1E;
alternate-background-color: #252525;
color: #E0E0E0;
gridline-color: #333;
border: 1px solid #3A3A3A;
}
QHeaderView::section {
background-color: #333;
color: #E0E0E0;
padding: 4px;
border: 1px solid #444;
}
/* --- BUTTONS --- */
QPushButton {
background-color: #444;
border: 1px solid #555;
border-radius: 4px;
padding: 5px 15px;
color: white;
}
QPushButton:hover {
background-color: #555;
}
QPushButton:pressed {
background-color: #007BFF;
border-color: #007BFF;
}
/* --- STATUSBAR (Unten) --- */
QStatusBar {
background-color: #2D2D2D;
color: #888;
border-top: 1px solid #3A3A3A;
}

View File

@@ -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

View File

@@ -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
View 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 "========================================================"