diff --git a/src/ripple/app/tx/applyHook.h b/src/ripple/app/tx/applyHook.h index 2ed884158..87a3d998b 100644 --- a/src/ripple/app/tx/applyHook.h +++ b/src/ripple/app/tx/applyHook.h @@ -508,7 +508,6 @@ namespace hook ripple::TER setHookState( - HookResult& hookResult, ripple::ApplyContext& applyCtx, ripple::AccountID const& acc, ripple::uint256 const& ns, @@ -527,7 +526,8 @@ namespace hook ripple::TER finalizeHookState( std::shared_ptr&, - ripple::ApplyContext&); + ripple::ApplyContext&, + ripple::uint256 const&); // if the txn being executed was an emitted txn then this removes it from the emission directory ripple::TER diff --git a/src/ripple/app/tx/impl/Transactor.cpp b/src/ripple/app/tx/impl/Transactor.cpp index cf782965c..d117fd159 100644 --- a/src/ripple/app/tx/impl/Transactor.cpp +++ b/src/ripple/app/tx/impl/Transactor.cpp @@ -1128,7 +1128,7 @@ Transactor::operator()() // write state if all chains executed successfully if (result == tesSUCCESS) - hook::finalizeHookState(stateMap, ctx_); + hook::finalizeHookState(stateMap, ctx_, ctx_.tx.getTransactionID()); // write hook results for (auto& sendResult: sendResults) @@ -1225,14 +1225,14 @@ Transactor::operator()() // write any state changes if cbak resulted in accept() if (result == tesSUCCESS) - hook::finalizeHookState(stateMap, ctx_); + hook::finalizeHookState(stateMap, ctx_, ctx_.tx.getTransactionID()); // write the final result ripple::TER result = finalizeHookResult(callbackResult, ctx_, success); JLOG(j_.trace()) - << "HookInfo[" << HC_ACC() << "]: " + << "HookInfo[" << callbackAccountID << "-" <= 0xFFFFU) // RH TODO: limit the max number of state changes? { // overflow JLOG(j.warn()) - << "HooKError[" << HR_ACC << "]: SetHooKState failed: Too many state changes"; + << "HooKError[TX:" << txnID << "]: SetHooKState failed: Too many state changes"; return tecHOOK_REJECTED; } @@ -899,22 +899,22 @@ finalizeHookState( auto slice = Slice(blob.data(), blob.size()); TER result = - setHookState(hookResult, applyCtx, acc, ns, key, slice); + setHookState(applyCtx, acc, ns, key, slice); if (result != tesSUCCESS) { JLOG(j.warn()) - << "HookError[" << HR_ACC() << "]: SetHookState failed: " << result + << "HookError[TX:" << txnID << "]: SetHookState failed: " << result << " Key: " << key << " Value: " << slice; - + return result; } // ^ should not fail... checks were done before map insert } } } } - return changeCount; + return tesSUCCESS; } ripple::TER @@ -941,7 +941,7 @@ removeEmissionEntry(ripple::ApplyContext& applyCtx) false)) { JLOG(j.fatal()) - << "HookError[" << HR_ACC() << "]: ccl tefBAD_LEDGER"; + << "HookError[TX:" << tx.getTransactionID() << "]: removeEmissionEntry failed tefBAD_LEDGER"; return tefBAD_LEDGER; } @@ -958,7 +958,6 @@ finalizeHookResult( { auto const& j = applyCtx.app.journal("View"); - uint16_t change_count = 0; // open views do not modify add/remove ledger entries if (applyCtx.view().open())