Merge pull request #2426 from nspcc-dev/notary-ignore-erralreadyexists

cli/server: don't spit out error if notary request already exists
This commit is contained in:
Roman Khimov 2022-04-05 18:41:17 +03:00 committed by GitHub
commit 0c3327af25
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -439,7 +439,8 @@ func mkP2PNotary(config network.ServerConfig, chain *core.Blockchain, serv *netw
Log: log,
}
n, err := notary.NewNotary(cfg, serv.Net, serv.GetNotaryPool(), func(tx *transaction.Transaction) error {
if err := serv.RelayTxn(tx); err != nil {
err := serv.RelayTxn(tx)
if err != nil && !errors.Is(err, core.ErrAlreadyExists) {
return fmt.Errorf("can't relay completed notary transaction: hash %s, error: %w", tx.Hash().StringLE(), err)
}
return nil