func (p *Peer) SetVoteRequestState(state int) {
	p.mutex.Lock()
	defer p.mutex.Unlock()
	p.voteRequestState = state
}
SetVoteRequestState set current state about votion
package raft
import (
	"sync"
	"time"
	pb "github.com/moxiaomomo/goRaft/proto"
	"github.com/moxiaomomo/goRaft/util/logger"
	"golang.org/x/net/context"
	"google.golang.org/grpc"
)
type Peer struct {
	server           *server
	Name             string
	Host             string
	voteRequestState int
	lastActivity      time.Time
	heartbeatInterval time.Duration
	mutex sync.RWMutex
}
type RequestVoteRespChan struct {
	Failed   bool
	Resp     *pb.VoteResponse
	PeerHost string
	PeerName string
}
type AppendLogRespChan struct {
	Failed   bool
	Resp     *pb.AppendEntriesResponse
	PeerHost string
	PeerName string
}
func NewPeer(server *server, name, host string, heartbeatInterval time.Duration) *Peer {
	return &Peer{
		server:            server,
		Name:              name,
		Host:              host,
		voteRequestState:  NotYetVote,
		heartbeatInterval: heartbeatInterval,
	}
}