From d53b640c2d41e83f258ea5c2942de6a5964ea470 Mon Sep 17 00:00:00 2001 From: Patrick Lodder Date: Sun, 18 Feb 2024 08:55:18 -0500 Subject: [PATCH] qt: fix qt4 compile error f0f50cf9c introduced a compile error on qt4 because qHash only takes an int argument from qt5+. This fixes that by converting the seed into a string and both prepending and appending the seed to the datadir whenever compiling on qt4. --- src/qt/paymentserver.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/qt/paymentserver.cpp b/src/qt/paymentserver.cpp index 81217f106..832cc6ef1 100644 --- a/src/qt/paymentserver.cpp +++ b/src/qt/paymentserver.cpp @@ -87,7 +87,12 @@ static QString ipcServerName() // Note that GetDataDir(true) returns a different path // for -testnet versus main net QString ddir(GUIUtil::boostPathToQString(GetDataDir(true))); +#if QT_VERSION >= 0x050000 name.append(QString::number(qHash(ddir, IPC_SOCKET_HASH))); +#else + QString rseed = QString::number(IPC_SOCKET_HASH); + name.append(QString::number(qHash(rseed + ddir + rseed))); +#endif //QT_VERSION >= 0x050000 return name; }