fix validation for new creation protocol

This commit is contained in:
Dario Rekowski on RockPI 2020-05-12 13:01:22 +00:00
parent e0aa06744e
commit 63f8541936

View File

@ -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()) {