github.com/codingfuture/orig-energi3@v0.8.4/consensus/errors.go (about)

     1  // Copyright 2018 The Energi Core Authors
     2  // Copyright 2017 The go-ethereum Authors
     3  // This file is part of the Energi Core library.
     4  //
     5  // The Energi Core library is free software: you can redistribute it and/or modify
     6  // it under the terms of the GNU Lesser General Public License as published by
     7  // the Free Software Foundation, either version 3 of the License, or
     8  // (at your option) any later version.
     9  //
    10  // The Energi Core library is distributed in the hope that it will be useful,
    11  // but WITHOUT ANY WARRANTY; without even the implied warranty of
    12  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    13  // GNU Lesser General Public License for more details.
    14  //
    15  // You should have received a copy of the GNU Lesser General Public License
    16  // along with the Energi Core library. If not, see <http://www.gnu.org/licenses/>.
    17  
    18  package consensus
    19  
    20  import "errors"
    21  
    22  var (
    23  	// ErrUnknownAncestor is returned when validating a block requires an ancestor
    24  	// that is unknown.
    25  	ErrUnknownAncestor = errors.New("unknown ancestor")
    26  
    27  	// ErrPrunedAncestor is returned when validating a block requires an ancestor
    28  	// that is known, but the state of which is not available.
    29  	ErrPrunedAncestor = errors.New("pruned ancestor")
    30  
    31  	// ErrFutureBlock is returned when a block's timestamp is in the future according
    32  	// to the current node.
    33  	ErrFutureBlock = errors.New("block in the future")
    34  
    35  	// ErrInvalidNumber is returned if a block's number doesn't equal it's parent's
    36  	// plus one.
    37  	ErrInvalidNumber = errors.New("invalid block number")
    38  
    39  	// ErrMissingState is returned when database is missing state root which is required
    40  	// for block validation.
    41  	ErrMissingState = errors.New("missing state")
    42  
    43  	// ErrDoSThrottle is returned when DoS protection gets triggered.
    44  	ErrDoSThrottle = errors.New("dos throttle")
    45  
    46  	// Issue in consensus transactions
    47  	ErrInvalidConsensusTx = errors.New("wrong consensus tx")
    48  )