From 6973540d52cada447eb17fb83a4a71890667e986 Mon Sep 17 00:00:00 2001 From: Richard Holland Date: Fri, 24 May 2024 10:04:33 +1000 Subject: [PATCH] fix account type on js otxn_field --- src/ripple/app/hook/impl/applyHook.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/ripple/app/hook/impl/applyHook.cpp b/src/ripple/app/hook/impl/applyHook.cpp index b521094a8..a7a972b4e 100644 --- a/src/ripple/app/hook/impl/applyHook.cpp +++ b/src/ripple/app/hook/impl/applyHook.cpp @@ -3246,9 +3246,14 @@ DEFINE_JS_FUNCTION( uint8_t const* ptr = reinterpret_cast(s.getDataPtr()); size_t len = s.getDataLength(); - std::vector out_vec {ptr, ptr + len}; - - auto out = ToJSIntArray(ctx, out_vec); + + if (field.getSType() == STI_ACCOUNT && len > 1) + { + ptr++; + len--; + } + + auto out = ToJSIntArray(ctx, Slice{ptr, (size_t)len}); if (!out.has_value()) returnJS(INTERNAL_ERROR);