From 88ff13c241faff1d58e47f12bd283c112de7225a Mon Sep 17 00:00:00 2001 From: obscuren Date: Thu, 5 Mar 2015 19:51:25 +0100 Subject: Spec changes. * All errors during state transition result in an invalid tx --- core/error.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'core/error.go') diff --git a/core/error.go b/core/error.go index 514cd076b..04e40646c 100644 --- a/core/error.go +++ b/core/error.go @@ -146,3 +146,19 @@ func IsKnownBlockErr(e error) bool { _, ok := e.(*KnownBlockError) return ok } + +type ValueTransferError struct { + message string +} + +func ValueTransferErr(str string, v ...interface{}) *ValueTransferError { + return &ValueTransferError{fmt.Sprintf(str, v...)} +} + +func (self *ValueTransferError) Error() string { + return self.message +} +func IsValueTransferErr(e error) bool { + _, ok := e.(*ValueTransferError) + return ok +} -- cgit v1.2.3