Skip to content

Commit

Permalink
fix for XRPLF#38
Browse files Browse the repository at this point in the history
  • Loading branch information
RichardAH committed Mar 7, 2023
1 parent 0940843 commit 7abfc03
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/ripple/app/hook/Enum.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ namespace hook
NESTING_LIMIT = 84, // the hook nested blocks/loops/ifs beyond 16 levels
SECTIONS_OUT_OF_SEQUENCE = 85, // the wasm contained sections out of sequence
CUSTOM_SECTION_DISALLOWED = 86, // the wasm contained a custom section (id=0)
INTERNAL_ERROR = 87, // an internal error described by the log text
// RH NOTE: only HookSet msgs got log codes, possibly all Hook log lines should get a code?
};
};
Expand Down
8 changes: 7 additions & 1 deletion src/ripple/app/tx/impl/SetHook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1260,7 +1260,13 @@ SetHook::setHook()

// if there is only an existing hook, without a HookSetObj then it is
// logically impossible for the operation to not be NOOP
assert(hookSetObj || op == hsoNOOP);
if(!hookSetObj && op != hsoNOOP)
{
JLOG(ctx.j.warn())
<< "HookSet(" << hook::log::INTERNAL_ERROR << ")[" << HS_ACC()
<< "]: Logic error. !hookSetObj && op != hsoNOOP";
return tecINTERNAL;
}

switch (op)
{
Expand Down

0 comments on commit 7abfc03

Please sign in to comment.