Fixed a PrivValidator filename == nil bug
This commit is contained in:
parent
f91665fe07
commit
2405d00ca5
|
@ -82,7 +82,7 @@ type TxInput struct {
|
|||
Amount uint64 // Must not exceed account balance
|
||||
Sequence uint // Must be 1 greater than the last committed TxInput
|
||||
Signature Signature // Depends on the PubKey type and the whole Tx
|
||||
PubKey PubKey // Optional, may be nil
|
||||
PubKey PubKey // Must not be nil, may be PubKeyNil.
|
||||
}
|
||||
|
||||
func (txIn *TxInput) ValidateBasic() error {
|
||||
|
|
|
@ -40,7 +40,7 @@ func NewNode() *Node {
|
|||
// Get PrivValidator
|
||||
var privValidator *state_.PrivValidator
|
||||
if _, err := os.Stat(config.PrivValidatorFile()); err == nil {
|
||||
privValidator = state_.LoadPrivValidator()
|
||||
privValidator = state_.LoadPrivValidator(config.PrivValidatorFile())
|
||||
}
|
||||
|
||||
// Get PEXReactor
|
||||
|
|
|
@ -82,8 +82,8 @@ type PrivValidatorJSON struct {
|
|||
LastStep uint8
|
||||
}
|
||||
|
||||
func LoadPrivValidator() *PrivValidator {
|
||||
privValJSONBytes, err := ioutil.ReadFile(PrivValidatorFile())
|
||||
func LoadPrivValidator(filename string) *PrivValidator {
|
||||
privValJSONBytes, err := ioutil.ReadFile(filename)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
@ -112,6 +112,7 @@ func LoadPrivValidator() *PrivValidator {
|
|||
LastHeight: privValJSON.LastHeight,
|
||||
LastRound: privValJSON.LastRound,
|
||||
LastStep: privValJSON.LastStep,
|
||||
filename: filename,
|
||||
}
|
||||
if err != nil {
|
||||
panic(err)
|
||||
|
|
Loading…
Reference in New Issue