Skip to content

Commit

Permalink
fix for XRPLF#25
Browse files Browse the repository at this point in the history
  • Loading branch information
RichardAH committed Feb 20, 2023
1 parent b75b9f2 commit a264120
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions src/ripple/app/hook/impl/applyHook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3246,8 +3246,6 @@ DEFINE_HOOK_FUNCTION(
return EMISSION_FAILURE;
}

hookCtx.result.emittedTxn.push(tpTrans);

auto const& txID =
tpTrans->getID();

Expand All @@ -3257,11 +3255,22 @@ DEFINE_HOOK_FUNCTION(
if (NOT_IN_BOUNDS(write_ptr, txID.size(), memory_length))
return OUT_OF_BOUNDS;

WRITE_WASM_MEMORY_AND_RETURN(
write_ptr, txID.size(),
txID.data(), txID.size(),
memory, memory_length);


auto const write_txid = [&]() -> int64_t
{
WRITE_WASM_MEMORY_AND_RETURN(
write_ptr, txID.size(),
txID.data(), txID.size(),
memory, memory_length);
};

int64_t result = write_txid();

if (result == 32)
hookCtx.result.emittedTxn.push(tpTrans);

return result;
HOOK_TEARDOWN();
}

Expand Down

0 comments on commit a264120

Please sign in to comment.