github.com/amazechain/amc@v0.1.3/internal/consensus/errors.go (about) 1 // Copyright 2023 The AmazeChain Authors 2 // This file is part of the AmazeChain library. 3 // 4 // The AmazeChain library is free software: you can redistribute it and/or modify 5 // it under the terms of the GNU Lesser General Public License as published by 6 // the Free Software Foundation, either version 3 of the License, or 7 // (at your option) any later version. 8 // 9 // The AmazeChain library is distributed in the hope that it will be useful, 10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 // GNU Lesser General Public License for more details. 13 // 14 // You should have received a copy of the GNU Lesser General Public License 15 // along with the AmazeChain library. If not, see <http://www.gnu.org/licenses/>. 16 17 package consensus 18 19 import ( 20 "errors" 21 ) 22 23 var ( 24 // ErrUnknownAncestor is returned when validating a block requires an ancestor 25 // that is unknown. 26 ErrUnknownAncestor = errors.New("unknown ancestor") 27 28 // ErrUnknownAncestorTD is returned when validating a block requires an ancestor 29 // whose total difficulty is unknown. 30 ErrUnknownAncestorTD = errors.New("unknown ancestor TD") 31 32 // ErrPrunedAncestor is returned when validating a block requires an ancestor 33 // that is known, but the state of which is not available. 34 ErrPrunedAncestor = errors.New("pruned ancestor") 35 36 // ErrFutureBlock is returned when a block's timestamp is in the future according 37 // to the current node. 38 ErrFutureBlock = errors.New("block in the future") 39 40 // ErrInvalidNumber is returned if a block's number doesn't equal its parent's 41 // plus one. 42 ErrInvalidNumber = errors.New("invalid block number") 43 // ErrNotEnoughSign bls Sign 44 ErrNotEnoughSign = errors.New("not enough sign") 45 )