You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
567 B

  1. package core
  2. import (
  3. ctypes "github.com/tendermint/tendermint/rpc/core/types"
  4. rpctypes "github.com/tendermint/tendermint/rpc/lib/types"
  5. "github.com/tendermint/tendermint/types"
  6. )
  7. // BroadcastEvidence broadcasts evidence of the misbehavior.
  8. // More: https://docs.tendermint.com/master/rpc/#/Info/broadcast_evidence
  9. func BroadcastEvidence(ctx *rpctypes.Context, ev types.Evidence) (*ctypes.ResultBroadcastEvidence, error) {
  10. err := evidencePool.AddEvidence(ev)
  11. if err != nil {
  12. return nil, err
  13. }
  14. return &ctypes.ResultBroadcastEvidence{Hash: ev.Hash()}, nil
  15. }