From 3884a2a0ca4913a113ce7a6d076af64caa3f3478 Mon Sep 17 00:00:00 2001 From: Victor Bodinaud Date: Sat, 30 Nov 2024 11:38:26 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=AC=20Add=20logs=20to=20mempool?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SwiftChain/Models/MemPool.swift | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/SwiftChain/Models/MemPool.swift b/SwiftChain/Models/MemPool.swift index dbd155e..1e4edee 100644 --- a/SwiftChain/Models/MemPool.swift +++ b/SwiftChain/Models/MemPool.swift @@ -31,6 +31,7 @@ class MemPool { private func validateTransaction(_ transaction: Transaction) -> Bool { // Vérifications basiques if transaction.amount <= 0 { + print("MemPool: Transaction refusée - montant invalide") return false } @@ -41,11 +42,18 @@ class MemPool { // Vérifier la signature if !transaction.isSignatureValid() { + print("MemPool: Transaction refusée - signature invalide") return false } // Vérifier le solde - return accountManager.canProcessTransaction(transaction) + if !accountManager.canProcessTransaction(transaction) { + print("MemPool: Transaction refusée - solde insuffisant") + return false + } + + print("MemPool: Transaction validée avec succès") + return true } /**