In commit “refactor: replace util::Ref by std::any (C++17)” (feb55dde39e59a2709ecefff848a1d8eb9fe69ca)
There’s a bug here and this change should be reverted. This line is supposed to create jreq as a copy of helpreq using the JSONRPCRequest copy constructor. Now it creates a new jreq request using the helpreq object as an embedded request context.
I’m not sure if this is a new bug, or this bug was present previously (even previously util::Ref constructor might have take precedence over copy constructor), but passing &helpreq here is not intended.
EDIT: Instead of reverting this, would suggest changing it to:
0JSONRPCRequest jreq = helpreq;
This would be more clear and prevent the context constructor from being called (since it’s marked explicit).