From a2bf334ef6d188cf53e6beb9c2e99b9963da1f7e Mon Sep 17 00:00:00 2001 From: dan13ram Date: Tue, 23 Jan 2024 21:03:12 +0530 Subject: [PATCH] added fix for handling burn txs better --- pokt/executor.go | 4 ++-- pokt/signer.go | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/pokt/executor.go b/pokt/executor.go index 5bf6849..42717ff 100644 --- a/pokt/executor.go +++ b/pokt/executor.go @@ -61,7 +61,7 @@ func (x *BurnExecutorRunner) HandleInvalidMint(doc *models.InvalidMint) bool { return false } - if res == nil || res.TransactionHash == "" { + if res == nil || strings.TrimSpace(res.TransactionHash) == "" { log.Error("[BURN EXECUTOR] Invalid mint return tx hash not found") return false } @@ -152,7 +152,7 @@ func (x *BurnExecutorRunner) HandleBurn(doc *models.Burn) bool { return false } - if res == nil || res.TransactionHash == "" { + if res == nil || strings.TrimSpace(res.TransactionHash) == "" { log.Error("[BURN EXECUTOR] Burn return tx hash not found") return false } diff --git a/pokt/signer.go b/pokt/signer.go index 5cadf4d..3432684 100644 --- a/pokt/signer.go +++ b/pokt/signer.go @@ -164,6 +164,10 @@ func (x *BurnSignerRunner) HandleInvalidMint(doc *models.InvalidMint) bool { "updated_at": time.Now(), }, } + if doc.Confirmations == "0" { + log.Debug("[BURN SIGNER] Invalid mint has no confirmations, skipping") + return false + } } else { if doc.Status == models.StatusConfirmed { @@ -296,6 +300,10 @@ func (x *BurnSignerRunner) HandleBurn(doc *models.Burn) bool { "updated_at": time.Now(), }, } + if doc.Confirmations == "0" { + log.Debug("[BURN SIGNER] Burn has no confirmations, skipping") + return false + } } else { if doc.Status == models.StatusConfirmed {