From 59c98c4d093b40222b26d30b01c3256f41af8c68 Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Wed, 15 May 2024 14:03:20 +0300 Subject: [PATCH] core: always warn if accepted transaction fails verification These warnings must be monitored by developers since it might be a sign of behaviour difference between Go and C# nodes. Signed-off-by: Anna Shaleva --- pkg/core/blockchain.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/core/blockchain.go b/pkg/core/blockchain.go index 3df35e004..ce27ddf3d 100644 --- a/pkg/core/blockchain.go +++ b/pkg/core/blockchain.go @@ -1515,8 +1515,11 @@ func (bc *Blockchain) AddBlock(block *block.Block) error { } else { err = bc.verifyAndPoolTx(tx, mp, bc) } - if err != nil && bc.config.VerifyTransactions { - return fmt.Errorf("transaction %s failed to verify: %w", tx.Hash().StringLE(), err) + if err != nil { + if bc.config.VerifyTransactions { + return fmt.Errorf("transaction %s failed to verify: %w", tx.Hash().StringLE(), err) + } + bc.log.Warn(fmt.Sprintf("transaction %s failed to verify: %s", tx.Hash().StringLE(), err)) } } }