From 1cb01182ae1c1168c7c3f83b73d059278133f5d5 Mon Sep 17 00:00:00 2001 From: Dario Rekowski on RockPI Date: Tue, 6 Jul 2021 13:58:56 +0000 Subject: [PATCH] add api/getDecayStartBlock function --- .../src/Controller/AppRequestsController.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/community_server/src/Controller/AppRequestsController.php b/community_server/src/Controller/AppRequestsController.php index 15c68cece..018e0af49 100644 --- a/community_server/src/Controller/AppRequestsController.php +++ b/community_server/src/Controller/AppRequestsController.php @@ -393,6 +393,16 @@ class AppRequestsController extends AppController $this->set('body', $body); } + public function getDecayStartBlock() + { + $transactionsTable = TableRegistry::getTableLocator()->get('Transactions'); + $decayStartBlock = $transactionsTable->find()->where(['transaction_type_id' => 9]); + if(!$decayStartBlock->count()) { + return $this->returnJson(['state' => 'error', 'msg' => 'not found']); + } + return $this->returnJson(['state' => 'success', 'decay_start' => $decayStartBlock->first()->received]); + } + private function acquireAccessToken($session_id) {