From 0ca4dcd78665bc5258a2b9cfcef0dcdf971a88c3 Mon Sep 17 00:00:00 2001 From: Bruno Garcia Date: Thu, 22 Jan 2026 10:04:29 -0300 Subject: [PATCH] script: add SCRIPT_ERR_SCRIPTNUM error It will be used for errors related to CScriptNum (e.g. overflow or encoding errors). Currently, we simply return unknown error for these errors. --- src/script/script_error.cpp | 2 ++ src/script/script_error.h | 1 + 2 files changed, 3 insertions(+) diff --git a/src/script/script_error.cpp b/src/script/script_error.cpp index a6707638e46..b0e7a6e10ec 100644 --- a/src/script/script_error.cpp +++ b/src/script/script_error.cpp @@ -117,6 +117,8 @@ std::string ScriptErrorString(const ScriptError serror) return "Using OP_CODESEPARATOR in non-witness script"; case SCRIPT_ERR_SIG_FINDANDDELETE: return "Signature is found in scriptCode"; + case SCRIPT_ERR_SCRIPTNUM: + return "Script number overflowed or is non-minimally encoded"; case SCRIPT_ERR_UNKNOWN_ERROR: case SCRIPT_ERR_ERROR_COUNT: default: break; diff --git a/src/script/script_error.h b/src/script/script_error.h index 58ac7db5393..23de3b1758e 100644 --- a/src/script/script_error.h +++ b/src/script/script_error.h @@ -14,6 +14,7 @@ typedef enum ScriptError_t SCRIPT_ERR_UNKNOWN_ERROR, SCRIPT_ERR_EVAL_FALSE, SCRIPT_ERR_OP_RETURN, + SCRIPT_ERR_SCRIPTNUM, /* Max sizes */ SCRIPT_ERR_SCRIPT_SIZE,