2014-09-04 03:32:38 -07:00
|
|
|
package consensus
|
|
|
|
|
|
|
|
import (
|
2014-09-07 02:21:25 -07:00
|
|
|
. "github.com/tendermint/tendermint/blocks"
|
2014-09-04 03:32:38 -07:00
|
|
|
db_ "github.com/tendermint/tendermint/db"
|
|
|
|
. "github.com/tendermint/tendermint/state"
|
|
|
|
)
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
type PrivValidator struct {
|
|
|
|
PrivAccount
|
|
|
|
db *db_.LevelDB
|
|
|
|
}
|
|
|
|
|
2014-10-07 23:11:04 -07:00
|
|
|
// Double signing results in a panic.
|
|
|
|
func (pv *PrivValidator) Sign(o Signable) {
|
|
|
|
switch o.(type) {
|
|
|
|
case *Proposal:
|
|
|
|
//TODO: prevent double signing.
|
|
|
|
pv.PrivAccount.Sign(o.(*Proposal))
|
|
|
|
case *Vote:
|
|
|
|
//TODO: prevent double signing.
|
|
|
|
pv.PrivAccount.Sign(o.(*Vote))
|
|
|
|
}
|
2014-09-04 03:32:38 -07:00
|
|
|
}
|