Skip to content

Commit 7abfc03

Browse files
committed
fix for XRPLF#38
1 parent 0940843 commit 7abfc03

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/ripple/app/hook/Enum.h

+1
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ namespace hook
132132
NESTING_LIMIT = 84, // the hook nested blocks/loops/ifs beyond 16 levels
133133
SECTIONS_OUT_OF_SEQUENCE = 85, // the wasm contained sections out of sequence
134134
CUSTOM_SECTION_DISALLOWED = 86, // the wasm contained a custom section (id=0)
135+
INTERNAL_ERROR = 87, // an internal error described by the log text
135136
// RH NOTE: only HookSet msgs got log codes, possibly all Hook log lines should get a code?
136137
};
137138
};

src/ripple/app/tx/impl/SetHook.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -1260,7 +1260,13 @@ SetHook::setHook()
12601260

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

12651271
switch (op)
12661272
{

0 commit comments

Comments
 (0)