> CScriptVisitor was added in [[https://github.com/bitcoin/bitcoin/pull/1357 | core#1357]] and the visitor return type was never used. Now CScriptVisitor is stateless and CScript is the return type.
This is a backport of [[https://github.com/bitcoin/bitcoin/pull/18863 | core#18863]]