Compare commits

...

2 Commits

Author SHA1 Message Date
sami7777 47bd5bf083 Fix data directory dialog appearing on every startup
Build All Platforms / build-windows-qt (push) Waiting to run
Build All Platforms / build-windows-daemon (push) Waiting to run
Build All Platforms / build-linux-qt (push) Waiting to run
Build All Platforms / build-linux-daemon (push) Waiting to run
Build All Platforms / build-macos (push) Waiting to run
Build All Platforms / release (push) Blocked by required conditions
Moved setOrganizationName/setApplicationName calls BEFORE
IntroDialog::pickDataDirectory() so QSettings knows where to save the
user's data directory choice.

Previously, QSettings was created without org/app names set, causing
the "strDataDir" setting to be lost, forcing the dialog to appear on
every startup.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-03-16 22:46:39 -07:00
sami7777 7b5b80cb3a Fix critical bug: duplicate version messages causing peer disconnects
Fixed missing braces in CNode constructor (net.h:327-329) that caused
PushVersion() to execute unconditionally for ALL connections instead of
only outbound connections.

This bug caused inbound peers (seed nodes) to:
1. Send version on connection (unintended)
2. Send version again when receiving peer's version (intended)
3. Trigger Misbehaving(1) on peer side for duplicate version
4. Get disconnected by peer (ProcessMessage fails → CloseSocketDisconnect)

Result: Seed nodes could only serve ~120 blocks before disconnect,
making sync nearly impossible.

Bump version to 5.2.1.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-03-16 22:05:10 -07:00
4 changed files with 12 additions and 11 deletions
+1 -1
View File
@@ -8,7 +8,7 @@
// These need to be macros, as version.cpp's and triangles-qt.rc's voodoo requires it
#define CLIENT_VERSION_MAJOR 5
#define CLIENT_VERSION_MINOR 2
#define CLIENT_VERSION_REVISION 0
#define CLIENT_VERSION_REVISION 1
#define CLIENT_VERSION_BUILD 0
// Converts the parameter X to a string after macro replacement on X has been performed.
+2
View File
@@ -325,8 +325,10 @@ public:
// Be shy and don't send version until we hear
if (hSocket != INVALID_SOCKET && !fInbound)
{
printf("CNode(): pfrom-addr %s\n", addrName.c_str());
PushVersion();
}
}
~CNode()
+8 -9
View File
@@ -132,6 +132,14 @@ int main(int argc, char *argv[])
// Command-line options take precedence:
ParseParameters(argc, argv);
// Application identification (must be set before IntroDialog uses QSettings)
app.setOrganizationName("Triangles");
//XXX app.setOrganizationDomain("");
if(GetBoolArg("-testnet")) // Separate UI settings for testnet
app.setApplicationName("Triangles-Qt-testnet");
else
app.setApplicationName("Triangles-Qt");
// Show data directory selection dialog on first run (unless -datadir was passed)
if (!IntroDialog::pickDataDirectory())
return 0;
@@ -147,15 +155,6 @@ int main(int argc, char *argv[])
}
ReadConfigFile(mapArgs, mapMultiArgs);
// Application identification (must be set before OptionsModel is initialized,
// as it is used to locate QSettings)
app.setOrganizationName("Triangles");
//XXX app.setOrganizationDomain("");
if(GetBoolArg("-testnet")) // Separate UI settings for testnet
app.setApplicationName("Triangles-Qt-testnet");
else
app.setApplicationName("Triangles-Qt");
// ... then GUI settings:
OptionsModel optionsModel;
+1 -1
View File
@@ -53,7 +53,7 @@ static const int MEMPOOL_GD_VERSION = 60002;
#define DISPLAY_VERSION_MAJOR 5
#define DISPLAY_VERSION_MINOR 2
#define DISPLAY_VERSION_REVISION 0
#define DISPLAY_VERSION_REVISION 1
#define DISPLAY_VERSION_BUILD 0
#endif