You shouldn't be able to retrieve a mutable node from a const node tree or a mutable socket from a const node. Use const_cast in one place in order to correct this without duplicating the function, which is still awkward in the C-API.
You shouldn't be able to retrieve a mutable node from a const node tree or a mutable socket from a const node. Use const_cast in one place in order to correct this without duplicating the function, which is still awkward in the C-API.