Procházet zdrojové kódy

raft : `newRaft()` does check for validity of `Config`

nilsocket před 7 roky
rodič
revize
0d99469cdb
1 změnil soubory, kde provedl 0 přidání a 3 odebrání
  1. 0 3
      raft/rawnode.go

+ 0 - 3
raft/rawnode.go

@@ -45,9 +45,6 @@ type RawNode struct {
 // state manually by setting up a Storage that has a first index > 1 and which
 // state manually by setting up a Storage that has a first index > 1 and which
 // stores the desired ConfState as its InitialState.
 // stores the desired ConfState as its InitialState.
 func NewRawNode(config *Config) (*RawNode, error) {
 func NewRawNode(config *Config) (*RawNode, error) {
-	if config.ID == 0 {
-		panic("config.ID must not be zero")
-	}
 	r := newRaft(config)
 	r := newRaft(config)
 	rn := &RawNode{
 	rn := &RawNode{
 		raft: r,
 		raft: r,