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.
 
 
 
 
 
 

30 lines
705 B

package consensus
import (
. "github.com/tendermint/tendermint/blocks"
db_ "github.com/tendermint/tendermint/db"
"github.com/tendermint/tendermint/state"
)
//-----------------------------------------------------------------------------
type PrivValidator struct {
db db_.DB
state.PrivAccount
}
func NewPrivValidator(db db_.DB, priv *state.PrivAccount) *PrivValidator {
return &PrivValidator{db, *priv}
}
// Double signing results in a panic.
func (pv *PrivValidator) Sign(o Signable) {
switch o.(type) {
case *Proposal:
//TODO: prevent double signing && test.
pv.PrivAccount.Sign(o.(*Proposal))
case *Vote:
//TODO: prevent double signing && test.
pv.PrivAccount.Sign(o.(*Vote))
}
}