diff --git a/src/BlockchainApi/BchdProtoGatewayApi.php b/src/BlockchainApi/BchdProtoGatewayApi.php index 29f04e3..e4411d1 100644 --- a/src/BlockchainApi/BchdProtoGatewayApi.php +++ b/src/BlockchainApi/BchdProtoGatewayApi.php @@ -95,7 +95,7 @@ public function getAddressDetails(string $address): ?BchAddress { if ($response === false) return null; $jsonRes = json_decode($response); - if ($jsonRes === null) // empty object if address is unknown = valid response + if ($jsonRes === null || $response === '{}') // empty object if address is unknown = valid response return null; else if (isset($jsonRes->error) && $jsonRes->error) { $this->logError("Error on receiving BCH address details", $jsonRes->error); @@ -124,8 +124,8 @@ public function getSlpAddressDetails(string $address, string $tokenID): ?SlpToke if ($response === false) return null; $jsonRes = json_decode($response); - if ($jsonRes === null) // empty object if address is unknown = valid response - return null; + if ($jsonRes === null || $response === '{}') + return null; // empty object if address is unknown = valid response, check again later once a TX with this token happened else if (isset($jsonRes->error) && $jsonRes->error) { $this->logError("Error on receiving SLP address details", $jsonRes->error); return null;