diff --git a/CMakeLists.txt b/CMakeLists.txt index 87e59432c..7de3cee42 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,6 +6,8 @@ endif () project (rippled) +set(Boost_NO_BOOST_CMAKE ON) + # make GIT_COMMIT_HASH define available to all sources find_package(Git) if(Git_FOUND) diff --git a/src/ripple/app/misc/impl/TxQ.cpp b/src/ripple/app/misc/impl/TxQ.cpp index 367f9660f..8bc8ec7a5 100644 --- a/src/ripple/app/misc/impl/TxQ.cpp +++ b/src/ripple/app/misc/impl/TxQ.cpp @@ -1440,8 +1440,7 @@ TxQ::accept(Application& app, OpenView& view) emittedDirKeylet.key, sleDirNode, uDirEntry, - dirEntry, - j_)) + dirEntry)) break; do @@ -1549,7 +1548,7 @@ TxQ::accept(Application& app, OpenView& view) JLOG(j_.fatal()) << "EmittedTxn Processing: Failure: " << e.what() << "\n"; } - } while (cdirNext(view, emittedDirKeylet.key, sleDirNode, uDirEntry, dirEntry, j_)); + } while (cdirNext(view, emittedDirKeylet.key, sleDirNode, uDirEntry, dirEntry)); } while(0); diff --git a/src/ripple/app/tx/applyHook.h b/src/ripple/app/tx/applyHook.h index 64e14bd82..f9f7ee733 100644 --- a/src/ripple/app/tx/applyHook.h +++ b/src/ripple/app/tx/applyHook.h @@ -1,3 +1,5 @@ +#ifndef APPLY_HOOK_INCLUDED +#define APPLY_HOOK_INCLUDED #include #include #include @@ -552,4 +554,4 @@ namespace hook { } - +#endif diff --git a/src/ripple/app/tx/impl/SetHook.cpp b/src/ripple/app/tx/impl/SetHook.cpp index 256e847e1..3207a63b9 100644 --- a/src/ripple/app/tx/impl/SetHook.cpp +++ b/src/ripple/app/tx/impl/SetHook.cpp @@ -1210,8 +1210,7 @@ SetHook::destroyNamespace( dirKeylet.key, sleDirNode, uDirEntry, - dirEntry, - ctx.j)) { + dirEntry)) { JLOG(ctx.j.fatal()) << "HookSet[" << HS_ACC() << "]: DeleteState " << "account directory missing " << account; @@ -1252,8 +1251,7 @@ SetHook::destroyNamespace( } - } while (cdirNext( - view, dirKeylet.key, sleDirNode, uDirEntry, dirEntry, ctx.j)); + } while (cdirNext(view, dirKeylet.key, sleDirNode, uDirEntry, dirEntry)); return tesSUCCESS; } @@ -1290,13 +1288,10 @@ SetHook::destroyNamespace( if (!newDirSLE)\ {\ newDirSLE = std::make_shared(*newDirKeylet);\ - auto const page = dirAdd(\ - view(),\ + auto const page = view().dirInsert(\ ownerDirKeylet,\ newDirKeylet->key,\ - false,\ - describeOwnerDir(account_),\ - ctx.j);\ + describeOwnerDir(account_));\ JLOG(ctx.j.trace()) << "Create state dir for account " << toBase58(account_)\ << ": " << (page ? "success" : "failure");\ if (!page)\ diff --git a/src/ripple/app/tx/impl/Transactor.cpp b/src/ripple/app/tx/impl/Transactor.cpp index 6219c0277..afe31b9cc 100644 --- a/src/ripple/app/tx/impl/Transactor.cpp +++ b/src/ripple/app/tx/impl/Transactor.cpp @@ -392,18 +392,18 @@ Transactor::checkSeqProxy( SeqProxy const a_seq = SeqProxy::sequence((*sle)[sfSequence]); // pass all emitted tx provided their seq is 0 - if (ctx.view.rules().enabled(featureHooks) && - hook::isEmittedTxn(ctx.tx)) + if (view.rules().enabled(featureHooks) && + hook::isEmittedTxn(tx)) { // this is more strictly enforced in the emit() hook api // here this is only acting as a sanity check in case of bugs - if (!ctx.tx.isFieldPresent(sfFirstLedgerSequence)) + if (!tx.isFieldPresent(sfFirstLedgerSequence)) return tefINTERNAL; return tesSUCCESS; } // reserved for emitted tx only at this time - if (ctx.tx.isFieldPresent(sfFirstLedgerSequence)) + if (tx.isFieldPresent(sfFirstLedgerSequence)) return tefINTERNAL; if (t_seqProx.isSeq()) @@ -495,7 +495,7 @@ Transactor::consumeSeqProxy(SLE::pointer const& sleAccount) // RH TODO: determine what interactions between hooks and tickets might cause issues // do not update sequence of sfAccountTxnID for emitted tx if (ctx_.emitted()) - return; + return tesSUCCESS; SeqProxy const seqProx = ctx_.tx.getSeqProxy(); if (seqProx.isSeq()) diff --git a/src/ripple/app/tx/impl/applyHook.cpp b/src/ripple/app/tx/impl/applyHook.cpp index 4cc0a7b9d..e9a16cbda 100644 --- a/src/ripple/app/tx/impl/applyHook.cpp +++ b/src/ripple/app/tx/impl/applyHook.cpp @@ -514,13 +514,10 @@ hook::setHookState( if (!oldHookState) { // Add the hook to the account's directory if it wasn't there already - auto const page = dirAdd( - view, + auto const page = view.dirInsert( hookStateDirKeylet, hookStateKeylet.key, - false, - describeOwnerDir(acc), - j); + describeOwnerDir(acc)); JLOG(j.trace()) << "HookInfo[" << HR_ACC() << "]: " << "Create/update hook state: " @@ -1686,15 +1683,19 @@ DEFINE_HOOK_FUNCTION( { uint256 hash; - if (!hash.SetHexExact((const char*)(memory + read_ptr))) + if (!hash.parseHex((const char*)(memory + read_ptr))) return INVALID_ARGUMENT; ripple::error_code_i ec { ripple::error_code_i::rpcUNKNOWN }; - std::shared_ptr hTx = applyCtx.app.getMasterTransaction().fetch(hash, ec); - if (!hTx) + + auto hTx = applyCtx.app.getMasterTransaction().fetch(hash, ec); + + if (!std::holds_alternative< + std::pair, std::shared_ptr>>>(hTx)) return DOESNT_EXIST; - slot_value = hTx->getSTransaction(); + slot_value = std::get, std::shared_ptr>>(hTx) + .first->getSTransaction(); } else return DOESNT_EXIST;