I don't think you want to keep the walletmap locked during the actual RPC execution.