From caaf528d14b92f5f8653348e0707f94ef927948b Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Fri, 13 Dec 2019 14:42:19 +0100 Subject: [PATCH] optimisation: break out of foreach loop if match found --- src/Controller/MainController.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Controller/MainController.php b/src/Controller/MainController.php index 9cb07ca..95c0b37 100644 --- a/src/Controller/MainController.php +++ b/src/Controller/MainController.php @@ -989,12 +989,14 @@ class MainController extends AppController { $parts = explode(':', $outpoint); if ($claim->transaction_hash_id == $parts[0] && $claim->vout == $parts[1]) { $claimIsBlocked = true; + break; } // check if the publisher (channel) is blocked // block the channel if that's the case if ($claimChannel && $claimChannel->transaction_hash_id == $parts[0] && $claimChannel->vout == $parts[1]) { $claimIsBlocked = true; + break; } }