From d9082b8826148ffbe140ab9bc5b07218aeabf9d5 Mon Sep 17 00:00:00 2001 From: "Vladimir N. Korotenko" Date: Tue, 25 Nov 2025 19:54:36 +0300 Subject: [PATCH] Close #16 fix ulong compare with int --- dm-cli/.vscode/launch.json | 10 ++++++---- dm-cli/Deals.cpp | 7 ++++++- dm-cli/common.hpp | 2 +- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/dm-cli/.vscode/launch.json b/dm-cli/.vscode/launch.json index 85c70b7..5fb8163 100644 --- a/dm-cli/.vscode/launch.json +++ b/dm-cli/.vscode/launch.json @@ -11,12 +11,14 @@ "type": "cppdbg", "request": "launch", "program": "${workspaceFolder}/dm-cli", - "args": [ "--address", - "https://testnet-dm2.bitdeals.org", - "--debug", + "args": [ + "--address", + "https://testnet-dm2.bitdeals.org", + "--debug", "deal", "status", - "2NDkN9PWdvf8T3AFe57vDsQX9qeJG5Y5iJW" + "--is-paid", + "2N1t5Pe45KCRMtXAQ9P9LiHAzdB5Nq4djhR" ], "stopAtEntry": false, diff --git a/dm-cli/Deals.cpp b/dm-cli/Deals.cpp index b35fdcd..3cb2ace 100644 --- a/dm-cli/Deals.cpp +++ b/dm-cli/Deals.cpp @@ -244,7 +244,12 @@ int Deals::Status() string payload = base64_decode(jsonData["payload"]); stream << payload << endl; // order: Paid, order: Completed, order: Executed - if (payload.find("Paid") >= 0 || payload.find("Completed") >= 0 || payload.find("Executed") >= 0) + + int pos = 0; + pos = payload.find("Paid"); + pos = payload.find("Completed"); + pos = payload.find("Executed"); + if ((int)payload.find("Paid") != -1 || (int)payload.find("Completed") != -1 || (int)payload.find("Executed") != -1) { isPayment = true; } diff --git a/dm-cli/common.hpp b/dm-cli/common.hpp index a6ee6a0..25e8da0 100644 --- a/dm-cli/common.hpp +++ b/dm-cli/common.hpp @@ -29,7 +29,7 @@ // LANG=ru_RU.UTF-8 #define LANG_RU "ru_RU.UTF-8" -#define DEFAULTADDRESS "http://127.0.0.1:4999" +#define DEFAULTADDRESS "127.0.0.1:4999" #define ACCOUNT_UPDATE_URL "tpl/accountupdateurl.txt" #define ACCOUNT_UPDATE_BTM "tpl/accountupdatebtm.txt"