*: extend NotaryRequest verification errors

This change is compatible with the old protocol.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
This commit is contained in:
Anna Shaleva 2025-03-05 19:14:28 +03:00
parent e9f496a19f
commit 3ec14d2e8f
2 changed files with 6 additions and 2 deletions

View file

@ -2849,7 +2849,7 @@ func (bc *Blockchain) PoolTxWithData(t *transaction.Transaction, data any, mp *m
if verificationFunction != nil {
err := verificationFunction(t, data)
if err != nil {
return err
return fmt.Errorf("data verification failed: %w", err)
}
}
return bc.verifyAndPoolTx(t, mp, feer, data)

View file

@ -1325,7 +1325,11 @@ func (s *Server) RelayP2PNotaryRequest(r *payload.P2PNotaryRequest) error {
// verifyAndPoolNotaryRequest verifies NotaryRequest payload and adds it to the payload mempool.
func (s *Server) verifyAndPoolNotaryRequest(r *payload.P2PNotaryRequest) error {
return s.chain.PoolTxWithData(r.FallbackTransaction, r, s.notaryRequestPool, s.notaryFeer, s.verifyNotaryRequest)
err := s.chain.PoolTxWithData(r.FallbackTransaction, r, s.notaryRequestPool, s.notaryFeer, s.verifyNotaryRequest)
if err != nil {
return fmt.Errorf("failed to add fallback transaction to the notary pool: %w", err)
}
return nil
}
// verifyNotaryRequest is a function for state-dependant P2PNotaryRequest payload verification which is executed before ordinary blockchain's verification.