mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-12-04 19:19:44 +00:00
493d8f3d95
* [chain] - Add basic chain cfg parameters - Added logic to insert genesis block, if it is a fresh database - changed SaveBlock to ProcessBlock - changed SaveHeaders to ProcessHeaders - Changed parameter from a wire message to the payload, for header and block processing - Added check in chain for when the block is in the future, i.e. not at the tip of the chain - Added custom error returns, to distinguish between a database error and a validation error
19 lines
361 B
Go
19 lines
361 B
Go
package chain
|
|
|
|
// ValidationError occurs when verificatio of the object fails
|
|
type ValidationError struct {
|
|
msg string
|
|
}
|
|
|
|
func (v ValidationError) Error() string {
|
|
return v.msg
|
|
}
|
|
|
|
// DatabaseError occurs when the chain fails to save the object in the database
|
|
type DatabaseError struct {
|
|
msg string
|
|
}
|
|
|
|
func (d DatabaseError) Error() string {
|
|
return d.msg
|
|
}
|