From 5dced856e2f0a1a1d0d715848c5321564f4b5081 Mon Sep 17 00:00:00 2001 From: pxgamer Date: Tue, 9 Apr 2019 16:51:13 +0100 Subject: [PATCH 1/4] Fix reference to transaction limit in the API --- doc/api_data.js | 2 +- doc/api_data.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api_data.js b/doc/api_data.js index 8a4e33b..067ccac 100644 --- a/doc/api_data.js +++ b/doc/api_data.js @@ -905,7 +905,7 @@ define({ "api": [ "type": "numeric", "optional": true, "field": "limit", - "description": "

Number of confirmed transactions, max 1000, min 1

" + "description": "

Number of confirmed transactions, max 100, min 1

" } ] } diff --git a/doc/api_data.json b/doc/api_data.json index 834cc7e..2a491d7 100644 --- a/doc/api_data.json +++ b/doc/api_data.json @@ -905,7 +905,7 @@ "type": "numeric", "optional": true, "field": "limit", - "description": "

Number of confirmed transactions, max 1000, min 1

" + "description": "

Number of confirmed transactions, max 100, min 1

" } ] } From b3bec0961b9c720fd9e33bb30cc48cd5154b224e Mon Sep 17 00:00:00 2001 From: pxgamer Date: Tue, 9 Apr 2019 17:11:08 +0100 Subject: [PATCH 2/4] Remove limit 1000 reference from ApiDoc comments --- api.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api.php b/api.php index 2765ef5..facad54 100755 --- a/api.php +++ b/api.php @@ -185,7 +185,7 @@ if ($q == "getAddress") { * * @apiParam {string} [public_key] Public key * @apiParam {string} [account] Account id / address - * @apiParam {numeric} [limit] Number of confirmed transactions, max 1000, min 1 + * @apiParam {numeric} [limit] Number of confirmed transactions, max 100, min 1 * * @apiSuccess {string} block Block ID * @apiSuccess {numeric} confirmation Number of confirmations From 05ec0a1b38272eb1a6edd4ea36bf38bfeec9a9f6 Mon Sep 17 00:00:00 2001 From: arionum <34399752+arionum@users.noreply.github.com> Date: Thu, 27 Jun 2019 00:55:36 +0300 Subject: [PATCH 3/4] Update util.php bugfix resync --- util.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/util.php b/util.php index 71190d6..1224af8 100755 --- a/util.php +++ b/util.php @@ -471,7 +471,11 @@ elseif ($cmd == 'get-address') { if (empty($alias)) { $alias="A"; } - $rec=$db->single("SELECT SUM(val) FROM transactions WHERE (dst=:id or dst=:alias) AND (height<80000 OR (version!=100 AND version!=103)) and version<111", [":id"=>$x['id'], ":alias"=>$alias]); + $rec=$db->single("SELECT SUM(val) FROM transactions WHERE (dst=:id or dst=:alias) AND (height<80000 OR version!=100) and version<111", [":id"=>$x['id'], ":alias"=>$alias]); + $releases=$db->single("SELECT COUNT(1) FROM transactions WHERE dst=:id AND version=103", [":id"=>$x['id']]); + if($releases>0){ //masternode releases + $rec+=$releases*100000; + } $spent=$db->single("SELECT SUM(val+fee) FROM transactions WHERE public_key=:pub AND version>0", [":pub"=>$x['public_key']]); if ($spent==false) { $spent=0; From c9a1e60b57391d1247646f86346357ef983e05fb Mon Sep 17 00:00:00 2001 From: arionum <34399752+arionum@users.noreply.github.com> Date: Thu, 27 Jun 2019 00:57:31 +0300 Subject: [PATCH 4/4] Update sanity.php resync bugfix for masternode release --- sanity.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sanity.php b/sanity.php index d8cafa9..d73e3dc 100755 --- a/sanity.php +++ b/sanity.php @@ -657,7 +657,11 @@ if ($current['height'] < $largest_height && $largest_height > 1) { if (empty($alias)) { $alias="A"; } - $rec=$db->single("SELECT SUM(val) FROM transactions WHERE (dst=:id or dst=:alias) AND (height<80000 OR (version!=100 AND version!=103)) and version<111", [":id"=>$x['id'], ":alias"=>$alias]); + $rec=$db->single("SELECT SUM(val) FROM transactions WHERE (dst=:id or dst=:alias) AND (height<80000 OR version!=100) and version<111", [":id"=>$x['id'], ":alias"=>$alias]); + $releases=$db->single("SELECT COUNT(1) FROM transactions WHERE dst=:id AND version=103", [":id"=>$x['id']]); + if($releases>0){ //masternode releases + $rec+=$releases*100000; + } $spent=$db->single("SELECT SUM(val+fee) FROM transactions WHERE public_key=:pub AND version>0", [":pub"=>$x['public_key']]); if ($spent==false) { $spent=0;