Documentation ¶
Index ¶
- Constants
- Variables
- func GetBip22Result(rerr error) (err error)
- func IsErrorCode(err error, errCode fmt.Stringer) bool
- func MakeError(code RejectCode, format string, innerErr error) error
- func New(errCode fmt.Stringer) error
- func NewError(errCode fmt.Stringer, desc string) error
- type ChainErr
- type DiskErr
- type InternalRejectCode
- type MemPoolErr
- type ProjectError
- type RPCErr
- type RejectCode
- type ScriptErr
- type TxErr
Constants ¶
View Source
const ( MempoolErrorBase = iota * 1000 ScriptErrorBase TxErrorBase ChainErrorBase RPCErrorBase DiskErrorBase )
Variables ¶
View Source
var ChainErrString = map[ChainErr]string{ ErrorBlockHeaderNoValid: "The block header is not valid", ErrorBlockHeaderNoParent: "Can not find this block header's father", ErrorBlockSize: "ErrorBlockSize", ErrorPowCheckErr: "ErrorPowCheckErr", ErrorBadTxnMrklRoot: "ErrorBadTxnMrklRoot", ErrorbadTxnsDuplicate: "ErrorbadTxnsDuplicate", ErrorBadBlkLength: "ErrorBadBlkLength", ErrorBadBlkTxSize: "ErrorBadBlkTxSize", ErrorBadBlkTx: "ErrorBadBlkTx", ErrorBlockAlreadyExists: "block already exists", ErrorBlockNotStartWithCoinBase: "block does not start with a coinbase", }
View Source
var DiskErrString = map[DiskErr]string{ ErrorOutOfDiskSpace: "ErrorOutOfDiskSpace", ErrorNotFindUndoFile: "ErrorNotFindUndoFile", ErrorFailedToWriteToCoinDatabase: "ErrorFailedToWriteToCoinDatabase", ErrorFailedToWriteToBlockIndexDatabase: "ErrorFailedToWriteToBlockIndexDatabase", SystemErrorWhileFlushing: "SystemErrorWhileFlushing", ErrorOpenUndoFileFailed: "ErrorOpenUndoFileFailed", FailedToReadBlock: "FailedToReadBlock", DisconnectTipUndoFailed: "DisconnectTipUndoFailed", ErrorOpenBlockDataDir: "ErrorOpenBlockDataDir", ErrorDeleteBlockFile: "ErrorDeleteBlockFile", }
Functions ¶
func GetBip22Result ¶ added in v0.0.3
Types ¶
type ChainErr ¶
type ChainErr int
const ( ErrorBlockHeaderNoValid ChainErr = ChainErrorBase + iota ErrorBlockHeaderNoParent ErrorBlockSize ErrorPowCheckErr ErrorBadTxnMrklRoot ErrorbadTxnsDuplicate ErrorBadBlkLength ErrorBadBlkTxSize ErrorBadBlkTx ErrorBlockAlreadyExists ErrorBlockNotStartWithCoinBase ErrorNotExistsInChainMap // errorTest )
type DiskErr ¶
type DiskErr int
const ( ErrorOutOfDiskSpace DiskErr = DiskErrorBase + iota ErrorNotFindUndoFile ErrorFailedToWriteToCoinDatabase ErrorFailedToWriteToBlockIndexDatabase SystemErrorWhileFlushing ErrorOpenUndoFileFailed FailedToReadBlock DisconnectTipUndoFailed ErrorOpenBlockDataDir ErrorDeleteBlockFile // ErrorNotExistsInDiskMap used in error test ErrorNotExistsInDiskMap )
type InternalRejectCode ¶ added in v0.0.3
type InternalRejectCode int
const ( RejectHighFee InternalRejectCode = 0x100 RejectAlreadyKnown InternalRejectCode = 0x101 RejectConflict InternalRejectCode = 0x102 )
func (InternalRejectCode) String ¶ added in v0.0.3
func (code InternalRejectCode) String() string
String returns the RejectCode in human-readable form.
type MemPoolErr ¶
type MemPoolErr int
const ( MissParent MemPoolErr = MempoolErrorBase + iota RejectTx AlreadHaveTx Nomature ManyUnspendDepend ErrorNotExistsInMemMap )
func (MemPoolErr) String ¶
func (me MemPoolErr) String() string
type ProjectError ¶
func (ProjectError) Error ¶
func (e ProjectError) Error() string
type RPCErr ¶
type RPCErr int
const ( ModelValid RPCErr = RPCErrorBase + iota ModelInvalid ModelError ErrorNotExistInRPCMap )
type RejectCode ¶ added in v0.0.3
type RejectCode uint8
RejectCode represents a numeric value by which a remote peer indicates why a message was rejected.
const ( RejectMalformed RejectCode = 0x01 RejectInvalid RejectCode = 0x10 RejectObsolete RejectCode = 0x11 RejectDuplicate RejectCode = 0x12 RejectNonstandard RejectCode = 0x40 RejectDust RejectCode = 0x41 RejectInsufficientFee RejectCode = 0x42 RejectCheckpoint RejectCode = 0x43 )
These constants define the various supported reject codes.
func IsRejectCode ¶ added in v0.0.3
func IsRejectCode(err error) (RejectCode, string, bool)
IsRejectCode BIP61 reject code; never send internal reject codes over P2P.
func (RejectCode) String ¶ added in v0.0.3
func (code RejectCode) String() string
String returns the RejectCode in human-readable form.
type ScriptErr ¶
type ScriptErr int
const ( ScriptErrOK ScriptErr = ScriptErrorBase + iota ScriptErrUnknownError ScriptErrEvalFalse ScriptErrOpReturn ScriptErrScriptSize ScriptErrPushSize ScriptErrOpCount ScriptErrStackSize ScriptErrSigCount ScriptErrPubKeyCount ScriptErrInvalidOperandSize ScriptErrInvalidNumberRange ScriptErrImpossibleEncoding ScriptErrInvalidSplitRange ScriptErrVerify ScriptErrEqualVerify ScriptErrCheckMultiSigVerify ScriptErrCheckSigVerify ScriptErrCheckDataSigVerify ScriptErrNumEqualVerify ScriptErrBadOpCode ScriptErrDisabledOpCode ScriptErrInvalidStackOperation ScriptErrInvalidAltStackOperation ScriptErrUnbalancedConditional ScriptErrDivByZero ScriptErrModByZero ScriptErrNegativeLockTime ScriptErrUnsatisfiedLockTime ScriptErrSigHashType ScriptErrSigDer ScriptErrMinimalData ScriptErrSigPushOnly ScriptErrSigHighs ScriptErrSigNullDummy ScriptErrPubKeyType ScriptErrCleanStack ScriptErrMinimalIf ScriptErrSigNullFail ScriptErrDiscourageUpgradableNops ScriptErrDiscourageUpgradableWitnessProgram ScriptErrNonCompressedPubKey ScriptErrIllegalForkID ScriptErrMustUseForkID ScriptErrErrorCount // ScriptErrSize other errcode ScriptErrSize ScriptErrNonStandard ScriptErrNullData ScriptErrBareMultiSig ScriptErrMultiOpReturn ScriptErrInvalidSignatureEncoding ScriptErrInvalidOpCode ScriptErrInValidPubKeyOrSig ScriptErrScriptSigNotPushOnly )
Click to show internal directories.
Click to hide internal directories.