From 5a8b2a6d75c91d232e4ac6b90dc8d06a64ac2c8c Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 19 Jun 2023 14:02:06 +0800 Subject: [PATCH] 1 --- webapp/services/BlockChainService.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/webapp/services/BlockChainService.php b/webapp/services/BlockChainService.php index 915c23cf..5d69381a 100644 --- a/webapp/services/BlockChainService.php +++ b/webapp/services/BlockChainService.php @@ -4,6 +4,12 @@ namespace services; class BlockChainService { + /* + 注意!!!: + 调用方调用前需要校验actionType和myself()->_getAddress, + 非法的参数,或者签名服挂了,该函数直接中断请求,不会运行到调用方后续逻辑 + */ + public static function gameItemMallBuy($actionType, $price, $itemId, $itemNum) { if (!($actionType > Transaction::BUY_BEGIN_ACTION_TYPE && @@ -14,6 +20,12 @@ class BlockChainService { return; } $account = myself()->_getAddress(); + if (empty($account)) { + error_log('gameItemMallBuy address is emtpy:' . myself()->_getAccountId()); + myself()->_rspErr(500, 'server internal error'); + die(); + return; + } $params = array( 'c' => 'GameItemMall', 'a' => 'buy',