mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-03-12 23:18:36 +00:00
*: 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:
parent
e9f496a19f
commit
3ec14d2e8f
2 changed files with 6 additions and 2 deletions
|
@ -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)
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Add table
Reference in a new issue