mirror of
https://repo.getmonero.org/AnonDev/xmrmemes.git
synced 2024-12-30 09:56:11 -05:00
Fix issue with multiple payments
If someone sent multiple Monero transactions in 1 tx, it was only getting the first one. Monero GUI wallet and Cake Wallet support this feature but xmrmemes did not. This should be fixed now. All past multi-payments that were not counted will be counted and the meme creators will recieve the XMR.
This commit is contained in:
parent
87ef210e1f
commit
af59aaf236
@ -71,7 +71,10 @@ class ProcessPayments implements ShouldQueue
|
||||
if (isset($get_transfers['in'])) {
|
||||
foreach ($get_transfers['in'] as $transfer) {
|
||||
$meme = Meme::where('address', $transfer['address'])->first();
|
||||
$tip_exists = Tip::where('txid', $transfer['txid'])->first();
|
||||
$tip_exists = Tip::where([
|
||||
'meme_id' => $meme->id,
|
||||
'txid' => $transfer['txid'],
|
||||
])->first();
|
||||
if ($meme && !$tip_exists) {
|
||||
$tip = new Tip();
|
||||
$tip->meme_id = $meme->id;
|
||||
|
34
database/migrations/2021_09_27_233956_edit_tips_table.php
Normal file
34
database/migrations/2021_09_27_233956_edit_tips_table.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class EditTipsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('tips', function (Blueprint $table) {
|
||||
$table->dropUnique(['txid']);
|
||||
$table->unique(['meme_id', 'txid']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('tips', function (Blueprint $table) {
|
||||
$table->dropUnique(['meme_id', 'txid']);
|
||||
$table->unique(['txid']);
|
||||
});
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user