Skip to content

Commit

Permalink
added fix for handling burn txs better
Browse files Browse the repository at this point in the history
  • Loading branch information
dan13ram committed Jun 10, 2024
1 parent d89372d commit a2bf334
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pokt/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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
}
Expand Down
8 changes: 8 additions & 0 deletions pokt/signer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit a2bf334

Please sign in to comment.