mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-10 23:58:17 +02:00
Merge bitcoin/bitcoin#34381: script: return proper error for CScriptNum errors
6f7b4323cbtest: remove UNKNOWN_ERROR from script_tests (Bruno Garcia)bd31a92d67script: use SCRIPT_ERR_SCRIPTNUM for CScriptNum errors (Bruno Garcia)0ca4dcd786script: add SCRIPT_ERR_SCRIPTNUM error (Bruno Garcia) Pull request description: When evaluating a script, the current code is bad for analyzing some errors because it returns `SCRIPT_ERR_UNKNOWN_ERROR` for errors that are clearly known. `CScriptNum` has two well defined errors: number overflow and non-minimally encoded number. However, for both errors we return as unknown. This PR changes it by adding a new ScriptError that is used for any `CScriptNum` error. ACKs for top commit: achow101: ACK6f7b4323cbw0xlt: ACK6f7b4323cbdarosior: ACK6f7b4323cbTree-SHA512: e656d9992251fbc95d33966fa18ce64bf714179d51ba6a7f429e5a55bc58e7fc08827e4ab71ace0dd385dac7e1feaea621b49503387793a30eae7a7e44aa6b0f
This commit is contained in:
@@ -52,7 +52,6 @@ struct ScriptErrorDesc
|
||||
|
||||
static ScriptErrorDesc script_errors[]={
|
||||
{SCRIPT_ERR_OK, "OK"},
|
||||
{SCRIPT_ERR_UNKNOWN_ERROR, "UNKNOWN_ERROR"},
|
||||
{SCRIPT_ERR_EVAL_FALSE, "EVAL_FALSE"},
|
||||
{SCRIPT_ERR_OP_RETURN, "OP_RETURN"},
|
||||
{SCRIPT_ERR_SCRIPT_SIZE, "SCRIPT_SIZE"},
|
||||
@@ -95,6 +94,7 @@ static ScriptErrorDesc script_errors[]={
|
||||
{SCRIPT_ERR_TAPSCRIPT_EMPTY_PUBKEY, "TAPSCRIPT_EMPTY_PUBKEY"},
|
||||
{SCRIPT_ERR_OP_CODESEPARATOR, "OP_CODESEPARATOR"},
|
||||
{SCRIPT_ERR_SIG_FINDANDDELETE, "SIG_FINDANDDELETE"},
|
||||
{SCRIPT_ERR_SCRIPTNUM, "SCRIPTNUM"}
|
||||
};
|
||||
|
||||
static std::string FormatScriptFlags(script_verify_flags flags)
|
||||
|
||||
Reference in New Issue
Block a user