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.

26 lines
579 B

  1. package consensus
  2. import (
  3. . "github.com/tendermint/tendermint/blocks"
  4. db_ "github.com/tendermint/tendermint/db"
  5. . "github.com/tendermint/tendermint/state"
  6. )
  7. //-----------------------------------------------------------------------------
  8. type PrivValidator struct {
  9. PrivAccount
  10. db *db_.LevelDB
  11. }
  12. // Double signing results in a panic.
  13. func (pv *PrivValidator) Sign(o Signable) {
  14. switch o.(type) {
  15. case *Proposal:
  16. //TODO: prevent double signing.
  17. pv.PrivAccount.Sign(o.(*Proposal))
  18. case *Vote:
  19. //TODO: prevent double signing.
  20. pv.PrivAccount.Sign(o.(*Vote))
  21. }
  22. }