From 63f85419364c2eeccdf403a41ac8d92caf9fd575 Mon Sep 17 00:00:00 2001 From: Dario Rekowski on RockPI Date: Tue, 12 May 2020 13:01:22 +0000 Subject: [PATCH] fix validation for new creation protocol --- src/Model/Transactions/TransactionCreation.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Model/Transactions/TransactionCreation.php b/src/Model/Transactions/TransactionCreation.php index 56b289d70..19985314f 100644 --- a/src/Model/Transactions/TransactionCreation.php +++ b/src/Model/Transactions/TransactionCreation.php @@ -168,12 +168,17 @@ class TransactionCreation extends TransactionBase { $existingCreations2->where([ 'target_date IS NOT' => NULL, - 'EXTRACT(YEAR_MONTH FROM target_date) LIKE ' => $targetDateMonthYearConcat + 'EXTRACT(YEAR_MONTH FROM target_date) LIKE ' => $targetDateMonthYearConcat, ]); $newSum2 = $this->getAmount(); foreach($existingCreations2 as $creation) { - $newSum2 += $creation->amount; + $keyHex = bin2hex(stream_get_contents($creation->state_user->public_key)); + //echo "\ncompare \n$keyHex\nwith: \n". $this->receiver_pubkey_hex."\n"; + if($keyHex == $this->receiver_pubkey_hex) { + $newSum2 += $creation->amount; + } + //$newSum2 += $creation->amount; } /*if(!$existingCreations2->count()) {